/* Generated by Cython 3.1.3 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "cython/inline.h",
            "cython/warnings.h"
        ],
        "include_dirs": [
            "cython"
        ],
        "language": "c++",
        "name": "SnapPyHP",
        "sources": [
            "cython/SnapPyHP.pyx"
        ]
    },
    "module_name": "SnapPyHP"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
#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 < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_1_3"
#define CYTHON_HEX_VERSION 0x030103F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#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_CPYTHON_FREETHREADING 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
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_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 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #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_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #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
  #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_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #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_CPYTHON_FREETHREADING 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_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #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
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
  #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
#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 && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#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
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#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))

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

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 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 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
#ifndef 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_VERSION_HEX >= 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)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x03090000
  #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_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS && 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 __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && 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
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON
  #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_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #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 CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#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

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

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

#define __PYX_HAVE__SnapPyHP
#define __PYX_HAVE_API__SnapPyHP
/* Early includes */
#include "warnings.h"
#include "stdlib.h"
#include "string.h"
#include "SnapPea.h"
#include "kernel_typedefs.h"
#include "positioned_tet.h"
#include "triangulation.h"
#include "winged_edge.h"
#include "link_projection.h"
#include "terse_triangulation.h"
#include "tersest_triangulation.h"
#include "unix_file_io.h"
#include "unix_cusped_census.h"
#include "unix_kit.h"
#include "kernel_prototypes.h"
#include "Dirichlet.h"
#include "addl_code.h"
#include "isomorphism_signature.h"
#include "ptolemy_types.h"
#include "change_peripheral_curves_nonorientable.h"
#include "gluing_equations_pgl.h"
#include "ptolemy_equations.h"
#include "inline.h"
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include "qd_real_SnapPy.h"
#include <math.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_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 __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


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

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

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

static const char* const __pyx_f[] = {
  "cython/SnapPyHP.pyx",
  "cython/core/basic.pyx",
  "cython/core/manifold.pyx",
  "cython/core/tail.pyx",
  "cython/core/triangulation.pyx",
  "cython/core/abelian_group.pyx",
  "cython/numbers/qd.pyx",
  "<stringsource>",
  "cython/core/fundamental_group.pyx",
  "cython/core/symmetry_group.pyx",
  "cython/core/dirichlet.pyx",
  "cython/core/cusp_neighborhoods.pyx",
  "cython/core/pickle.pyx",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif

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

/* CriticalSections.proto */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs
#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs
#define __Pyx_PyCriticalSection_End1(cs)
#define __Pyx_PyCriticalSection_End2(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin
#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin
#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End
#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_8SnapPyHP_Triangulation;
struct __pyx_obj_8SnapPyHP_Manifold;
struct __pyx_obj_8SnapPyHP_AbelianGroup;
struct __pyx_obj_8SnapPyHP_PresentationMatrix;
struct __pyx_obj_8SnapPyHP_CFundamentalGroup;
struct __pyx_obj_8SnapPyHP_CHolonomyGroup;
struct __pyx_obj_8SnapPyHP_SymmetryGroup;
struct __pyx_obj_8SnapPyHP_CDirichletDomain;
struct __pyx_obj_8SnapPyHP_CCuspNeighborhood;
struct __pyx_defaults;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr;
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr;
struct CuspNeighborhoods;
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_new_plink;
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation;
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation_from_name;
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_file;
struct __pyx_ctuple_WEPolyhedron__ptr__and_int;
typedef struct __pyx_ctuple_WEPolyhedron__ptr__and_int __pyx_ctuple_WEPolyhedron__ptr__and_int;
struct __pyx_opt_args_8SnapPyHP_listlike_to_triangulation;
struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP;

/* "SnapPyHP.pyx":5
 * # cython: embedsignature = False
 * 
 * ctypedef qd_real Real             # <<<<<<<<<<<<<<
 * 
 * include "SnapPy.pxi"
*/
typedef qd_real __pyx_t_8SnapPyHP_Real;

/* "cython/SnapPy.pxi":211
 *         c_TetrahedronData *tetrahedron_data
 * 
 * cdef struct c_CuspNeighborhoods "CuspNeighborhoods":             # <<<<<<<<<<<<<<
 *     c_Triangulation *its_triangulation
 * 
*/
struct CuspNeighborhoods {
  Triangulation *its_triangulation;
};

/* "cython/core/basic.pyx":405
 * 
 * # C type for a function of Real returning an object
 * ctypedef object (*func_real_to_obj)(Real)             # <<<<<<<<<<<<<<
 * 
 * # Convert Real to gen in an appropriate manner for this environment
*/
typedef PyObject *(*__pyx_t_8SnapPyHP_func_real_to_obj)(__pyx_t_8SnapPyHP_Real);

/* "cython/core/triangulation.pyx":114
 *             remove_hyperbolic_structures(self.c_triangulation)
 * 
 *     cdef get_from_new_plink(self, file_name=None):             # <<<<<<<<<<<<<<
 *         if LinkEditor is None:
 *             raise RuntimeError('PLink was not imported.')
*/
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_new_plink {
  int __pyx_n;
  PyObject *file_name;
};

/* "cython/core/triangulation.pyx":126
 *               'link complement.')
 * 
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):
*/
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation {
  int __pyx_n;
  PyObject *remove_finite_vertices;
};

/* "cython/core/triangulation.pyx":147
 *         Triangulation.dehn_fill(self, fillings)
 * 
 *     cdef get_triangulation_from_name(self, name, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 * 
 *         # Step 1. The easy databases.
*/
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation_from_name {
  int __pyx_n;
  PyObject *remove_finite_vertices;
};

/* "cython/core/triangulation.pyx":284
 *         self.c_triangulation = get_triangulation_from_PythonKLP(data, remove_finite_vertices)
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         try:
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
*/
struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_file {
  int __pyx_n;
  PyObject *remove_finite_vertices;
};

/* "cython/core/dirichlet.pyx":3
 * # Dirichlet Domains
 * 
 * cdef (WEPolyhedron*, int) get_generators_from_bytes(data_bytes,             # <<<<<<<<<<<<<<
 *                                                     double vertex_epsilon,
 *                                                     displacement,
*/
struct __pyx_ctuple_WEPolyhedron__ptr__and_int {
  WEPolyhedron *f0;
  int f1;
};

/* "cython/core/pickle.pyx":312
 * 
 * 
 * cdef c_Triangulation* listlike_to_triangulation(listlike,             # <<<<<<<<<<<<<<
 *                                                 num_or_cusps=0,
 *                                                 num_nonor_cusps=0,
*/
struct __pyx_opt_args_8SnapPyHP_listlike_to_triangulation {
  int __pyx_n;
  PyObject *num_or_cusps;
  PyObject *num_nonor_cusps;
  PyObject *cusp_indices;
  PyObject *peripheral_curves;
};

/* "cython/core/tail.pyx":756
 * signtype = {'R': KLPHalfTwistCL, 'L': KLPHalfTwistCCL}
 * 
 * cdef c_Triangulation* get_triangulation_from_PythonKLP(pythonklp, remove_finite_vertices=True) except *:             # <<<<<<<<<<<<<<
 *     cdef KLPProjection P
 *     cdef c_Triangulation *c_triangulation
*/
struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP {
  int __pyx_n;
  PyObject *remove_finite_vertices;
};

/* "cython/core/triangulation.pyx":4
 * import low_index
 * 
 * cdef class Triangulation():             # <<<<<<<<<<<<<<
 *     """
 *     A Triangulation object represents a compact 3-manifold with torus
*/
struct __pyx_obj_8SnapPyHP_Triangulation {
  PyObject_HEAD
  struct __pyx_vtabstruct_8SnapPyHP_Triangulation *__pyx_vtab;
  Triangulation *c_triangulation;
  PyObject *_DTcode;
  PyObject *_PDcode;
  PyObject *_cover_info;
  PyObject *_cache;
  PyObject *LE;
  PyObject *_link_file_full_path;
  PyObject *hyperbolic_structure_initialized;
};


/* "cython/core/manifold.pyx":3
 * # Manifolds
 * 
 * cdef class Manifold(Triangulation):             # <<<<<<<<<<<<<<
 *     """
 *     A Manifold is a :class:`Triangulation` together with a geometric structure.
*/
struct __pyx_obj_8SnapPyHP_Manifold {
  struct __pyx_obj_8SnapPyHP_Triangulation __pyx_base;
};


/* "cython/core/abelian_group.pyx":3
 * # Abelian Groups
 * 
 * cdef class AbelianGroup():             # <<<<<<<<<<<<<<
 *     """
 *     An AbelianGroup object represents a finitely generated abelian group,
*/
struct __pyx_obj_8SnapPyHP_AbelianGroup {
  PyObject_HEAD
  PyObject *divisors;
  PyObject *coefficients;
};


/* "cython/core/abelian_group.pyx":142
 * 
 * 
 * cdef class PresentationMatrix():             # <<<<<<<<<<<<<<
 *     """
 *     A sparse representation of the presentation matrix of an abelian group.
*/
struct __pyx_obj_8SnapPyHP_PresentationMatrix {
  PyObject_HEAD
  struct __pyx_vtabstruct_8SnapPyHP_PresentationMatrix *__pyx_vtab;
  int rows;
  int cols;
  PyObject *_row_support;
  PyObject *_col_support;
  PyObject *_entries;
  PyObject *_units;
  PyObject *dead_columns;
};


/* "cython/core/fundamental_group.pyx":103
 *         for g in int_list)
 * 
 * cdef class CFundamentalGroup():             # <<<<<<<<<<<<<<
 *     cdef c_GroupPresentation *c_group_presentation
 *     cdef c_Triangulation *c_triangulation
*/
struct __pyx_obj_8SnapPyHP_CFundamentalGroup {
  PyObject_HEAD
  GroupPresentation *c_group_presentation;
  Triangulation *c_triangulation;
  PyObject *num_cusps;
};


/* "cython/core/fundamental_group.pyx":485
 * 
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):             # <<<<<<<<<<<<<<
 *     def _matrix(self, word, group):
 *         """
*/
struct __pyx_obj_8SnapPyHP_CHolonomyGroup {
  struct __pyx_obj_8SnapPyHP_CFundamentalGroup __pyx_base;
};


/* "cython/core/symmetry_group.pyx":3
 * #  Symmetry_group
 * 
 * cdef class SymmetryGroup():             # <<<<<<<<<<<<<<
 *     """
 *     A SymmetryGroup is a group of self-isometries of hyperbolic
*/
struct __pyx_obj_8SnapPyHP_SymmetryGroup {
  PyObject_HEAD
  struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *__pyx_vtab;
  SymmetryGroup *c_symmetry_group;
  PyObject *_is_full_group;
  PyObject *_owns_c_symmetry_group;
};


/* "cython/core/dirichlet.pyx":97
 * 
 * 
 * cdef class CDirichletDomain():             # <<<<<<<<<<<<<<
 *     cdef WEPolyhedron *c_dirichlet_domain
 *     cdef c_Triangulation *c_triangulation
*/
struct __pyx_obj_8SnapPyHP_CDirichletDomain {
  PyObject_HEAD
  struct __pyx_vtabstruct_8SnapPyHP_CDirichletDomain *__pyx_vtab;
  WEPolyhedron *c_dirichlet_domain;
  Triangulation *c_triangulation;
  int c_num_generators;
};


/* "cython/core/cusp_neighborhoods.pyx":3
 * # Cusp Neighborhoods
 * 
 * cdef class CCuspNeighborhood():             # <<<<<<<<<<<<<<
 *     cdef c_CuspNeighborhoods *c_cusp_neighborhood
 *     cdef c_Triangulation *c_triangulation
*/
struct __pyx_obj_8SnapPyHP_CCuspNeighborhood {
  PyObject_HEAD
  struct CuspNeighborhoods *c_cusp_neighborhood;
  Triangulation *c_triangulation;
  int _num_cusps;
  PyObject *original_indices;
};


/* "cython/core/tail.pyx":376
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 *         self.Census_Morwen8 = tarfile.open(os.path.join(manifold_path, 'morwen8.tgz'), 'r:*')
*/
struct __pyx_defaults {
  PyObject_HEAD
  PyObject *arg0;
};


/* "cython/core/basic.pyx":551
 * 
 * def _StrLongestLen(l):
 *     return str(max(len(e) for e in l))             # <<<<<<<<<<<<<<
 * 
 * 
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_e;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "cython/core/triangulation.pyx":1353
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self, method='fold'):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation {
  PyObject_HEAD
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self;
};


/* "cython/core/triangulation.pyx":1393
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):             # <<<<<<<<<<<<<<
 *             raise IndexError('All cusps must be fillable.')
 *         cdef c_Triangulation* c_new_tri = NULL
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_c;
};


/* "cython/core/triangulation.pyx":2466
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):             # <<<<<<<<<<<<<<
 *                 permutation_rep = [[x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep]
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_p;
};


/* "cython/core/fundamental_group.pyx":98
 *     return word_list
 * 
 * def list_as_word(int_list, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word {
  PyObject_HEAD
  int __pyx_v_num_generators;
  PyObject *__pyx_v_verbose_form;
};


/* "cython/core/fundamental_group.pyx":100
 * def list_as_word(int_list, int num_generators, verbose_form):
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)             # <<<<<<<<<<<<<<
 *         for g in int_list)
 * 
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_g;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "cython/core/dirichlet.pyx":380
 *         return result
 * 
 *     def face_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of faces, each represented as a dictionary with
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list {
  PyObject_HEAD
  struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self;
  WEVertex *__pyx_v_vertex;
};


/* "cython/core/dirichlet.pyx":434
 *                 vertex = edge.v[end]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 vertex_indices.append(
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *__pyx_outer_scope;
  long __pyx_v_i;
  long __pyx_t_0;
};


/* "cython/core/dirichlet.pyx":636
 *         for matrix in matrices:
 *             for row in matrix:
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)             # <<<<<<<<<<<<<<
 *             result += '\n'
 *         return result
*/
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_x;
};



/* "cython/core/triangulation.pyx":4
 * import low_index
 * 
 * cdef class Triangulation():             # <<<<<<<<<<<<<<
 *     """
 *     A Triangulation object represents a compact 3-manifold with torus
*/

struct __pyx_vtabstruct_8SnapPyHP_Triangulation {
  PyObject *(*get_from_new_plink)(struct __pyx_obj_8SnapPyHP_Triangulation *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_new_plink *__pyx_optional_args);
  PyObject *(*get_triangulation)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation *__pyx_optional_args);
  PyObject *(*get_triangulation_from_name)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation_from_name *__pyx_optional_args);
  PyObject *(*get_HT_knot)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, PyObject *, PyObject *, PyObject *);
  PyObject *(*get_punctured_torus_bundle)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *);
  PyObject *(*get_from_file)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_file *__pyx_optional_args);
  PyObject *(*set_c_triangulation)(struct __pyx_obj_8SnapPyHP_Triangulation *, Triangulation *);
  PyObject *(*big_homology)(struct __pyx_obj_8SnapPyHP_Triangulation *);
  PyObject *(*c_presentation_matrix)(struct __pyx_obj_8SnapPyHP_Triangulation *);
  PyObject *(*csmall_homology)(struct __pyx_obj_8SnapPyHP_Triangulation *);
  RepresentationIntoSn *(*build_rep_into_Sn)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *);
};
static struct __pyx_vtabstruct_8SnapPyHP_Triangulation *__pyx_vtabptr_8SnapPyHP_Triangulation;


/* "cython/core/manifold.pyx":3
 * # Manifolds
 * 
 * cdef class Manifold(Triangulation):             # <<<<<<<<<<<<<<
 *     """
 *     A Manifold is a :class:`Triangulation` together with a geometric structure.
*/

struct __pyx_vtabstruct_8SnapPyHP_Manifold {
  struct __pyx_vtabstruct_8SnapPyHP_Triangulation __pyx_base;
  PyObject *(*_real_volume)(struct __pyx_obj_8SnapPyHP_Manifold *);
  PyObject *(*_cusped_complex_volume)(struct __pyx_obj_8SnapPyHP_Manifold *, Complex *, int *);
  PyObject *(*_old_chern_simons)(struct __pyx_obj_8SnapPyHP_Manifold *);
  PyObject *(*_chern_simons)(struct __pyx_obj_8SnapPyHP_Manifold *);
};
static struct __pyx_vtabstruct_8SnapPyHP_Manifold *__pyx_vtabptr_8SnapPyHP_Manifold;


/* "cython/core/abelian_group.pyx":142
 * 
 * 
 * cdef class PresentationMatrix():             # <<<<<<<<<<<<<<
 *     """
 *     A sparse representation of the presentation matrix of an abelian group.
*/

struct __pyx_vtabstruct_8SnapPyHP_PresentationMatrix {
  PyObject *(*_set)(struct __pyx_obj_8SnapPyHP_PresentationMatrix *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_8SnapPyHP_PresentationMatrix *__pyx_vtabptr_8SnapPyHP_PresentationMatrix;


/* "cython/core/symmetry_group.pyx":3
 * #  Symmetry_group
 * 
 * cdef class SymmetryGroup():             # <<<<<<<<<<<<<<
 *     """
 *     A SymmetryGroup is a group of self-isometries of hyperbolic
*/

struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup {
  PyObject *(*_set_c_symmetry_group)(struct __pyx_obj_8SnapPyHP_SymmetryGroup *, SymmetryGroup *);
};
static struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *__pyx_vtabptr_8SnapPyHP_SymmetryGroup;


/* "cython/core/dirichlet.pyx":97
 * 
 * 
 * cdef class CDirichletDomain():             # <<<<<<<<<<<<<<
 *     cdef WEPolyhedron *c_dirichlet_domain
 *     cdef c_Triangulation *c_triangulation
*/

struct __pyx_vtabstruct_8SnapPyHP_CDirichletDomain {
  PyObject *(*triangulate)(struct __pyx_obj_8SnapPyHP_CDirichletDomain *, PyObject *);
};
static struct __pyx_vtabstruct_8SnapPyHP_CDirichletDomain *__pyx_vtabptr_8SnapPyHP_CDirichletDomain;
/* #### Code section: utility_code_proto ### */

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

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

/* 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_mstate_global->__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* 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 *const *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"
  #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 * const*args, size_t nargs, PyObject *kwargs);

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

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

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

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
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_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#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 CYTHON_INLINE int __Pyx_ParseKeywords(
    PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
    PyObject *kwds2, PyObject *values[],
    Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

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

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

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

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
    (__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, has_gil)\
    (__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, has_gil)\
    (__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

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

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

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

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

/* PyObjectDelAttr.proto */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#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** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

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

/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#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);

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

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

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

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

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

/* LimitedApiGetTypeDict.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

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

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

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

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

/* CallTypeTraverse.proto */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

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

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
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 ||\
        (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL)
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if 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
    PyObject *defaults;
    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_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static 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 PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_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 || CYTHON_COMPILING_IN_LIMITED_API
#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);

/* 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 && CYTHON_ASSUME_SAFE_SIZE
    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 && CYTHON_ASSUME_SAFE_SIZE
    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 !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 !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
}

/* 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(PyLong_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?  __Pyx_PyFloat_AS_DOUBLE(obj) :\
 likely(PyLong_CheckExact(obj)) ?\
 PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

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

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

/* 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 */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
    PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple);
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

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

/* DictGetItem.proto */
#if !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

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

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

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

/* py_abs.proto */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
#define __Pyx_PyNumber_Absolute(x)\
    ((likely(PyLong_CheckExact(x))) ?\
         (likely(__Pyx_PyLong_IsNonNeg(x)) ? __Pyx_NewRef(x) : __Pyx_PyLong_AbsNeg(x)) :\
         PyNumber_Absolute(x))
#else
#define __Pyx_PyNumber_Absolute(x)  PyNumber_Absolute(x)
#endif

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

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

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

/* CallUnboundCMethod1.proto */
CYTHON_UNUSED
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

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

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

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

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

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

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

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

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

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

/* ByteArrayAppend.proto */
static CYTHON_INLINE int __Pyx_PyByteArray_Append(PyObject* bytearray, int value);

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

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

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

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

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

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

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

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

/* COrdinalToPyUnicode.proto */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);

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

/* IncludeStdlibH.proto */
#include <stdlib.h>

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

/* DivInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);

/* ModInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);

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

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

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

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

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

/* py_set_remove.proto */
static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key);

/* py_dict_pop.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value);

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

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

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

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

/* pop.proto */
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L);
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
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

/* UnicodeAsUCS4.proto */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);

/* object_ord.proto */
#define __Pyx_PyObject_Ord(c)\
    (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
static long __Pyx__PyObject_Ord(PyObject* c);

/* pop_index.proto */
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix);
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix);
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix);
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#else
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\
    __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
        __Pyx__PyObject_PopIndex(L, py_ix))
#endif

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

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

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2))
#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

/* SetStringIndexingError.proto */
static void __Pyx_SetStringIndexingError(const char* message, int has_gil);

/* GetItemIntByteArray.proto */
#define __Pyx_GetItemInt_ByteArray(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_ByteArray_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, has_gil) :\
    (__Pyx_SetStringIndexingError("bytearray index out of range", has_gil), -1))
static CYTHON_INLINE int __Pyx_GetItemInt_ByteArray_Fast(PyObject* string, Py_ssize_t i,
                                                         int wraparound, int boundscheck, int has_gil);

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

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

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

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

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

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

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* DelItemOnTypeDict.proto */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

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

/* ListPack.proto */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);

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

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

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

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

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);

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

/* ClassMethod.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include "descrobject.h"
#endif
CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

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

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

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

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

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

/* FromPy.proto */
static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KLPStrandType(KLPStrandType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KLPCrossingType(KLPCrossingType value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Boolean(Boolean value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Orientability(Orientability value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_FuncResult(FuncResult value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Permutation(Permutation value);

/* CIntFromPy.proto */
static CYTHON_INLINE Boolean __Pyx_PyLong_As_Boolean(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_CuspTopology(CuspTopology value);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE VertexIndex __Pyx_PyLong_As_VertexIndex(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE FaceIndex __Pyx_PyLong_As_FaceIndex(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Orientation(Orientation value);

/* CIntFromPy.proto */
static CYTHON_INLINE Orientation __Pyx_PyLong_As_Orientation(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatrixEntry(MatrixEntry value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_CoveringType(CoveringType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_SolutionType(SolutionType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatrixParity(MatrixParity value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Orbifold1(Orbifold1 value);

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

/* CIntFromPy.proto */
static CYTHON_INLINE Permutation __Pyx_PyLong_As_Permutation(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE Orientability __Pyx_PyLong_As_Orientability(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE KLPStrandType __Pyx_PyLong_As_KLPStrandType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE KLPCrossingType __Pyx_PyLong_As_KLPCrossingType(PyObject *);

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

/* Globals.proto */
static PyObject* __Pyx_Globals(void);

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

/* 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)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* IterNextPlain.proto */
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
#endif

/* ReturnWithStopIteration.proto */
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);

/* 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;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    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 __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
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);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);

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

/* GetRuntimeVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);

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

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

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

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_from_new_plink(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_new_plink *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_spec, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_triangulation_from_name(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_name, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation_from_name *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_HT_knot(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_crossings, PyObject *__pyx_v_alternation, PyObject *__pyx_v_index, PyObject *__pyx_v_remove_finite_vertices); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_punctured_torus_bundle(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_match); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_from_file(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_name, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_file *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_set_c_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, Triangulation *__pyx_v_c_triangulation); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_big_homology(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_c_presentation_matrix(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13Triangulation_csmall_homology(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto*/
static RepresentationIntoSn *__pyx_f_8SnapPyHP_13Triangulation_build_rep_into_Sn(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_perm_list); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_8Manifold__real_volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_8Manifold__cusped_complex_volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, Complex *__pyx_v_volume, int *__pyx_v_accuracy); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_8Manifold__old_chern_simons(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_8Manifold__chern_simons(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_18PresentationMatrix__set(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_13SymmetryGroup__set_c_symmetry_group(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self, SymmetryGroup *__pyx_v_c_symmetry_group); /* proto*/
static PyObject *__pyx_f_8SnapPyHP_16CDirichletDomain_triangulate(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_return_class); /* proto*/

/* Module declarations from "libcpp" */

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

/* Module declarations from "SnapPyHP" */
__PYX_EXTERN_C DL_EXPORT(int) SnapPy_test_flag;
__PYX_EXTERN_C DL_EXPORT(Boolean) gLongComputationInProgress;
__PYX_EXTERN_C DL_EXPORT(Boolean) gLongComputationCancelled;
__PYX_EXTERN_C DL_EXPORT(PyObject) *gLongComputationTicker;
static __pyx_t_8SnapPyHP_func_real_to_obj __pyx_v_8SnapPyHP_Real2gen;
static PyObject *__pyx_v_8SnapPyHP_IS_HUGE = 0;
static PyObject *__pyx_v_8SnapPyHP_IS_BIG = 0;
static PyObject *__pyx_v_8SnapPyHP_IS_COMPLETE = 0;
static PyObject *__pyx_f_8SnapPyHP_real_to_string(__pyx_t_8SnapPyHP_Real); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_Real2gen_direct(__pyx_t_8SnapPyHP_Real); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_Real2gen_string(__pyx_t_8SnapPyHP_Real); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_Real2Number(__pyx_t_8SnapPyHP_Real); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_Complex2Number(Complex); /*proto*/
__PYX_EXTERN_C void uFatalError(const char*, const char*); /*proto*/
__PYX_EXTERN_C void uLongComputationBegins(const char*, Boolean); /*proto*/
__PYX_EXTERN_C FuncResult uLongComputationContinues(void); /*proto*/
__PYX_EXTERN_C void uLongComputationEnds(void); /*proto*/
__PYX_EXTERN_C void uAcknowledge(const char*); /*proto*/
__PYX_EXTERN_C void uAbortMemoryFull(void); /*proto*/
__PYX_EXTERN_C int uQuery(const char*, const int, const char* *, const int); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_convert_and_free_identification_of_variables(Identification_of_variables); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_convert_and_free_integer_matrix(Integer_matrix_with_explanations); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_Complex2gen(Complex); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_RealImag2gen(__pyx_t_8SnapPyHP_Real, __pyx_t_8SnapPyHP_Real); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_Complex2complex(Complex); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_Real2float(__pyx_t_8SnapPyHP_Real); /*proto*/
static Complex __pyx_f_8SnapPyHP_complex2Complex(__pyx_t_double_complex); /*proto*/
static __pyx_t_8SnapPyHP_Real __pyx_f_8SnapPyHP_Object2Real(PyObject *); /*proto*/
static Complex __pyx_f_8SnapPyHP_Object2Complex(PyObject *); /*proto*/
static double __pyx_f_8SnapPyHP_Real2double(__pyx_t_8SnapPyHP_Real); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_B2B(Boolean); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_IsometryListToIsometries(IsometryList *); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_c_word_as_int_list(int *); /*proto*/
static int *__pyx_f_8SnapPyHP_c_word_from_list(PyObject *); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_int_to_gen_string(int, int, PyObject *); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_c_word_as_string(int *, int, PyObject *); /*proto*/
static __pyx_ctuple_WEPolyhedron__ptr__and_int __pyx_f_8SnapPyHP_get_generators_from_bytes(PyObject *, double, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static WEPolyhedron *__pyx_f_8SnapPyHP_dirichlet_from_O31_matrix_list(PyObject *, double, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_pickle_triangulation(Triangulation *); /*proto*/
static PyObject *__pyx_f_8SnapPyHP_pickle_tetrahedron_data(TetrahedronData *, int); /*proto*/
static Triangulation *__pyx_f_8SnapPyHP_unpickle_triangulation(PyObject *); /*proto*/
static int __pyx_f_8SnapPyHP_unpickle_tetrahedron_data(TetrahedronData *, PyObject *, int, int); /*proto*/
static Triangulation *__pyx_f_8SnapPyHP_listlike_to_triangulation(PyObject *, struct __pyx_opt_args_8SnapPyHP_listlike_to_triangulation *__pyx_optional_args); /*proto*/
static Triangulation *__pyx_f_8SnapPyHP_triangulation_from_bytes(PyObject *); /*proto*/
static int __pyx_f_8SnapPyHP_set_cusps(Triangulation *, PyObject *); /*proto*/
static Triangulation *__pyx_f_8SnapPyHP_get_fibered_manifold_associated_to_braid(PyObject *, PyObject *); /*proto*/
static Triangulation *__pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(PyObject *, struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_8SnapPyHP___pyx_unpickle_PresentationMatrix__set_state(struct __pyx_obj_8SnapPyHP_PresentationMatrix *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "SnapPyHP"
extern int __pyx_module_is_main_SnapPyHP;
int __pyx_module_is_main_SnapPyHP = 0;

/* Implementation of "SnapPyHP" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_eval;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_all;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_StopIteration;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = "\n";
static const char __pyx_k_0[] = "0";
static const char __pyx_k_1[] = "^-1";
static const char __pyx_k_5[] = "\200\001\330\004\013\2105\220\001\220\021";
static const char __pyx_k_A[] = "\nA:  ";
static const char __pyx_k_B[] = "B";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_E[] = " E";
static const char __pyx_k_F[] = " := F.";
static const char __pyx_k_G[] = "G";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_K[] = "K";
static const char __pyx_k_L[] = "L";
static const char __pyx_k_M[] = "M";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_Q[] = "Q: ";
static const char __pyx_k_R[] = "R";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_X[] = "X";
static const char __pyx_k_Y[] = "Y";
static const char __pyx_k_Z[] = "Z";
static const char __pyx_k_a[] = ".a";
static const char __pyx_k_b[] = ".b";
static const char __pyx_k_c[] = ".c.";
static const char __pyx_k_d[] = "%d";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_l[] = "l";
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_q[] = "\230q";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_u[] = "u";
static const char __pyx_k_v[] = "v";
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_z[] = "z";
static const char __pyx_k_2d[] = "<2d";
static const char __pyx_k_3d[] = "3d";
static const char __pyx_k_4q[] = "\200\001\330\004\013\2104\210q\220\001";
static const char __pyx_k_DT[] = "DT:";
static const char __pyx_k_GG[] = "GG";
static const char __pyx_k_LE[] = "LE";
static const char __pyx_k_M0[] = "M0";
static const char __pyx_k_M1[] = "M1";
static const char __pyx_k_S5[] = "S5";
static const char __pyx_k_SC[] = "SC";
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__6[] = "(\n  ";
static const char __pyx_k__7[] = "\n  ";
static const char __pyx_k__8[] = ")";
static const char __pyx_k__9[] = " ";
static const char __pyx_k_c0[] = "c0";
static const char __pyx_k_c1[] = "c1";
static const char __pyx_k_c2[] = "c2";
static const char __pyx_k_c3[] = "c3";
static const char __pyx_k_cs[] = "cs";
static const char __pyx_k_dB[] = "%dB";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_kl[] = "kl";
static const char __pyx_k_l0[] = "l0";
static const char __pyx_k_l1[] = "l1";
static const char __pyx_k_l2[] = "l2";
static const char __pyx_k_of[] = " of ";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_rb[] = "rb";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_w0[] = "w0";
static const char __pyx_k_w1[] = "w1";
static const char __pyx_k_wb[] = "wb";
static const char __pyx_k_0_0[] = "(0,0)";
static const char __pyx_k_0_q[] = "\200\001\330\0040\260\001\260\026\260q";
static const char __pyx_k_1G1[] = "\200\001\330\004\013\2101\210G\2201";
static const char __pyx_k_1_1[] = "\320\004;\2701\360\024\000\t\026\220\\\240\021\240&\250\001\330\010\013\2101\330\014\020\320\020*\250!";
static const char __pyx_k_1_2[] = "\2401";
static const char __pyx_k_1_q[] = "\320\004#\2401\360\034\000\t\020\320\017\037\230q\240\001";
static const char __pyx_k_6_1[] = "6_1";
static const char __pyx_k_7_A[] = "\200\001\330\004\013\2107\320\022$\240A";
static const char __pyx_k_A_1[] = "\200A\360\024\000\t\020\320\017*\250!\2501";
static const char __pyx_k_A_2[] = "\200A";
static const char __pyx_k_A_3[] = "A";
static const char __pyx_k_A_4[] = "\200A\330\010\016\320\016!\240\021\240!";
static const char __pyx_k_A_E[] = "\200A\360(\000\016\022\220\021\220*\230E\240\031\250!\330\014\022\220&\230\001\230\024\230[\250\002\250'\260\021\260!";
static const char __pyx_k_A_a[] = "\200A\330\010\031\230\021\230$\230a\330\032\033\330\032\033";
static const char __pyx_k_A_q[] = "\200\001\330\004\013\320\013\034\230A\230]\250%\250q\330\031\032";
static const char __pyx_k_A_t[] = "\200A\360\n\000\t\020\210t\320\023)\250\021";
static const char __pyx_k_D_d[] = "D%d";
static const char __pyx_k_E_2[] = "E";
static const char __pyx_k_F_2[] = "F";
static const char __pyx_k_O31[] = "O31";
static const char __pyx_k_Q_2[] = "Q";
static const char __pyx_k_Q_3[] = "\200\001\330\004\n\210+\220Q";
static const char __pyx_k_Qe1[] = "\210\001\330\014\023\220:\230Q\230e\2401";
static const char __pyx_k_Z_d[] = "Z/%d";
static const char __pyx_k__10[] = "";
static const char __pyx_k__11[] = ": ";
static const char __pyx_k__12[] = " + ";
static const char __pyx_k__13[] = " - ";
static const char __pyx_k__14[] = "[";
static const char __pyx_k__15[] = ",\n ";
static const char __pyx_k__16[] = " -> ";
static const char __pyx_k__17[] = "  ";
static const char __pyx_k__18[] = ")(";
static const char __pyx_k__19[] = "),(";
static const char __pyx_k__20[] = "^";
static const char __pyx_k__21[] = "_";
static const char __pyx_k__22[] = "-";
static const char __pyx_k__23[] = "+";
static const char __pyx_k__24[] = "~";
static const char __pyx_k__25[] = "<";
static const char __pyx_k__26[] = ">";
static const char __pyx_k__27[] = "), (";
static const char __pyx_k__28[] = ",";
static const char __pyx_k__30[] = ".";
static const char __pyx_k__32[] = "*";
static const char __pyx_k__33[] = "\n   ";
static const char __pyx_k__34[] = "|";
static const char __pyx_k__35[] = "\"";
static const char __pyx_k__36[] = "; ";
static const char __pyx_k__37[] = "); ";
static const char __pyx_k__39[] = ":";
static const char __pyx_k__40[] = "\\)";
static const char __pyx_k__41[] = "?";
static const char __pyx_k__42[] = "\230\021";
static const char __pyx_k__43[] = "\240\021";
static const char __pyx_k__44[] = "\260\001";
static const char __pyx_k__45[] = "\200\001\330\004\032\230!";
static const char __pyx_k__46[] = "\200\001\360\n\000\005\n\210\021\210!";
static const char __pyx_k_a_2[] = "a";
static const char __pyx_k_a_3[] = "\220a";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_ans[] = "ans";
static const char __pyx_k_b_2[] = "b";
static const char __pyx_k_bit[] = "bit";
static const char __pyx_k_c_2[] = "c";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_d_2[] = "d";
static const char __pyx_k_d_3[] = "~%d";
static const char __pyx_k_d_4[] = "-%d";
static const char __pyx_k_det[] = "det";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_elt[] = "elt";
static const char __pyx_k_end[] = "]; end,[])";
static const char __pyx_k_eqn[] = "eqn";
static const char __pyx_k_g_g[] = "(%g,%g)";
static const char __pyx_k_gap[] = "gap";
static const char __pyx_k_gen[] = "gen";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_gui[] = "gui";
static const char __pyx_k_hue[] = "hue";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_klp[] = "klp";
static const char __pyx_k_len[] = "len";
static const char __pyx_k_log[] = "log";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_mat[] = "mat";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_old[] = "old";
static const char __pyx_k_pad[] = "pad";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_q_1[] = "\200\001\340\004\005\330\004\n\210!\330\004\027\220q\330\004\013\2101";
static const char __pyx_k_q_2[] = "q";
static const char __pyx_k_q_j[] = "\320\004'\240q\330\010\016\210j\230\001\330\014\r";
static const char __pyx_k_r_2[] = "r:*";
static const char __pyx_k_rel[] = "rel";
static const char __pyx_k_rep[] = "rep";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_s_2[] = " %s\n";
static const char __pyx_k_s_3[] = "s ";
static const char __pyx_k_s_4[] = "%s";
static const char __pyx_k_sep[] = "sep";
static const char __pyx_k_stl[] = "stl";
static const char __pyx_k_str[] = "str";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tet[] = "tet";
static const char __pyx_k_tip[] = "tip";
static const char __pyx_k_tri[] = ".tri";
static const char __pyx_k_vol[] = "vol";
static const char __pyx_k_5_1D[] = "\320\0045\260]\300!\360\026\000\t\024\220>\240\021\240!\330\010\033\2301\230D\240\001\330\034(\250\n\260!";
static const char __pyx_k_6_QR[] = "\200\001\330\004\013\210?\230!\320\033+\2506\260\027\270\001\270\032\300>\320QR";
static const char __pyx_k_6s_s[] = "%-6s %s";
static const char __pyx_k_A_1A[] = "\200A\360\\\001\000\t\017\320\016#\2401\240A";
static const char __pyx_k_A_1D[] = "\200A\360\010\000\t\020\320\017#\2401\240D\250\001";
static const char __pyx_k_A_4q[] = "\200A\330\010\020\220\001\330\031\033\2304\230q";
static const char __pyx_k_A_AT[] = "\200A\330\010$\240A\240T\250\021";
static const char __pyx_k_A_IQ[] = "\200A\330\010\014\210I\220Q";
static const char __pyx_k_A_Kq[] = "\200A\330\010\014\210K\220q";
static const char __pyx_k_A_O4[] = "\200A\330\010\014\210O\2304\230~\250]\270!\330\010\014\320\014 \240\001";
static const char __pyx_k_A_Qa[] = "\200A\330\010\017\320\017%\240Q\240a";
static const char __pyx_k_A_t1[] = "\200A\330\010\017\210t\2201";
static const char __pyx_k_A_vQ[] = "\200A\330\010\017\210v\220Q";
static const char __pyx_k_Cusp[] = "Cusp ";
static const char __pyx_k_DT_2[] = "DT[";
static const char __pyx_k_DT_3[] = "DT";
static const char __pyx_k_DT_s[] = "DT:%s";
static const char __pyx_k_Info[] = "Info";
static const char __pyx_k_K7_1[] = "K7_1";
static const char __pyx_k_Link[] = "Link";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_SL2C[] = "SL2C";
static const char __pyx_k_TEXT[] = "TEXT";
static const char __pyx_k_Type[] = "Type";
static const char __pyx_k_a_il[] = "a_il";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_b_RL[] = "b++RL";
static const char __pyx_k_ball[] = "ball";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_bool[] = "bool";
static const char __pyx_k_byte[] = "byte";
static const char __pyx_k_cobs[] = "cobs";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_cols[] = "cols";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_cusp[] = " cusp";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_desc[] = "desc";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_disp[] = "disp";
static const char __pyx_k_edge[] = "edge";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_eqns[] = "eqns";
static const char __pyx_k_eval[] = "eval";
static const char __pyx_k_exit[] = "exit";
static const char __pyx_k_face[] = "face";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_fill[] = "fill";
static const char __pyx_k_find[] = "find";
static const char __pyx_k_fold[] = "fold";
static const char __pyx_k_form[] = "form";
static const char __pyx_k_func[] = "__func__";
static const char __pyx_k_gens[] = "gens";
static const char __pyx_k_gzip[] = "gzip";
static const char __pyx_k_imag[] = "imag";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_item[] = "item";
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_lazy[] = "lazy";
static const char __pyx_k_left[] = "left";
static const char __pyx_k_line[] = "line";
static const char __pyx_k_link[] = "link";
static const char __pyx_k_m003[] = "m003";
static const char __pyx_k_m004[] = "m004";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_maps[] = "maps";
static const char __pyx_k_mask[] = "mask";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_mult[] = "mult";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_next[] = "next";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_pair[] = "pair";
static const char __pyx_k_pari[] = "pari";
static const char __pyx_k_part[] = "part";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_perm[] = "perm";
static const char __pyx_k_rank[] = "rank";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_real[] = "real";
static const char __pyx_k_rect[] = "rect";
static const char __pyx_k_rels[] = "rels";
static const char __pyx_k_repr[] = "repr";
static const char __pyx_k_reps[] = "reps";
static const char __pyx_k_rows[] = "rows";
static const char __pyx_k_sage[] = "sage";
static const char __pyx_k_save[] = "save";
static const char __pyx_k_seed[] = "seed";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_side[] = "side";
static const char __pyx_k_sign[] = "sign";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_snap[] = "snap";
static const char __pyx_k_soln[] = "soln";
static const char __pyx_k_spec[] = "spec";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_t81F[] = "\320\004\032\230!\360\020\000\t\020\210t\2208\2301\230F\240!";
static const char __pyx_k_tail[] = "tail";
static const char __pyx_k_temp[] = "temp";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_unit[] = "unit";
static const char __pyx_k_view[] = "view";
static const char __pyx_k_word[] = "word";
static const char __pyx_k_x012[] = "x012";
static const char __pyx_k_xX_d[] = "([xX])(\\d+)";
static const char __pyx_k_y123[] = "y123";
static const char __pyx_k_3as_a[] = "\200\001\330\004\013\2103\210a\210s\220$\220a";
static const char __pyx_k_8_3_3[] = "8_3^3";
static const char __pyx_k_8_6_1[] = "\320\0048\270\001\360\030\000\t\026\220]\240!\2406\250\021\330\010\013\2101\330\014\020\320\020*\250!";
static const char __pyx_k_A_1_2[] = "\200A\330\010\017\320\017\"\240!\2401";
static const char __pyx_k_A_nAQ[] = "\200A\330\010\016\210n\230A\230Q";
static const char __pyx_k_A_q_2[] = "\200A\330\010\017\210q";
static const char __pyx_k_A_t1D[] = "\200A\330\010\017\210t\2201\220D\230\001";
static const char __pyx_k_A_t9E[] = "\200A\330\010\017\210t\2209\230E\240\021";
static const char __pyx_k_A_t_2[] = "\200A\330\010\017\210t\220=\240\001";
static const char __pyx_k_A_t_a[] = "\200A\330\010\017\210t\220;\230a";
static const char __pyx_k_A_t_q[] = "\200A\360\032\000\t\020\210t\220<\230q\240\001";
static const char __pyx_k_Braid[] = "Braid:";
static const char __pyx_k_Group[] = "Group<";
static const char __pyx_k_GrpFP[] = "GrpFP";
static const char __pyx_k_Image[] = "Image";
static const char __pyx_k_Index[] = "Index";
static const char __pyx_k_Klein[] = "Klein";
static const char __pyx_k_MsgIO[] = "MsgIO";
static const char __pyx_k_alpha[] = "alpha";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_b_RRL[] = "b-+RRL";
static const char __pyx_k_bases[] = "__bases__";
static const char __pyx_k_basis[] = "basis";
static const char __pyx_k_cache[] = "cache";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_codec[] = "codec";
static const char __pyx_k_cover[] = "cover";
static const char __pyx_k_cusps[] = "cusps";
static const char __pyx_k_drill[] = "drill";
static const char __pyx_k_edges[] = " edges; ";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_end_2[] = "end";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_euler[] = "euler";
static const char __pyx_k_faces[] = " faces";
static const char __pyx_k_files[] = "files";
static const char __pyx_k_flips[] = "flips";
static const char __pyx_k_flush[] = "flush";
static const char __pyx_k_group[] = "group";
static const char __pyx_k_ideal[] = "ideal";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_is_S5[] = "is_S5";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_klein[] = "klein";
static const char __pyx_k_len_2[] = "__len__";
static const char __pyx_k_line0[] = "line0";
static const char __pyx_k_line1[] = "line1";
static const char __pyx_k_line2[] = "line2";
static const char __pyx_k_line3[] = "line3";
static const char __pyx_k_ljust[] = "ljust";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_magma[] = "magma";
static const char __pyx_k_major[] = "major";
static const char __pyx_k_match[] = "match";
static const char __pyx_k_model[] = "model";
static const char __pyx_k_moves[] = "moves";
static const char __pyx_k_ncols[] = "ncols";
static const char __pyx_k_new_2[] = "new";
static const char __pyx_k_nrows[] = "nrows";
static const char __pyx_k_omega[] = "omega";
static const char __pyx_k_order[] = "order";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_parts[] = "parts";
static const char __pyx_k_perm0[] = "perm0";
static const char __pyx_k_perm1[] = "perm1";
static const char __pyx_k_perm2[] = "perm2";
static const char __pyx_k_perm3[] = "perm3";
static const char __pyx_k_perms[] = "perms";
static const char __pyx_k_plink[] = "plink";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_q_A_1[] = "\200\001\360\014\000\005\006\330\004\005\330\004\007\200q\330\010$\240A\330\004\013\2101";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_reach[] = "reach";
static const char __pyx_k_right[] = "right";
static const char __pyx_k_rjust[] = "rjust";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_s_x_s[] = "%s x %s";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_sided[] = "sided";
static const char __pyx_k_signs[] = "signs";
static const char __pyx_k_specs[] = "specs";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_table[] = "table";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tilts[] = "tilts";
static const char __pyx_k_title[] = "title";
static const char __pyx_k_to_do[] = "to_do";
static const char __pyx_k_total[] = "total";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_words[] = "words";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_x_d_1[] = "x%d^-1";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_12n123[] = "12n123";
static const char __pyx_k_17_14f[] = "%17.14f";
static const char __pyx_k_4s_40s[] = "%-4s %-40s %-";
static const char __pyx_k_A_1D_2[] = "\200A\360\020\000\t\020\320\017#\2401\240D\250\001";
static const char __pyx_k_A_1D_a[] = "\200A\360\032\000\t\024\2201\220D\230\001\330\010\017\320\017!\240\021\240$\240a";
static const char __pyx_k_A_AT_2[] = "\200A\360\010\000\t\020\320\017$\240A\240T\250\021";
static const char __pyx_k_A_iq_1[] = "\200A\330\010\036\230i\240q\250\001\330(-\250^\2701";
static const char __pyx_k_A_s_4q[] = "\200A\360\010\000\t\020\210s\220!\2204\220q";
static const char __pyx_k_A_s_Qd[] = "\200A\360\020\000\t\020\210s\220!\320\023-\250Q\250d\260!";
static const char __pyx_k_A_t1_2[] = "\200A\360\010\000\t\020\210t\2201";
static const char __pyx_k_A_t1_3[] = "\200A\360\020\000\t\020\210t\2201";
static const char __pyx_k_A_t_AQ[] = "\200A\360\010\000\t\020\210t\320\023$\240A\240Q";
static const char __pyx_k_A_vT_Q[] = "\200A\360\024\000\t\021\220\017\230v\240T\320)=\270Q";
static const char __pyx_k_A_v_Qa[] = "\200A\340\010\017\210v\320\025-\250Q\250a";
static const char __pyx_k_Ax_EQa[] = "\200A\360x\001\000\t\020\320\017%\320%E\300Q\300a";
static const char __pyx_k_Census[] = "Census";
static const char __pyx_k_HomGrp[] = "HomGrp";
static const char __pyx_k_Number[] = "Number";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_atexit[] = "atexit";
static const char __pyx_k_b_RL_2[] = "b+-RL";
static const char __pyx_k_binary[] = "binary ";
static const char __pyx_k_browse[] = "browse";
static const char __pyx_k_bundle[] = "bundle";
static const char __pyx_k_c_eqns[] = "c_eqns";
static const char __pyx_k_c_vars[] = "c_vars";
static const char __pyx_k_c_word[] = "c_word";
static const char __pyx_k_center[] = "center";
static const char __pyx_k_circle[] = "circle";
static const char __pyx_k_coeffs[] = "coeffs";
static const char __pyx_k_covers[] = "covers";
static const char __pyx_k_curdir[] = "curdir";
static const char __pyx_k_cutoff[] = "cutoff";
static const char __pyx_k_cutout[] = "cutout";
static const char __pyx_k_cyclic[] = "cyclic";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_degree[] = "degree";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_dict_3[] = "dict";
static const char __pyx_k_domain[] = "domain";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_engine[] = "engine";
static const char __pyx_k_exit_2[] = "__exit__";
static const char __pyx_k_filled[] = "_filled";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_func_2[] = "func";
static const char __pyx_k_g_eqns[] = "g_eqns";
static const char __pyx_k_gluing[] = "gluing";
static const char __pyx_k_groups[] = "groups";
static const char __pyx_k_header[] = "header";
static const char __pyx_k_images[] = "images";
static const char __pyx_k_isfile[] = "isfile";
static const char __pyx_k_isosig[] = "isosig";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_lenStr[] = "lenStr";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_letter[] = "letter";
static const char __pyx_k_log_im[] = "log_im";
static const char __pyx_k_log_re[] = "log_re";
static const char __pyx_k_lookup[] = "lookup";
static const char __pyx_k_marked[] = "marked";
static const char __pyx_k_matrix[] = "matrix";
static const char __pyx_k_matsnf[] = "matsnf";
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_next_2[] = "__next__";
static const char __pyx_k_number[] = "number";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_orient[] = "orient";
static const char __pyx_k_output[] = "output";
static const char __pyx_k_parity[] = "parity";
static const char __pyx_k_path_2[] = "__path__";
static const char __pyx_k_pickle[] = "pickle:";
static const char __pyx_k_pieces[] = "pieces";
static const char __pyx_k_prefix[] = "prefix";
static const char __pyx_k_radius[] = "radius";
static const char __pyx_k_record[] = "record";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_reopen[] = "reopen";
static const char __pyx_k_repr_2[] = "__repr__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_return[] = "return";
static const char __pyx_k_retval[] = "retval";
static const char __pyx_k_row_op[] = "row_op";
static const char __pyx_k_shapes[] = "shapes";
static const char __pyx_k_snappy[] = "__snappy__";
static const char __pyx_k_so_far[] = "so_far";
static const char __pyx_k_sorted[] = "sorted";
static const char __pyx_k_spec_2[] = "__spec__";
static const char __pyx_k_stderr[] = "stderr";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_t81F_2[] = "\320\004\031\230\021\360\016\000\t\020\210t\2208\2301\230F\240!";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_to_str[] = "to_str";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_verify[] = "verify";
static const char __pyx_k_vertex[] = "vertex";
static const char __pyx_k_volume[] = "volume";
static const char __pyx_k_0_9_0_9[] = "(.*?)((?:\\([0-9 .+-]+,[0-9 .+-]+\\))*$)";
static const char __pyx_k_16n1235[] = "16n1235";
static const char __pyx_k_2Qb_E_T[] = "\200\001\330\004\013\2102\210Q\210b\220\004\220E\230\024\230T\240\021";
static const char __pyx_k_4_1_1_a[] = "\320\004 \240\001\360\020\000\t\014\2104\320\017 \240\003\2401\330\014\023\2201\330\010\017\320\017!\240\021\240$\240a";
static const char __pyx_k_81_iq_a[] = "\320\004 \240\003\2408\2501\330\010\016\210i\220q\230\006\230a";
static const char __pyx_k_AB_M_WA[] = "\200A\360B\001\000\t\021\220\004\220M\240\024\240W\250A";
static const char __pyx_k_A_T_D_A[] = "\200A\330\010\020\320\020-\250T\260\033\270D\300\004\300A";
static const char __pyx_k_A_X_j_A[] = "\200A\330\010\020\220\001\330\021\025\220X\230\\\250\021\250$\250j\270\004\270A";
static const char __pyx_k_A_Yaq_0[] = "\200A\330\010\017\320\017%\240Y\250a\250q\330/0";
static const char __pyx_k_A_q_A_4[] = "\200A\330\010\t\330\014\023\320\023'\240q\250\004\250A\330\017\020\360\010\000\r\024\2204\220{\240!";
static const char __pyx_k_A_s_1_a[] = "\200A\360\020\000\t\020\210s\220!\320\0231\260\021\260$\260a";
static const char __pyx_k_A_s_31D[] = "\200A\360\026\000\t\020\210s\220!\320\0233\2601\260D\270\001";
static const char __pyx_k_A_s_4_1[] = "\200A\330\010\017\210s\220!\2204\220|\2401";
static const char __pyx_k_A_s_q_A[] = "\200A\360\010\000\t\020\210s\220!\320\023'\240q\250\004\250A";
static const char __pyx_k_A_t7_gT[] = "\200A\360\016\000\t\020\210t\2207\230$\230g\240T\250\021";
static const char __pyx_k_A_t_a_2[] = "\200A\360\010\000\t\020\210t\320\023&\240a";
static const char __pyx_k_Az_Na_a[] = "\200A\360z\001\000\t\n\330\014\"\320\"N\310a\330\020\026\220a";
static const char __pyx_k_Browser[] = "Browser";
static const char __pyx_k_DT_code[] = "DT_code";
static const char __pyx_k_DTcodec[] = "DTcodec";
static const char __pyx_k_GrpPerm[] = "GrpPerm";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_Integer[] = "Integer";
static const char __pyx_k_L104001[] = "L104001";
static const char __pyx_k_MTLinks[] = "MTLinks";
static const char __pyx_k_PD_code[] = "PD_code";
static const char __pyx_k_Surface[] = "Surface";
static const char __pyx_k_absImag[] = "absImag";
static const char __pyx_k_abspath[] = "abspath";
static const char __pyx_k_b_RRL_2[] = "b--RRL";
static const char __pyx_k_browser[] = "browser";
static const char __pyx_k_byteseq[] = "byteseq";
static const char __pyx_k_c_moves[] = "c_moves";
static const char __pyx_k_c_terse[] = "c_terse";
static const char __pyx_k_cb_menu[] = "cb_menu";
static const char __pyx_k_closest[] = "closest";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_complex[] = "complex";
static const char __pyx_k_content[] = "content";
static const char __pyx_k_corners[] = "corners";
static const char __pyx_k_cy_eval[] = "cy_eval";
static const char __pyx_k_delattr[] = "__delattr__";
static const char __pyx_k_delitem[] = "__delitem__";
static const char __pyx_k_details[] = "details";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_edges_2[] = "edges";
static const char __pyx_k_entries[] = "entries";
static const char __pyx_k_environ[] = "environ";
static const char __pyx_k_explode[] = "explode";
static const char __pyx_k_faces_2[] = "faces";
static const char __pyx_k_filling[] = "filling";
static const char __pyx_k_findall[] = "findall";
static const char __pyx_k_func_OK[] = "func_OK";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_get_tie[] = "get_tie";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_gluings[] = "gluings";
static const char __pyx_k_grouped[] = "grouped";
static const char __pyx_k_handles[] = "handles";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_islower[] = "islower";
static const char __pyx_k_layered[] = "layered";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_modulus[] = "modulus";
static const char __pyx_k_morwen8[] = "morwen8/";
static const char __pyx_k_myslice[] = "myslice";
static const char __pyx_k_new_tie[] = "new_tie";
static const char __pyx_k_new_tri[] = "new_tri";
static const char __pyx_k_no_arcs[] = "no_arcs";
static const char __pyx_k_num_gen[] = "num_gen";
static const char __pyx_k_num_tet[] = "num_tet";
static const char __pyx_k_of_link[] = "of_link";
static const char __pyx_k_popitem[] = "popitem";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_ptolemy[] = "ptolemy";
static const char __pyx_k_rect_im[] = "rect_im";
static const char __pyx_k_rect_re[] = "rect_re";
static const char __pyx_k_regular[] = "regular";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_segment[] = "segment";
static const char __pyx_k_set_tie[] = "set_tie";
static const char __pyx_k_setattr[] = "__setattr__";
static const char __pyx_k_setitem[] = "__setitem__";
static const char __pyx_k_snapPea[] = "snapPea";
static const char __pyx_k_snappea[] = "snappea";
static const char __pyx_k_stopper[] = "stopper";
static const char __pyx_k_strline[] = "strline";
static const char __pyx_k_success[] = "success";
static const char __pyx_k_surface[] = "surface";
static const char __pyx_k_tarfile[] = "tarfile";
static const char __pyx_k_tarpath[] = "tarpath";
static const char __pyx_k_tet_num[] = "tet_num";
static const char __pyx_k_tri_txt[] = "*.tri *.txt";
static const char __pyx_k_twister[] = "twister";
static const char __pyx_k_unknown[] = "unknown";
static const char __pyx_k_unnamed[] = "unnamed";
static const char __pyx_k_16_14f_I[] = "%16.14f*I";
static const char __pyx_k_2_3_move[] = "2-3 move";
static const char __pyx_k_3_2_move[] = "3-2 move";
static const char __pyx_k_A_1D_1_q[] = "\200A\340\010\022\320\022#\2401\240D\250\001\330\010\020\320\020\"\240!\2401\330\010\030\230\001\230\021\330\010\017\210q";
static const char __pyx_k_A_Ja_A_q[] = "\200A\340\010\014\210J\220a\330\010\014\320\014\034\230A\330\010\014\320\014\037\230q";
static const char __pyx_k_Alphabet[] = "Alphabet";
static const char __pyx_k_CuspInfo[] = "CuspInfo";
static const char __pyx_k_DT_4_6_2[] = "DT[4,6,2]";
static const char __pyx_k_DT_codes[] = "DT_codes";
static const char __pyx_k_HTWKnots[] = "HTWKnots";
static const char __pyx_k_Isometry[] = "Isometry";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_L13n9331[] = "L13n9331";
static const char __pyx_k_Manifold[] = "Manifold";
static const char __pyx_k_Obsolete[] = "\n    Obsolete.\n    ";
static const char __pyx_k_PreImage[] = "PreImage";
static const char __pyx_k_Relators[] = "\nRelators:\n   ";
static const char __pyx_k_SnapPyHP[] = "SnapPyHP";
static const char __pyx_k_accuracy[] = "accuracy";
static const char __pyx_k_add_note[] = "add_note";
static const char __pyx_k_add_rows[] = "add_rows";
static const char __pyx_k_as_ideal[] = "as_ideal";
static const char __pyx_k_at_least[] = "at least ";
static const char __pyx_k_b_string[] = "b_string";
static const char __pyx_k_c_center[] = "c_center";
static const char __pyx_k_c_matrix[] = "c_matrix";
static const char __pyx_k_c_string[] = "c_string";
static const char __pyx_k_c_target[] = "c_target";
static const char __pyx_k_callback[] = "callback";
static const char __pyx_k_canonize[] = "canonize";
static const char __pyx_k_complete[] = ": complete ";
static const char __pyx_k_contains[] = "__contains__";
static const char __pyx_k_data_ijk[] = "data_ijk";
static const char __pyx_k_database[] = "database";
static const char __pyx_k_datafile[] = "datafile";
static const char __pyx_k_dec_prec[] = "dec_prec";
static const char __pyx_k_distance[] = "distance";
static const char __pyx_k_factor_0[] = "factor_0";
static const char __pyx_k_factor_1[] = "factor_1";
static const char __pyx_k_filedata[] = "filedata";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_fill_all[] = "fill_all";
static const char __pyx_k_filled_2[] = "filled";
static const char __pyx_k_fillings[] = "fillings";
static const char __pyx_k_gap_init[] = "_gap_init_";
static const char __pyx_k_get_data[] = "get_data";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_homology[] = "homology";
static const char __pyx_k_identify[] = "identify";
static const char __pyx_k_infinite[] = "infinite";
static const char __pyx_k_int_list[] = "int_list";
static const char __pyx_k_internal[] = "internal";
static const char __pyx_k_length_2[] = " length";
static const char __pyx_k_manifold[] = "manifold";
static const char __pyx_k_matrices[] = "matrices";
static const char __pyx_k_matrix_2[] = "_matrix";
static const char __pyx_k_meridian[] = "meridian";
static const char __pyx_k_neighbor[] = "neighbor";
static const char __pyx_k_new_name[] = "new_name";
static const char __pyx_k_nonzeros[] = "nonzeros";
static const char __pyx_k_num_cols[] = "num_cols";
static const char __pyx_k_num_gens[] = "num_gens";
static const char __pyx_k_num_rows[] = "num_rows";
static const char __pyx_k_number_2[] = "_number_";
static const char __pyx_k_obsolete[] = "_obsolete";
static const char __pyx_k_of_shape[] = " of shape ";
static const char __pyx_k_operator[] = "operator";
static const char __pyx_k_pickle_2[] = "pickle";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_protocol[] = "protocol";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_raw_form[] = "raw_form";
static const char __pyx_k_readline[] = "readline";
static const char __pyx_k_relation[] = "relation";
static const char __pyx_k_relators[] = "relators";
static const char __pyx_k_return_F[] = "  return F/[";
static const char __pyx_k_savefile[] = "savefile";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_shortest[] = "shortest";
static const char __pyx_k_signtype[] = "signtype";
static const char __pyx_k_simplify[] = "simplify";
static const char __pyx_k_spectrum[] = "spectrum";
static const char __pyx_k_strategy[] = "strategy";
static const char __pyx_k_subgroup[] = "subgroup";
static const char __pyx_k_surfaces[] = "surfaces";
static const char __pyx_k_tempfile[] = "tempfile";
static const char __pyx_k_to_bytes[] = "_to_bytes";
static const char __pyx_k_topology[] = "topology";
static const char __pyx_k_type_str[] = "_type_str";
static const char __pyx_k_verified[] = "verified";
static const char __pyx_k_vertices[] = "vertices";
static const char __pyx_k_1G1L_AS_a[] = "\200\001\330\004\013\2101\210G\2201\220L\240\004\240A\240S\250\003\250;\260a";
static const char __pyx_k_3a_a_iq_a[] = "\320\004 \240\003\2403\240a\320':\270'\300\025\300a\330\010\016\210i\220q\230\006\230a";
static const char __pyx_k_3b_r_AV2Q[] = "\320\000\"\240!\330\004\013\2103\210b\220\007\220r\230\023\230A\230V\2402\240Q";
static const char __pyx_k_8_6_4_1_1[] = "\320\0048\270\001\360\n\000\t\026\220]\240!\2406\250\021\330\010\013\2104\320\017 \240\003\2401\330\014\r\330\010\013\2101\330\014\020\320\020*\250!";
static const char __pyx_k_A_1_4_4_A[] = "\320\004$\240A\360\036\000\t\014\2101\330\014\023\2204\320\027)\250\021\340\014\023\2204\220}\240A";
static const char __pyx_k_A_4q_4q_A[] = "\200A\360\014\000\t\014\2104\210q\330\014\023\2204\220q\230\004\230A";
static const char __pyx_k_A_D_AQ_C1[] = "\200A\360\n\000\t\r\210D\220\014\230A\230Q\330\010\017\320\017(\250\001\250\024\320-C\3001";
static const char __pyx_k_A_D_AQ_Cq[] = "\200A\360\010\000\t\r\210D\220\014\230A\230Q\330\010!\240\021\240$\320&<\270C\270q";
static const char __pyx_k_A_s_1_a_2[] = "\200A\360\022\000\t\020\210s\220!\320\0231\260\021\260$\260a";
static const char __pyx_k_All_files[] = "All files";
static const char __pyx_k_DT_0_9_01[] = "DT[:]? *(\\[[0-9, \\-\\(\\)]+\\](?: *, *\\[[01, ]+\\])?)$";
static const char __pyx_k_FreeGroup[] = "FreeGroup";
static const char __pyx_k_Info_keys[] = "Info.keys";
static const char __pyx_k_L_d_2d_3d[] = "L%d%.2d%.3d";
static const char __pyx_k_Orbifold1[] = "Orbifold1";
static const char __pyx_k_RawNumber[] = "RawNumber";
static const char __pyx_k_ShapeInfo[] = "ShapeInfo";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_a_zA_Z0_9[] = "([a-zA-Z0-9\\+\\-]+)$";
static const char __pyx_k_algorithm[] = "algorithm";
static const char __pyx_k_as_string[] = "as_string";
static const char __pyx_k_b_no_lLrR[] = "b([+-no])([+-])([lLrR]+)$";
static const char __pyx_k_bits_prec[] = "bits_prec";
static const char __pyx_k_c_new_tri[] = "c_new_tri";
static const char __pyx_k_canonical[] = "_canonical";
static const char __pyx_k_crossings[] = "crossings";
static const char __pyx_k_cusp_info[] = "cusp_info";
static const char __pyx_k_cusp_maps[] = "cusp_maps";
static const char __pyx_k_cusp_type[] = "cusp_type";
static const char __pyx_k_data_spec[] = "data_spec";
static const char __pyx_k_decorated[] = "decorated";
static const char __pyx_k_dehn_fill[] = "dehn_fill";
static const char __pyx_k_dual_rows[] = "dual_rows";
static const char __pyx_k_edge_list[] = "edge_list";
static const char __pyx_k_endpoints[] = "endpoints";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_equations[] = "equations";
static const char __pyx_k_face0_gen[] = "face0_gen";
static const char __pyx_k_face1_gen[] = "face1_gen";
static const char __pyx_k_face2_gen[] = "face2_gen";
static const char __pyx_k_face3_gen[] = "face3_gen";
static const char __pyx_k_face_list[] = "face_list";
static const char __pyx_k_facedicts[] = "facedicts";
static const char __pyx_k_file_name[] = "file_name";
static const char __pyx_k_filetypes[] = "filetypes";
static const char __pyx_k_filling_2[] = "filling_";
static const char __pyx_k_from_data[] = "from_data";
static const char __pyx_k_full_list[] = "full_list";
static const char __pyx_k_gen_names[] = "gen_names";
static const char __pyx_k_geodesics[] = "geodesics";
static const char __pyx_k_horoballs[] = "horoballs";
static const char __pyx_k_immutable[] = "_immutable";
static const char __pyx_k_in_radius[] = "in_radius";
static const char __pyx_k_intervals[] = "intervals";
static const char __pyx_k_irregular[] = "irregular";
static const char __pyx_k_is_isosig[] = "is_isosig";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_log_shape[] = "log_shape";
static const char __pyx_k_longitude[] = "longitude";
static const char __pyx_k_low_index[] = "low_index";
static const char __pyx_k_manifolds[] = "manifolds";
static const char __pyx_k_max_reach[] = "max_reach";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_monodromy[] = "monodromy";
static const char __pyx_k_neighbors[] = "neighbors";
static const char __pyx_k_num_cusps[] = "num_cusps";
static const char __pyx_k_num_edges[] = "num_edges";
static const char __pyx_k_num_faces[] = "num_faces";
static const char __pyx_k_num_links[] = "num_links";
static const char __pyx_k_one_sided[] = "one-sided";
static const char __pyx_k_opacities[] = "opacities";
static const char __pyx_k_orig_gens[] = "orig_gens";
static const char __pyx_k_precision[] = "_precision";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_q4_4_1_G6[] = "\320\004'\240q\3604\000\t\014\2104\320\017 \240\003\2401\330\014\r\330\010)\250\021\250$\320.@\300\001\330\010\014\210G\2206\230\021\230(\240!";
static const char __pyx_k_randomize[] = "randomize";
static const char __pyx_k_readlines[] = "readlines";
static const char __pyx_k_recompute[] = "recompute";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_splitting[] = "splitting";
static const char __pyx_k_structure[] = "structure";
static const char __pyx_k_to_string[] = "_to_string";
static const char __pyx_k_two_sided[] = "two_sided";
static const char __pyx_k_uARq_j_Ba[] = "\200\001\360 \000\005\006\330\010\017\210u\220A\220R\220q\230\001\330\013\014\330\010\016\210j\230\001\230\033\240B\240a";
static const char __pyx_k_v1205_2_3[] = "v1205(2,3)";
static const char __pyx_k_word_list[] = "word_list";
static const char __pyx_k_3a_WE_iq_a[] = "\320\004 \240\003\2403\240a\320'=\270W\300E\310\021\330\010\016\210i\220q\230\006\230a";
static const char __pyx_k_5_1Jc_1HAQ[] = "\210\001\330\014\023\2205\230\003\2301\230J\240c\250\027\260\003\2601\260H\270A\270Q";
static const char __pyx_k_A_31_t_A_q[] = "\200A\340,3\2601\360\010\000\t\020\210t\320\023$\240A\330\014\023\320\023'\240q";
static const char __pyx_k_A_at1_aq_q[] = "\200A\360\034\000\t\026\320\025&\240a\240t\2501\330\010\016\320\016&\240a\240q\330\010\017\210q";
static const char __pyx_k_FuncResult[] = "FuncResult";
static const char __pyx_k_GapElement[] = "GapElement";
static const char __pyx_k_Generators[] = "Generators:\n   ";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_LinkEditor[] = "LinkEditor";
static const char __pyx_k_Obsolete_2[] = "\n    Obsolete\n    ";
static const char __pyx_k_Orientable[] = "Orientable";
static const char __pyx_k_SageObject[] = "SageObject";
static const char __pyx_k_Stabilizer[] = "Stabilizer";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_Xcomponent[] = "Xcomponent";
static const char __pyx_k_Ycomponent[] = "Ycomponent";
static const char __pyx_k_acc_log_im[] = "acc_log_im";
static const char __pyx_k_acc_log_re[] = "acc_log_re";
static const char __pyx_k_acc_rec_im[] = "acc_rec_im";
static const char __pyx_k_acc_rec_re[] = "acc_rec_re";
static const char __pyx_k_accuracies[] = "accuracies";
static const char __pyx_k_all_tables[] = "__all_tables__";
static const char __pyx_k_b_new_name[] = "b_new_name";
static const char __pyx_k_bytestring[] = "bytestring";
static const char __pyx_k_c_factor_0[] = "c_factor_0";
static const char __pyx_k_c_factor_1[] = "c_factor_1";
static const char __pyx_k_c_meridian[] = "c_meridian";
static const char __pyx_k_c_new_name[] = "c_new_name";
static const char __pyx_k_complete_2[] = "complete";
static const char __pyx_k_complete_3[] = "complete?";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_cover_info[] = "cover_info";
static const char __pyx_k_cover_type[] = "cover_type";
static const char __pyx_k_covers_gap[] = "_covers_gap";
static const char __pyx_k_curve_list[] = "curve_list";
static const char __pyx_k_cusp_index[] = "cusp_index";
static const char __pyx_k_decoration[] = "decoration";
static const char __pyx_k_defined_in[] = "(), defined in ";
static const char __pyx_k_edge_class[] = "edge_class";
static const char __pyx_k_edge_index[] = "edge_index";
static const char __pyx_k_empty_save[] = "_empty_save";
static const char __pyx_k_exceptions[] = "exceptions";
static const char __pyx_k_export_stl[] = "export_stl";
static const char __pyx_k_face_index[] = "face_index";
static const char __pyx_k_filedialog[] = "filedialog";
static const char __pyx_k_filled_tri[] = "filled_tri";
static const char __pyx_k_format_str[] = "format_str";
static const char __pyx_k_from_bytes[] = "_from_bytes";
static const char __pyx_k_full_rigor[] = "full_rigor";
static const char __pyx_k_gap_string[] = "gap_string";
static const char __pyx_k_generators[] = "generators";
static const char __pyx_k_holonomies[] = "holonomies";
static const char __pyx_k_horoviewer[] = "horoviewer";
static const char __pyx_k_identify_2[] = "_identify";
static const char __pyx_k_input_type[] = "input_type";
static const char __pyx_k_is_HT_knot[] = "is_HT_knot";
static const char __pyx_k_is_abelian[] = "is_abelian";
static const char __pyx_k_isometries[] = "isometries";
static const char __pyx_k_its_matrix[] = "its_matrix";
static const char __pyx_k_magma_init[] = "_magma_init_";
static const char __pyx_k_meridian_2[] = "meridian_";
static const char __pyx_k_msg_stream[] = "msg_stream";
static const char __pyx_k_not_filled[] = ", not filled";
static const char __pyx_k_num_curves[] = "num_curves";
static const char __pyx_k_orientable[] = "orientable";
static const char __pyx_k_out_radius[] = "out_radius";
static const char __pyx_k_peripheral[] = "peripheral";
static const char __pyx_k_polyviewer[] = "polyviewer";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_rect_shape[] = "rect_shape";
static const char __pyx_k_set_DTcode[] = "_set_DTcode";
static const char __pyx_k_set_PDcode[] = "_set_PDcode";
static const char __pyx_k_set_name_2[] = "set_name";
static const char __pyx_k_six_length[] = "six_length";
static const char __pyx_k_smith_form[] = "smith_form";
static const char __pyx_k_spherogram[] = "spherogram";
static const char __pyx_k_spin_short[] = "spin_short";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_strandtype[] = "strandtype";
static const char __pyx_k_torus_cusp[] = "torus cusp";
static const char __pyx_k_which_cusp[] = "which_cusp";
static const char __pyx_k_with_euler[] = " with euler = ";
static const char __pyx_k_word_moves[] = "_word_moves";
static const char __pyx_k_A_3hc_G1_G1[] = "\200A\330\010\013\2103\210h\220c\230\021\330\014\020\220\t\230\021\330\014\020\220\t\230\021\340\014\020\220\t\230\023\230G\2401\330\014\020\220\t\230\023\230G\2401";
static const char __pyx_k_A_41_s_A_1A[] = "\200A\360\020\000\t4\2601\330\010\017\210s\220!\320\023,\250A\330\014\020\320\020#\2401\240A";
static const char __pyx_k_A_6a_t_31_Q[] = "\200A\330\010\021\320\021!\240\024\320%6\260a\330\010\020\220\017\230t\320#3\2601\330\010\017\320\017*\250(\260'\270\024\270Q";
static const char __pyx_k_A_D_AQ_4q_k[] = "\320\004<\270A\360\010\000\t\r\210D\220\014\230A\230Q\330\010*\250!\2504\250q\330+.\250k\270\021\270!";
static const char __pyx_k_A_D_AQ_7q_a[] = "\200A\360\014\000\t\r\210D\220\014\230A\230Q\330\010\017\320\0177\260q\330\014\020\320\020&\240a";
static const char __pyx_k_A_s_q_A06fF[] = "\200A\360\n\000\t\020\210s\220!\320\023/\250q\260\004\260A\33006\260f\270F\300!";
static const char __pyx_k_B_V1F_7_A_a[] = "\320\004(\250\001\360B\002\000\t\021\220\r\230V\2401\240F\250!\330\010\017\320\017*\250!\2507\260*\270A\330+:\270$\270a";
static const char __pyx_k_Bb_raid_0_9[] = "[Bb]raid[:]?(\\[[0-9, \\-]+\\])$";
static const char __pyx_k_Census_next[] = "Census.next";
static const char __pyx_k_CosetAction[] = "CosetAction";
static const char __pyx_k_F_FreeGroup[] = "; F := FreeGroup(";
static const char __pyx_k_Ford_domain[] = "Ford_domain";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Info___init[] = "Info.__init__";
static const char __pyx_k_LinkManager[] = "LinkManager";
static const char __pyx_k_MorwenLinks[] = "MorwenLinks";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_SnapPyCache[] = "SnapPyCache";
static const char __pyx_k_UI_callback[] = "UI_callback";
static const char __pyx_k_a_4_1_vQ_AT[] = "\320\004\026\220a\360\020\000\t\014\2104\320\017 \240\003\2401\330\014\r\330\010\017\210v\220Q\320\026,\250A\250T\260\021";
static const char __pyx_k_alternation[] = "alternation";
static const char __pyx_k_as_int_list[] = "as_int_list";
static const char __pyx_k_assignments[] = "assignments";
static const char __pyx_k_b_file_name[] = "b_file_name";
static const char __pyx_k_c_longitude[] = "c_longitude";
static const char __pyx_k_c_opacities[] = "c_opacities";
static const char __pyx_k_check_index[] = "check_index";
static const char __pyx_k_clear_marks[] = "clear_marks";
static const char __pyx_k_col_support[] = "col_support";
static const char __pyx_k_core_length[] = "core_length";
static const char __pyx_k_cover_count[] = "cover_count";
static const char __pyx_k_cover_types[] = "cover_types";
static const char __pyx_k_cusp_images[] = "cusp_images";
static const char __pyx_k_cusp_maps_2[] = "_cusp_maps";
static const char __pyx_k_dLQbcccdxwb[] = "dLQbcccdxwb";
static const char __pyx_k_dual_curves[] = "dual_curves";
static const char __pyx_k_extractfile[] = "extractfile";
static const char __pyx_k_five_length[] = "five_length";
static const char __pyx_k_from_isosig[] = "_from_isosig";
static const char __pyx_k_from_pickle[] = "_from_pickle";
static const char __pyx_k_from_string[] = "_from_string";
static const char __pyx_k_func_failed[] = "func_failed";
static const char __pyx_k_interrupted[] = "interrupted";
static const char __pyx_k_is_complete[] = "is_complete";
static const char __pyx_k_is_dihedral[] = "is_dihedral";
static const char __pyx_k_longitude_2[] = "longitude_";
static const char __pyx_k_morwen8_tgz[] = "morwen8.tgz";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_num_lengths[] = "num_lengths";
static const char __pyx_k_num_threads[] = "num_threads";
static const char __pyx_k_output_file[] = "output_file";
static const char __pyx_k_permutation[] = "permutation";
static const char __pyx_k_precision_2[] = "precision";
static const char __pyx_k_return_type[] = "return_type";
static const char __pyx_k_row_entries[] = "row_entries";
static const char __pyx_k_sage_helper[] = "sage_helper";
static const char __pyx_k_sage_matrix[] = "sage_matrix";
static const char __pyx_k_sage_object[] = "sage_object";
static const char __pyx_k_second_char[] = "second_char";
static const char __pyx_k_to_byte_str[] = "to_byte_str";
static const char __pyx_k_two_sided_2[] = "two-sided";
static const char __pyx_k_user_radius[] = "user_radius";
static const char __pyx_k_valid_index[] = "valid_index";
static const char __pyx_k_vertex_list[] = "_vertex_list";
static const char __pyx_k_which_curve[] = "which_curve";
static const char __pyx_k_within_sage[] = "_within_sage";
static const char __pyx_k_4_1_AQ_at_5Q[] = "\320\004\"\240(\250!\360\022\000\t\026\220[\240\001\240\021\330\010 \240\001\330\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\036\230a\230t\320#5\260Q";
static const char __pyx_k_A_83a_aq_waq[] = "\200A\360\030\000\t\014\2108\2203\220a\330\014\022\220,\230a\230q\330\010\017\210w\220a\220q";
static const char __pyx_k_A_AT_4A_t9AQ[] = "\200A\360\010\000\t\022\220\033\230A\230T\320!4\260A\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_A_axq_q_t9AQ[] = "\200A\360\010\000\t\021\220\006\220a\220x\230q\320 ?\270q\330\014\020\220\001\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_AbelianGroup[] = "AbelianGroup";
static const char __pyx_k_Census_Knots[] = "Census_Knots";
static const char __pyx_k_Census___len[] = "Census.__len__";
static const char __pyx_k_ChristyLinks[] = "ChristyLinks";
static const char __pyx_k_CuspTopology[] = "CuspTopology";
static const char __pyx_k_CuspedCensus[] = "CuspedCensus";
static const char __pyx_k_DT_a_zA_Z_01[] = "DT[:\\[] *([a-zA-Z]+(?:\\.[01]+)?)[\\]]?$";
static const char __pyx_k_Generators_2[] = "% Generators";
static const char __pyx_k_Generators_s[] = "%% Generators\n%s\n";
static const char __pyx_k_MagmaElement[] = "MagmaElement";
static const char __pyx_k_MatrixParity[] = "MatrixParity";
static const char __pyx_k_MsgIO___init[] = "MsgIO.__init__";
static const char __pyx_k_Q_4_1_1_1D_8[] = "\320\004%\240Q\360*\000\t\014\2104\320\017 \240\003\2401\330\014\023\2201\340\010\023\2201\220D\230\001\330\010\017\320\017!\240\021\240$\320&8\270\002\270!";
static const char __pyx_k_Q_4t_AQ_Q_G6[] = "\320\004%\240Q\360\026\000\t\014\2104\210t\220>\240\021\330\014\022\220*\230A\230Q\340\010\020\220\001\220\024\220Q\330\010\014\210G\2206\230\021\230(\240!";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_SolutionType[] = "SolutionType";
static const char __pyx_k_ViewerWindow[] = "ViewerWindow";
static const char __pyx_k_betti_number[] = "betti_number";
static const char __pyx_k_c_cover_type[] = "c_cover_type";
static const char __pyx_k_c_filled_tri[] = "c_filled_tri";
static const char __pyx_k_census_index[] = "census_index";
static const char __pyx_k_chern_simons[] = "chern_simons";
static const char __pyx_k_coset_action[] = "coset_action";
static const char __pyx_k_covers_magma[] = "_covers_magma";
static const char __pyx_k_cusp_indices[] = "cusp_indices";
static const char __pyx_k_displacement[] = "displacement";
static const char __pyx_k_edge_indices[] = "edge_indices";
static const char __pyx_k_eight_length[] = "eight_length";
static const char __pyx_k_explain_cols[] = "explain_cols";
static const char __pyx_k_explain_rows[] = "explain_rows";
static const char __pyx_k_fill_by_fold[] = "fill_by_fold";
static const char __pyx_k_filling_data[] = "filling_data";
static const char __pyx_k_first_nybble[] = "first_nybble";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_is_geometric[] = "is_geometric";
static const char __pyx_k_link_archive[] = "link_archive";
static const char __pyx_k_list_as_word[] = "list_as_word";
static const char __pyx_k_magma_string[] = "magma_string";
static const char __pyx_k_max_segments[] = "max_segments";
static const char __pyx_k_mirrored_arc[] = "mirrored arc";
static const char __pyx_k_multiplicity[] = "multiplicity";
static const char __pyx_k_neighbor_end[] = "neighbor_end";
static const char __pyx_k_num_or_cusps[] = "num_or_cusps";
static const char __pyx_k_num_relators[] = "num_relators";
static const char __pyx_k_num_surfaces[] = "num_surfaces";
static const char __pyx_k_num_vertices[] = "num_vertices";
static const char __pyx_k_one_manifold[] = "_one_manifold";
static const char __pyx_k_presentation[] = "presentation";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_segment_list[] = "segment_list";
static const char __pyx_k_seven_length[] = "seven_length";
static const char __pyx_k_side_lengths[] = "side_lengths";
static const char __pyx_k_spine_radius[] = "spine_radius";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_three_to_two[] = "_three_to_two";
static const char __pyx_k_translations[] = "translations";
static const char __pyx_k_twister_word[] = "twister_word";
static const char __pyx_k_two_to_three[] = "_two_to_three";
static const char __pyx_k_unnamed_link[] = "unnamed link";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_verbose_form[] = "verbose_form";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_vertex_class[] = "vertex_class";
static const char __pyx_k_word_as_list[] = "word_as_list";
static const char __pyx_k_5_2_1_3_4_1_2[] = "5^2_1(3,4)(1,-2)";
static const char __pyx_k_A_6_6_3c_aq_q[] = "\200A\330 *\250!\360,\000\t\022\320\021%\320%:\270!\2706\300\021\330\010\013\2106\220\032\2303\230c\240\021\330\014\023\320\023.\250a\250q\330\010\017\210q";
static const char __pyx_k_A_E_Qd_q_6_4q[] = "\200A\360\010\000\t\r\210E\220\024\220Q\220d\230-\240q\250\001\330\014\020\220\001\220\022\2206\230\021\230!\2304\230q\240\002\240!";
static const char __pyx_k_A_s_1Bd_t_S_Q[] = "\200A\360\010\000\t\020\210s\220!\2201\220B\220d\230%\230t\240:\250S\260\002\260#\260Q";
static const char __pyx_k_Braid_1_2_1_2[] = "Braid[1,2,-1,-2]";
static const char __pyx_k_Bundle_S__d_d[] = "Bundle\\(S_\\{(\\d+),(\\d+)\\},";
static const char __pyx_k_CensusKnots_s[] = "CensusKnots/%s";
static const char __pyx_k_Census___init[] = "Census.__init__";
static const char __pyx_k_Census___iter[] = "Census.__iter__";
static const char __pyx_k_Christy_links[] = "Christy_links";
static const char __pyx_k_D_AQ_q_B_t9AQ[] = "\320\004 \240\001\360\n\000\t\r\210D\220\014\230A\230Q\330\010\021\220\026\220q\230\010\240\001\320!B\300!\330\020\024\320\024*\250!\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_DualCurveInfo[] = "DualCurveInfo";
static const char __pyx_k_HolonomyGroup[] = "HolonomyGroup";
static const char __pyx_k_KLPProjection[] = "KLPProjection";
static const char __pyx_k_KnotExteriors[] = "KnotExteriors";
static const char __pyx_k_LinkExteriors[] = "LinkExteriors";
static const char __pyx_k_Manifold_copy[] = "Manifold.copy";
static const char __pyx_k_Orientability[] = "Orientability";
static const char __pyx_k_Out_of_memory[] = "Out of memory.\n";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_StrLongestLen[] = "_StrLongestLen";
static const char __pyx_k_SymmetryGroup[] = "SymmetryGroup";
static const char __pyx_k_Triangulation[] = "% Triangulation";
static const char __pyx_k_are_isometric[] = "are_isometric";
static const char __pyx_k_asksaveasfile[] = "asksaveasfile";
static const char __pyx_k_c_core_length[] = "c_core_length";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_combinatorial[] = "combinatorial";
static const char __pyx_k_comm_subgroup[] = "comm_subgroup";
static const char __pyx_k_current_shape[] = "current_shape";
static const char __pyx_k_cusp_images_2[] = "_cusp_images";
static const char __pyx_k_cusps_to_fill[] = "cusps_to_fill";
static const char __pyx_k_cutoff_length[] = "cutoff_length";
static const char __pyx_k_cutoff_radius[] = "cutoff_radius";
static const char __pyx_k_edge_to_index[] = "edge_to_index";
static const char __pyx_k_edge_valences[] = "edge_valences";
static const char __pyx_k_equation_type[] = "equation_type";
static const char __pyx_k_filled_length[] = "filled_length";
static const char __pyx_k_filled_shapes[] = "filled_shapes";
static const char __pyx_k_horoball_list[] = "horoball_list";
static const char __pyx_k_ignore_curves[] = "ignore_curves";
static const char __pyx_k_include_words[] = "include_words";
static const char __pyx_k_initial_shape[] = "initial_shape";
static const char __pyx_k_is_GapElement[] = "is_GapElement";
static const char __pyx_k_is_full_group[] = "is_full_group";
static const char __pyx_k_is_orientable[] = "is_orientable";
static const char __pyx_k_is_polyhedral[] = "is_polyhedral";
static const char __pyx_k_is_symplectic[] = "_is_symplectic";
static const char __pyx_k_is_two_bridge[] = "is_two_bridge";
static const char __pyx_k_long_relators[] = "long_relators";
static const char __pyx_k_manifold_name[] = "manifold_name";
static const char __pyx_k_manifold_path[] = "manifold_path";
static const char __pyx_k_max_crossings[] = "max_crossings";
static const char __pyx_k_neighbor0_idx[] = "neighbor0_idx";
static const char __pyx_k_neighbor1_idx[] = "neighbor1_idx";
static const char __pyx_k_neighbor2_idx[] = "neighbor2_idx";
static const char __pyx_k_neighbor3_idx[] = "neighbor3_idx";
static const char __pyx_k_nonorientable[] = "nonorientable";
static const char __pyx_k_not_attempted[] = "not attempted";
static const char __pyx_k_num_crossings[] = "num_crossings";
static const char __pyx_k_num_orig_gens[] = "num_orig_gens";
static const char __pyx_k_num_relations[] = "num_relations";
static const char __pyx_k_one_tet_tilts[] = "one_tet_tilts";
static const char __pyx_k_orientability[] = "orientability";
static const char __pyx_k_pairing_words[] = "pairing_words";
static const char __pyx_k_q_4_1_at1_q_a[] = "\320\004?\270q\330\010\013\2104\320\017 \240\003\2401\330\014\036\230a\230t\2401\330\010\014\320\014\037\320\037?\270q\300\006\300a";
static const char __pyx_k_q_A_Qhc_aq_G6[] = "\320\004\032\230!\360$\000\t\022\220\036\230q\240\004\240A\330\010\013\210:\220Q\220h\230c\240\021\330\014\022\220,\230a\230q\340\010\014\210G\2206\230\021\230(\240!";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_reindex_cusps[] = "_reindex_cusps";
static const char __pyx_k_relation_list[] = "relation_list";
static const char __pyx_k_result_curves[] = "result_curves";
static const char __pyx_k_rev_spec_dict[] = "rev_spec_dict";
static const char __pyx_k_second_nybble[] = "second_nybble";
static const char __pyx_k_set_rand_seed[] = "set_rand_seed";
static const char __pyx_k_set_test_flag[] = "set_test_flag";
static const char __pyx_k_shrink_factor[] = "shrink_factor";
static const char __pyx_k_solution_type[] = "solution_type";
static const char __pyx_k_triangulation[] = "triangulation";
static const char __pyx_k_vertex_list_2[] = "vertex_list";
static const char __pyx_k_was_not_found[] = " was not found.\n";
static const char __pyx_k_which_surface[] = "which_surface";
static const char __pyx_k_3a_Q_iq_a_G5_a[] = "\320\004 \240\003\2403\240a\320'=\270Q\330\010\016\210i\220q\230\006\230a\330\010\014\320\014\034\230G\2405\250\001\320)>\270a";
static const char __pyx_k_5Q_DAf_9_Q_q_q[] = "\320\0045\260Q\330#D\300A\360f\005\000\t\020\320\017%\320%9\270\021\330\014\022\220#\220Q\330\014\027\220q\330\014'\240q";
static const char __pyx_k_A_1_4_q_AQ_2_1[] = "\200A\360\032\000\t1\260\001\330\010\013\2104\320\017 \240\007\240q\330\014\022\220*\230A\230Q\330\010\032\320\0322\260!\2601\330\010\014\320\014 \240\001\240\021";
static const char __pyx_k_A_AT_4A_t9AQ_2[] = "\200A\360\n\000\t\022\220\033\230A\230T\320!4\260A\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_A_AT_4A_t9AQ_3[] = "\200A\360\022\000\t\022\220\033\230A\230T\320!4\260A\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_A_Cq_2S_D_1_AQ[] = "\200A\360\010\000\t\r\210C\210q\220\001\330\010\013\2102\210S\220\004\220D\230\001\330\014\023\2201\340\014\022\220*\230A\230Q\330&(\250\001";
static const char __pyx_k_A_D_Q_1_1AQ_5S[] = "\200A\360\030\000\t\r\210D\220\005\220Q\330\010\t\210\031\220!\330\010!\240\021\240!\2401\330\010\023\2201\220A\220Q\330\010\017\320\017!\240\021\240!\320#5\260S\270\001";
static const char __pyx_k_A_a_E_Q_b_T_G1[] = "\200A\360\n\000\t\017\210a\330\010\014\210E\220\024\220Q\330\014\022\220$\220b\230\001\330\010\017\210~\230T\240\023\240G\2501";
static const char __pyx_k_A_t2V5_as_e7_A[] = "\200A\330\010\017\210t\2202\220V\2305\240\001\240\021\240$\240a\240s\250$\250e\2607\270\"\270A";
static const char __pyx_k_All_text_files[] = "All text files";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_CHolonomyGroup[] = "CHolonomyGroup";
static const char __pyx_k_Census_Morwen8[] = "Census_Morwen8";
static const char __pyx_k_ChristyLinks_s[] = "ChristyLinks/%s";
static const char __pyx_k_HoroballViewer[] = "HoroballViewer";
static const char __pyx_k_LengthSpectrum[] = "LengthSpectrum";
static const char __pyx_k_ListOnePerLine[] = "ListOnePerLine";
static const char __pyx_k_Manifold_cover[] = "Manifold.cover";
static const char __pyx_k_Manifold_drill[] = "Manifold.drill";
static const char __pyx_k_Manifold_split[] = "Manifold.split";
static const char __pyx_k_Non_orientable[] = "Non-orientable";
static const char __pyx_k_NotImplemented[] = "NotImplemented";
static const char __pyx_k_O31_generators[] = "O31_generators";
static const char __pyx_k_ObsCensusKnots[] = "ObsCensusKnots";
static const char __pyx_k_ObsMorwenLinks[] = "ObsMorwenLinks";
static const char __pyx_k_Q_7_fBc_AQ_a_1[] = "\200\001\360\010\000\005\016\210Q\330\004\010\210\n\220!\330\010\013\2107\220$\220f\230B\230c\240\023\240A\240Q\330\014\022\220$\220a\340\014\022\220'\230\021\230!\330\004\013\2101";
static const char __pyx_k_Send_to_SnapPy[] = "Send to SnapPy";
static const char __pyx_k_a_1_4_q_AQ_0_1[] = "\320\004>\270a\360\006\000\t1\260\001\330\010\013\2104\320\017 \240\007\240q\330\014\022\220*\230A\230Q\330\010\032\320\0320\260\001\260\021\330\010\014\320\014 \240\001\240\021\330\010\013\2101\330\014\020\320\020(\250\001";
static const char __pyx_k_abelianization[] = "abelianization";
static const char __pyx_k_alternating_gz[] = "alternating.gz";
static const char __pyx_k_complex_length[] = "complex_length";
static const char __pyx_k_complex_volume[] = "complex_volume";
static const char __pyx_k_compute_volume[] = "compute_volume";
static const char __pyx_k_covers_snappea[] = "_covers_snappea";
static const char __pyx_k_explain_rows_2[] = ",\n  explain_rows = ";
static const char __pyx_k_fill_cusp_spec[] = "fill_cusp_spec";
static const char __pyx_k_func_bad_input[] = "func_bad_input";
static const char __pyx_k_func_cancelled[] = "func_cancelled";
static const char __pyx_k_gap_image_gens[] = "gap_image_gens";
static const char __pyx_k_generator_file[] = "generator_file";
static const char __pyx_k_generator_path[] = "generator_path";
static const char __pyx_k_get_HT_knot_DT[] = "get_HT_knot_DT";
static const char __pyx_k_high_precision[] = "high_precision";
static const char __pyx_k_ideal_vertices[] = " ideal vertices; ";
static const char __pyx_k_isosig_pattern[] = "isosig_pattern";
static const char __pyx_k_link_directory[] = "link_directory";
static const char __pyx_k_manifold_class[] = "_manifold_class";
static const char __pyx_k_manifold_paths[] = "manifold_paths";
static const char __pyx_k_multiplicities[] = "multiplicities";
static const char __pyx_k_non_peripheral[] = "non_peripheral";
static const char __pyx_k_num_components[] = "num_components";
static const char __pyx_k_num_fake_cusps[] = "_num_fake_cusps";
static const char __pyx_k_num_generators[] = "num_generators";
static const char __pyx_k_num_tetrahedra[] = "num_tetrahedra";
static const char __pyx_k_original_index[] = "original_index";
static const char __pyx_k_plink_callback[] = "plink_callback";
static const char __pyx_k_shape_accuracy[] = "shape_accuracy";
static const char __pyx_k_short_relators[] = "short_relators";
static const char __pyx_k_symmetry_group[] = "symmetry_group";
static const char __pyx_k_vertex_epsilon[] = "vertex_epsilon";
static const char __pyx_k_vertex_indices[] = "vertex_indices";
static const char __pyx_k_which_solution[] = "which_solution";
static const char __pyx_k_1_4_q_AQ_aq_8_1[] = "\320\004:\270!\360\036\000\t1\260\001\330\010\013\2104\320\017 \240\007\240q\330\014\022\220*\230A\230Q\330\010\023\220;\230a\230q\330\010\032\320\0328\270\001\270\021\330\010\014\320\014 \240\001\240\021\330\010\013\2101\330\014\020\320\020(\250\001";
static const char __pyx_k_A_1_a_Qd_A_1A_q[] = "\200A\360\032\000\t\033\320\0321\260\021\260$\260a\330\010\030\230\r\240Q\240d\250.\270\004\270A\330\010\025\320\025+\2501\250A\330\010\017\210q";
static const char __pyx_k_A_4wgQa_q_4wgQa[] = "\200A\360\036\000\t\n\330\014\023\2204\220w\230g\240Q\240a\330\017\020\330\014\020\220\017\230q\330\014\023\2204\220w\230g\240Q\240a";
static const char __pyx_k_A_D_AQ_1_6LA_1A[] = "\320\004$\240A\360\010\000\t\r\210D\220\014\230A\230Q\330\010\023\320\0231\260\021\260$\3206L\310A\330\010\017\210|\2301\230A";
static const char __pyx_k_A_Jaq_4_1_1_6_A[] = "\200A\360\016\000\t\021\220\004\220J\230a\230q\330\010\013\2104\320\017 \240\003\2401\330\014\023\2201\330\010\017\320\017*\250!\2506\260\037\300\004\300A";
static const char __pyx_k_CensusKnots_tgz[] = "CensusKnots.tgz";
static const char __pyx_k_CuspInfo___repr[] = "CuspInfo.__repr__";
static const char __pyx_k_DirichletDomain[] = "DirichletDomain";
static const char __pyx_k_Extends_to_link[] = "Extends to link";
static const char __pyx_k_HTLinkExteriors[] = "HTLinkExteriors";
static const char __pyx_k_Info__immutable[] = "Info._immutable";
static const char __pyx_k_Isometry___init[] = "Isometry.__init__";
static const char __pyx_k_Isometry___repr[] = "Isometry.__repr__";
static const char __pyx_k_Link_Projection[] = "% Link Projection";
static const char __pyx_k_Manifold_browse[] = "Manifold.browse";
static const char __pyx_k_Manifold_covers[] = "Manifold.covers";
static const char __pyx_k_Manifold_volume[] = "Manifold.volume";
static const char __pyx_k_Not_within_Sage[] = "Not within Sage";
static const char __pyx_k_Num_Alternating[] = "Num_Alternating";
static const char __pyx_k_Triangulation_2[] = "Triangulation";
static const char __pyx_k_Xforward_strand[] = "Xforward_strand";
static const char __pyx_k_Yforward_strand[] = "Yforward_strand";
static const char __pyx_k_aH_T_q_1_D_r_4y[] = "\320\004&\240a\360H\001\000\t\016\210T\220\036\230q\330\010\013\2101\330\014\024\220D\230\t\240\021\240%\240r\250\021\340\014\023\2204\220y\240\001\240\021";
static const char __pyx_k_ascii_lowercase[] = "ascii_lowercase";
static const char __pyx_k_blowup_multiple[] = "blowup_multiple";
static const char __pyx_k_c_comm_subgroup[] = "c_comm_subgroup";
static const char __pyx_k_c_triangulation[] = "c_triangulation";
static const char __pyx_k_complete_length[] = "complete_length";
static const char __pyx_k_complete_shapes[] = "complete_shapes";
static const char __pyx_k_compute_corners[] = "compute_corners";
static const char __pyx_k_current_modulus[] = "current_modulus";
static const char __pyx_k_curve_of_length[] = " curve of length ";
static const char __pyx_k_explain_columns[] = "explain_columns";
static const char __pyx_k_extends_to_link[] = "extends_to_link";
static const char __pyx_k_extract_HT_knot[] = "extract_HT_knot";
static const char __pyx_k_filled_length_2[] = "filled length";
static const char __pyx_k_finite_vertices[] = " finite vertices, ";
static const char __pyx_k_fixed_alignment[] = "fixed_alignment";
static const char __pyx_k_force_recompute[] = "force_recompute";
static const char __pyx_k_generator_bytes[] = "generator_bytes";
static const char __pyx_k_initial_modulus[] = "initial_modulus";
static const char __pyx_k_is_MagmaElement[] = "is_MagmaElement";
static const char __pyx_k_is_amphicheiral[] = "is_amphicheiral";
static const char __pyx_k_is_binary_group[] = "is_binary_group";
static const char __pyx_k_is_isometric_to[] = "_is_isometric_to";
static const char __pyx_k_is_torus_bundle[] = "is_torus_bundle";
static const char __pyx_k_isomorphisms_to[] = "_isomorphisms_to";
static const char __pyx_k_left_pad_string[] = "left_pad_string";
static const char __pyx_k_length_spectrum[] = "length_spectrum";
static const char __pyx_k_manifoldMethods[] = "manifoldMethods";
static const char __pyx_k_mark_solid_tori[] = "mark_solid_tori";
static const char __pyx_k_num_nonor_cusps[] = "num_nonor_cusps";
static const char __pyx_k_one_tet_lengths[] = "one_tet_lengths";
static const char __pyx_k_passes_at_fours[] = "passes_at_fours";
static const char __pyx_k_peripheral_data[] = "peripheral_data";
static const char __pyx_k_permutation_rep[] = "permutation_rep";
static const char __pyx_k_ptolemy_variety[] = "ptolemy_variety";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_return_matrices[] = "return_matrices";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_shape_precision[] = "shape precision";
static const char __pyx_k_snappy_Manifold[] = "'snappy.Manifold'";
static const char __pyx_k_symplectic_form[] = "_symplectic_form";
static const char __pyx_k_table_directory[] = "table_directory";
static const char __pyx_k_tetrahedra_data[] = "tetrahedra_data";
static const char __pyx_k_top_level_tries[] = "top_level_tries";
static const char __pyx_k_vertex_to_index[] = "vertex_to_index";
static const char __pyx_k_where_to_resume[] = "where_to_resume";
static const char __pyx_k_1_D_Zq_nA_q_A_G6[] = "\320\0041\260\031\270!\360D\001\000\t\026\220Z\230q\240\006\240n\260A\330\010\027\220q\230\004\230A\330\010\014\210G\2206\230\021\230(\240!";
static const char __pyx_k_CDirichletDomain[] = "CDirichletDomain";
static const char __pyx_k_Census___getitem[] = "Census.__getitem__";
static const char __pyx_k_ChristyLinks_tgz[] = "ChristyLinks.tgz";
static const char __pyx_k_ClosedCensusData[] = "ClosedCensusData";
static const char __pyx_k_CuspNeighborhood[] = "CuspNeighborhood";
static const char __pyx_k_FundamentalGroup[] = "FundamentalGroup";
static const char __pyx_k_Manifold__number[] = "Manifold._number_";
static const char __pyx_k_N_has_to_be_2_15[] = "N has to be 2...15";
static const char __pyx_k_ObsLinkExteriors[] = "ObsLinkExteriors";
static const char __pyx_k_PermutationGroup[] = "PermutationGroup";
static const char __pyx_k_PolyhedronViewer[] = "PolyhedronViewer";
static const char __pyx_k_SageNotAvailable[] = "SageNotAvailable";
static const char __pyx_k_ShapeInfo___repr[] = "ShapeInfo.__repr__";
static const char __pyx_k_Splitting_S__d_d[] = "Splitting\\(S_\\{(\\d+),(\\d+)\\},";
static const char __pyx_k_Xbackward_strand[] = "Xbackward_strand";
static const char __pyx_k_Ybackward_strand[] = "Ybackward_strand";
static const char __pyx_k_c_abelianization[] = "c_abelianization";
static const char __pyx_k_c_representation[] = "c_representation";
static const char __pyx_k_certified_shapes[] = "certified_shapes";
static const char __pyx_k_coefficient_list[] = "coefficient_list";
static const char __pyx_k_complex_volume_2[] = "_complex_volume";
static const char __pyx_k_covers_low_index[] = "_covers_low_index";
static const char __pyx_k_decorated_isosig[] = "decorated_isosig";
static const char __pyx_k_defaultextension[] = "defaultextension";
static const char __pyx_k_dirichlet_domain[] = "dirichlet_domain";
static const char __pyx_k_get_displacement[] = "get_displacement";
static const char __pyx_k_gluing_equations[] = "gluing_equations";
static const char __pyx_k_letter_seperator[] = "_letter_seperator";
static const char __pyx_k_manifold_class_2[] = "manifold_class";
static const char __pyx_k_new_displacement[] = "new_displacement";
static const char __pyx_k_num_subdivisions[] = "num_subdivisions";
static const char __pyx_k_oQ_A_1_Q_at_1_at[] = "\320\004&\240o\260Q\360\030\000\t\026\220[\240\001\330\014\030\230\004\230A\330\014\r\340\010\013\2101\330\014\023\320\023%\240Q\330\017\036\230a\230t\320#:\270!\340\014\023\320\023#\2401\330\017\036\230a\230t\320#:\270!\330\017\023\220?\240!\330\036\037";
static const char __pyx_k_octahedral_group[] = "octahedral group";
static const char __pyx_k_pairing_matrices[] = "pairing_matrices";
static const char __pyx_k_permutation_reps[] = "permutation_reps";
static const char __pyx_k_plink_callback_2[] = "_plink_callback";
static const char __pyx_k_q_E_at86_1_a_1_a[] = "\320\004\027\220q\340\010\t\360\020\000\t\n\330\014\r\360\010\000\037 \330\036$\240E\250\021\250$\250a\250t\2608\2706\300\021\300!\330\0361\260\021\260$\260a\330\0361\260\021\260$\260a";
static const char __pyx_k_q_r_HD_t87_4q_IT[] = "\320\004\027\220q\330\010\022\220%\220r\230\021\330\010\014\210H\220D\230\007\230t\2408\2507\260(\270!\2704\270q\330\010\014\210I\220T\230\021";
static const char __pyx_k_reduce_list_word[] = "reduce_list_word";
static const char __pyx_k_set_displacement[] = "set_displacement";
static const char __pyx_k_symplectic_basis[] = "symplectic_basis";
static const char __pyx_k_tip_vertex_index[] = "tip_vertex_index";
static const char __pyx_k_vertex_data_list[] = "_vertex_data_list";
static const char __pyx_k_1_4_1_AT1CCTTU_G6[] = "\320\004(\320(;\2701\360\022\000\t\014\2104\320\017 \240\003\2401\330\014\r\330\010,\250A\250T\3201C\320CT\320TU\330\010\014\210G\2206\230\021\230(\240!";
static const char __pyx_k_A_1_q_2_D_b_A_l_1[] = "\200A\330\010\013\2101\330\014\023\220<\230q\320 2\260*\270D\300\n\310!\330 &\240b\320(@\300\004\300A\330\010\016\210l\230!\2301";
static const char __pyx_k_A_4_1_AQ_q_A_AQ_6[] = "\200A\360\030\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\014\r\330\020\033\320\033/\250q\260\004\260A\330\020\031\230\021\340\020\024\220A\220Q\330\014\023\2206\230\021\230!";
static const char __pyx_k_A_Qc_4z_81D_q_N_Q[] = "\200A\330\010\013\210:\220Q\220c\230\021\330\014\023\2204\220z\240\021\240!\2408\2501\250D\260\001\340\014\023\320\023'\240q\250\004\250N\270#\270Q";
static const char __pyx_k_AbelianGroup_rank[] = "AbelianGroup.rank";
static const char __pyx_k_Alternating_table[] = "Alternating_table";
static const char __pyx_k_CCuspNeighborhood[] = "CCuspNeighborhood";
static const char __pyx_k_CFundamentalGroup[] = "CFundamentalGroup";
static const char __pyx_k_Census___contains[] = "Census.__contains__";
static const char __pyx_k_Cusp_neighborhood[] = "Cusp neighborhood";
static const char __pyx_k_FactorCosetAction[] = "FactorCosetAction";
static const char __pyx_k_GeneratorsOfGroup[] = "GeneratorsOfGroup";
static const char __pyx_k_IsSubgroupFpGroup[] = "IsSubgroupFpGroup";
static const char __pyx_k_Klein_bottle_cusp[] = "Klein bottle cusp";
static const char __pyx_k_LowIndexSubgroups[] = "LowIndexSubgroups";
static const char __pyx_k_Manifold_canonize[] = "Manifold.canonize";
static const char __pyx_k_NormalSurfaceInfo[] = "NormalSurfaceInfo";
static const char __pyx_k_ShortMatrixParity[] = "ShortMatrixParity";
static const char __pyx_k_SnapPeaFatalError[] = "SnapPeaFatalError";
static const char __pyx_k_SnapPea_interrupt[] = "SnapPea_interrupt";
static const char __pyx_k_The_manifold_file[] = "The manifold file ";
static const char __pyx_k_Xforward_neighbor[] = "Xforward_neighbor";
static const char __pyx_k_Yforward_neighbor[] = "Yforward_neighbor";
static const char __pyx_k_a_A_1_Q_q_1_1_q_1[] = "\320\004'\240\177\260a\360\032\000\t\026\220[\240\001\330\014\030\230\004\230A\330\014\r\340\010\013\2101\330\014\023\320\023%\240Q\330\017\037\230q\240\004\320$;\2701\340\014\023\320\023#\2401\330\017\037\230q\240\004\320$;\2701\330\017\023\220?\240!\330\036\037";
static const char __pyx_k_character_variety[] = "character_variety";
static const char __pyx_k_choose_generators[] = "_choose_generators";
static const char __pyx_k_closed_orientable[] = "closed_orientable";
static const char __pyx_k_complete_length_2[] = "complete length";
static const char __pyx_k_cusp_neighborhood[] = "cusp_neighborhood";
static const char __pyx_k_default_precision[] = "_default_precision";
static const char __pyx_k_edge_orientations[] = "edge_orientations";
static const char __pyx_k_explain_columns_2[] = ",\n  explain_columns = ";
static const char __pyx_k_extends_to_link_2[] = "_extends_to_link";
static const char __pyx_k_format_two_by_two[] = "format_two_by_two";
static const char __pyx_k_fundamental_group[] = "fundamental_group";
static const char __pyx_k_holonomy_accuracy[] = "holonomy_accuracy";
static const char __pyx_k_icosohedral_group[] = "icosohedral group";
static const char __pyx_k_inverse_list_word[] = "inverse_list_word";
static const char __pyx_k_is_direct_product[] = "is_direct_product";
static const char __pyx_k_is_isometric_to_2[] = "is_isometric_to";
static const char __pyx_k_is_not_acceptable[] = ")) is not acceptable.";
static const char __pyx_k_is_twister_bundle[] = "is_twister_bundle";
static const char __pyx_k_isomorphisms_to_2[] = "isomorphisms_to";
static const char __pyx_k_marked_tetrahedra[] = "_marked_tetrahedra";
static const char __pyx_k_meridian_accuracy[] = "meridian_accuracy";
static const char __pyx_k_multiply_elements[] = "multiply_elements";
static const char __pyx_k_no_solution_found[] = "no solution found";
static const char __pyx_k_nonalternating_gz[] = "nonalternating.gz";
static const char __pyx_k_obstruction_class[] = "obstruction_class";
static const char __pyx_k_orientation_cover[] = "orientation_cover";
static const char __pyx_k_peripheral_curves[] = "peripheral_curves";
static const char __pyx_k_return_isometries[] = "return_isometries";
static const char __pyx_k_show_uAcknowledge[] = "show_uAcknowledge";
static const char __pyx_k_simplified_matrix[] = "simplified_matrix";
static const char __pyx_k_singularity_index[] = "singularity_index";
static const char __pyx_k_tail_vertex_index[] = "tail_vertex_index";
static const char __pyx_k_tetrahedra_shapes[] = "tetrahedra_shapes";
static const char __pyx_k_tetrahedral_group[] = "tetrahedral group";
static const char __pyx_k_4t1_4_1_T_4q_q_A_0[] = "\320\004:\270!\330\010\013\2104\210t\2201\330\014\r\330\010\013\2104\320\0171\260\024\260T\270\021\330\014\r\330\010*\250!\2504\250q\330\010\027\220q\230\004\230A\330\010\014\320\0140\260\001";
static const char __pyx_k_A_4_1_q_A_8_at1_1D[] = "\200A\360\034\000\t\014\2104\320\017 \240\003\2401\330\014\027\220q\230\004\230A\330\014\017\320\017!\240\021\240$\320&8\270\002\270!\330\020&\240a\240t\2501\330\020\033\2301\230D\240\001";
static const char __pyx_k_A_s_iq_1_j_A_U_q_A[] = "\320\004,\250A\360\020\000\t\020\210s\220$\220i\230q\240\003\2401\330\022\026\220j\240\001\240\023\240A\330\021\025\220U\230%\230q\240\004\240A";
static const char __pyx_k_AbelianGroup_order[] = "AbelianGroup.order";
static const char __pyx_k_CHolonomyGroup_O31[] = "CHolonomyGroup.O31";
static const char __pyx_k_Isometry_cusp_maps[] = "Isometry.cusp_maps";
static const char __pyx_k_Isometry_num_cusps[] = "Isometry.num_cusps";
static const char __pyx_k_LengthSpectrumInfo[] = "LengthSpectrumInfo";
static const char __pyx_k_Manifold__identify[] = "Manifold._identify";
static const char __pyx_k_Manifold_cusp_info[] = "Manifold.cusp_info";
static const char __pyx_k_Manifold_dehn_fill[] = "Manifold.dehn_fill";
static const char __pyx_k_MorwenLinks___init[] = "MorwenLinks.__init__";
static const char __pyx_k_Num_Nonalternating[] = "Num_Nonalternating";
static const char __pyx_k_Orientable_lengths[] = "Orientable_lengths";
static const char __pyx_k_PresentationMatrix[] = "PresentationMatrix";
static const char __pyx_k_Q_4uD_JavZq_XQa_Kq[] = "\320\004%\240Q\330\010\013\2104\210u\220D\230\004\230J\240a\240v\250Z\260q\330\014\023\220:\230X\240Q\240a\330\010\014\210K\220q";
static const char __pyx_k_Save_Triangulation[] = "Save Triangulation";
static const char __pyx_k_SnapPea_only_found[] = "SnapPea only found ";
static const char __pyx_k_Solution_type_is_s[] = "Solution type is: %s";
static const char __pyx_k_T_4_1_AQ_0_Q_1_1_q[] = "\320\004!\240\021\360T\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\030\320\0300\260\001\260\024\260Q\330\010\013\2101\330\014\023\2201\340\014\023\220<\230q\240\001";
static const char __pyx_k_Triangulation_copy[] = "Triangulation.copy";
static const char __pyx_k_Triangulation_link[] = "Triangulation.link";
static const char __pyx_k_Triangulation_name[] = "Triangulation.name";
static const char __pyx_k_Triangulation_save[] = "Triangulation.save";
static const char __pyx_k_Xbackward_neighbor[] = "Xbackward_neighbor";
static const char __pyx_k_Ybackward_neighbor[] = "Ybackward_neighbor";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_bundle_from_string[] = "bundle_from_string";
static const char __pyx_k_bytearray_to_bytes[] = "bytearray_to_bytes";
static const char __pyx_k_centroid_at_origin[] = "centroid_at_origin";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_edge_image_indices[] = "edge_image_indices";
static const char __pyx_k_edge_to_index_dict[] = "_edge_to_index_dict";
static const char __pyx_k_filled_shape_array[] = "filled_shape_array";
static const char __pyx_k_get_from_link_data[] = "_get_from_link_data";
static const char __pyx_k_holonomy_precision[] = "holonomy precision";
static const char __pyx_k_ignore_orientation[] = "ignore_orientation";
static const char __pyx_k_is_int_DT_exterior[] = "is_int_DT_exterior";
static const char __pyx_k_is_invertible_knot[] = "is_invertible_knot";
static const char __pyx_k_layered_and_marked[] = "layered_and_marked";
static const char __pyx_k_longitude_accuracy[] = "longitude_accuracy";
static const char __pyx_k_num_ideal_vertices[] = "num_ideal_vertices";
static const char __pyx_k_one_vertex_lengths[] = "one_vertex_lengths";
static const char __pyx_k_q_Q_7q_A_A_1_A_1_q[] = "\320\004\037\230q\360\020\000\t\031\230\r\240Q\320&7\260q\270\004\270A\330\010\013\210>\230\023\230A\330\014\023\2201\330\010\013\210>\230\023\230A\330\014\023\2201\330\010\017\210q";
static const char __pyx_k_sage_rings_integer[] = "sage.rings.integer";
static const char __pyx_k_set_real_precision[] = "set_real_precision";
static const char __pyx_k_shortest_meridians[] = "shortest_meridians";
static const char __pyx_k_split_filling_info[] = "split_filling_info";
static const char __pyx_k_splitting_surfaces[] = "splitting_surfaces";
static const char __pyx_k_symmetries_of_link[] = "symmetries_of_link";
static const char __pyx_k_triangulation_help[] = "triangulation_help";
static const char __pyx_k_A_4_1_AQ_Qd_5Q_1_1A[] = "\200A\360\"\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\035\230Q\230d\240!\340\0105\260Q\330\014\020\320\020\"\240!\2401\340\010\017\320\017;\2701\270A";
static const char __pyx_k_A_4q_xs_XT_D_XT_A_A[] = "\200A\330\010\013\2104\210q\330\014\017\210x\220s\230!\330\020\030\230\001\330\031\035\230X\240T\250\033\260D\270\001\340\020\030\230\001\330\031\035\230X\240T\250\021\340\014\024\220A\330\025\031\230\030\240\024\240[\260\004\260A";
static const char __pyx_k_A_FjPQ_4_1_AQ_0_a_6[] = "\200A\330?F\300j\320PQ\330\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\360\006\000\t\n\330\014\027\320\0270\260\001\330\020\024\320\024&\240a\330\014\023\2206\230\021\230!\340\014\020\220\001\220\021";
static const char __pyx_k_A_S_Q_s_1D_s_at1_AQ[] = "\320\004\"\240*\250A\360\022\000\t\014\210:\220S\230\001\330\014\023\220=\240\001\240\024\240Q\330\r\027\220s\230!\330\014\023\320\023#\2401\240D\250\001\330\r\027\220s\230!\330\014\023\320\023&\240a\240t\2501\340\014\022\220*\230A\230Q";
static const char __pyx_k_Alternating_numbers[] = "Alternating_numbers";
static const char __pyx_k_Alternating_offsets[] = "Alternating_offsets";
static const char __pyx_k_Bundle_S__1_1_a0_B1[] = "Bundle(S_{1,1}, [a0, B1])";
static const char __pyx_k_CHolonomyGroup_SL2C[] = "CHolonomyGroup.SL2C";
static const char __pyx_k_CuspedCensus___init[] = "CuspedCensus.__init__";
static const char __pyx_k_CuspedCensus_lookup[] = "CuspedCensus.lookup";
static const char __pyx_k_Dirichlet_Domain_of[] = "Dirichlet Domain of ";
static const char __pyx_k_Empty_Triangulation[] = "Empty Triangulation";
static const char __pyx_k_FormatHomForSnapPea[] = "FormatHomForSnapPea";
static const char __pyx_k_Manifold__precision[] = "Manifold._precision";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_SymmetryGroup_is_S5[] = "SymmetryGroup.is_S5";
static const char __pyx_k_SymmetryGroup_order[] = "SymmetryGroup.order";
static const char __pyx_k_The_peripheral_data[] = "The peripheral data ((";
static const char __pyx_k_Triangulation_cover[] = "Triangulation.cover";
static const char __pyx_k_Triangulation_plink[] = "Triangulation.plink";
static const char __pyx_k_Wrong_equation_type[] = "Wrong equation_type";
static const char __pyx_k_a_IX_G1_E_6_q_7_1_q[] = "\320\004(\250\001\330\010\016\210a\330\010\014\210I\220X\230_\250G\2601\330\014\024\220E\230\031\240!\2406\250\021\330\014\017\210q\330\020\023\2207\230!\2301\330\010\017\210q";
static const char __pyx_k_abcABC__d_abcABC__d[] = "\\[*([abcABC_\\d!*]*|[abcABC_\\d!,]*)\\]*";
static const char __pyx_k_abelian_description[] = "abelian_description";
static const char __pyx_k_c_obstruction_class[] = "c_obstruction_class";
static const char __pyx_k_census_knot_archive[] = "census_knot_archive";
static const char __pyx_k_census_knot_numbers[] = "census_knot_numbers";
static const char __pyx_k_commutator_subgroup[] = "commutator_subgroup";
static const char __pyx_k_compute_cusp_shapes[] = "compute_cusp_shapes";
static const char __pyx_k_elementary_divisors[] = "elementary_divisors";
static const char __pyx_k_five_tet_orientable[] = "five_tet_orientable";
static const char __pyx_k_format_explain_list[] = "format_explain_list";
static const char __pyx_k_get_ptolemy_variety[] = "get_ptolemy_variety";
static const char __pyx_k_has_finite_vertices[] = "has_finite_vertices";
static const char __pyx_k_is_braid_complement[] = "is_braid_complement";
static const char __pyx_k_is_decorated_isosig[] = "is_decorated_isosig";
static const char __pyx_k_is_link_complement1[] = "is_link_complement1";
static const char __pyx_k_is_link_complement2[] = "is_link_complement2";
static const char __pyx_k_is_link_complement3[] = "is_link_complement3";
static const char __pyx_k_num_finite_vertices[] = "num_finite_vertices";
static const char __pyx_k_original_generators[] = "original_generators";
static const char __pyx_k_presentation_matrix[] = "_presentation_matrix";
static const char __pyx_k_q_D_AQ_axq_1_a_t9AQ[] = "\320\004\037\230q\360\014\000\t\r\210D\220\014\230A\230Q\330\010\020\220\006\220a\220x\230q\320 ;\2701\330\014\020\320\020&\240a\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_result_cusp_indices[] = "result_cusp_indices";
static const char __pyx_k_reverse_orientation[] = "reverse_orientation";
static const char __pyx_k_rolfsen_link_regexs[] = "rolfsen_link_regexs";
static const char __pyx_k_sage_interfaces_abc[] = "sage.interfaces.abc";
static const char __pyx_k_sage_interfaces_gap[] = "sage.interfaces.gap";
static const char __pyx_k_set_target_holonomy[] = "set_target_holonomy";
static const char __pyx_k_shortest_longitudes[] = "shortest_longitudes";
static const char __pyx_k_triangulation_class[] = "_triangulation_class";
static const char __pyx_k_typing_Optional_str[] = "typing.Optional[str]";
static const char __pyx_k_81_iq_a_gU_2U_q_GWWX[] = "\320\004 \240\003\2408\2501\330\010\016\210i\220q\230\006\230a\330\010\014\320\014\036\230g\240U\250!\2502\250U\260%\260q\270\017\320GW\320WX";
static const char __pyx_k_A_3e1D_4r_Q_E_iq_WBa[] = "\200A\360\010\000\t\021\220\t\230\022\2303\230e\2401\240D\250\013\2604\260r\270\024\270Q\330\020\024\220E\230\021\230$\230i\240q\250\r\260W\270B\270a";
static const char __pyx_k_A_4t_AQ_Qd_at_Q_AQ_1[] = "\200A\360\022\000\t\014\2104\210t\220>\240\021\330\014\022\220*\230A\230Q\360\n\000\t\034\320\033-\250Q\250d\260!\330\010\031\230\035\240a\240t\250>\270\024\270Q\330\010\026\320\026,\250A\250Q\330\010\017\210~\320\0351\260\021";
static const char __pyx_k_A_4t_AQ_Qd_at_Q_AQ_v[] = "\200A\360\022\000\t\014\2104\210t\220>\240\021\330\014\022\220*\230A\230Q\360\n\000\t\024\220:\230Q\230d\240!\330\010\021\220\035\230a\230t\240>\260\024\260Q\330\010\016\320\016$\240A\240Q\330\010\017\210v\320\025)\250\021";
static const char __pyx_k_A_4wc_Q_IT_a_t1D_at1[] = "\200A\330\010\013\2104\210w\220c\230\024\230Q\330\014\022\220!\330\010\014\210I\220T\230\027\240\002\240$\240a\330\010\017\210t\2201\220D\230\006\230a\230t\2401";
static const char __pyx_k_A_D_AQ_vQha_A_a_t9AQ[] = "\320\004,\250A\360\024\000\t\r\210D\220\014\230A\230Q\330\010\017\210v\220Q\220h\230a\320\037A\300\021\330\014\020\320\020&\240a\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_DualCurveInfo___repr[] = "DualCurveInfo.__repr__";
static const char __pyx_k_Isometry_cusp_images[] = "Isometry.cusp_images";
static const char __pyx_k_KnotExteriors___init[] = "KnotExteriors.__init__";
static const char __pyx_k_L13n9331_3_4_2_3_2_1[] = "L13n9331(3,4)(2,3)(2,1)";
static const char __pyx_k_Manifold__from_bytes[] = "Manifold._from_bytes";
static const char __pyx_k_Manifold_dual_curves[] = "Manifold.dual_curves";
static const char __pyx_k_Nonalternating_table[] = "Nonalternating_table";
static const char __pyx_k_Q_4_1_AQ_S_A_Qa_q_6a[] = "\320\004\035\230Q\360 \000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\013\210:\220S\230\001\330\014\020\220\014\230A\340\014\032\230+\240Q\240a\330\014\037\230q\240\004\320$6\260a";
static const char __pyx_k_SymmetryGroup_center[] = "SymmetryGroup.center";
static const char __pyx_k_Triangulation_covers[] = "Triangulation.covers";
static const char __pyx_k_Triangulation_pickle[] = "Triangulation.pickle";
static const char __pyx_k_check_SnapPea_memory[] = "check_SnapPea_memory";
static const char __pyx_k_closed_nonorientable[] = "closed_nonorientable";
static const char __pyx_k_complete_shape_array[] = "complete_shape_array";
static const char __pyx_k_copy_c_triangulation[] = "copy_c_triangulation";
static const char __pyx_k_cover_locals_genexpr[] = "cover.<locals>.genexpr";
static const char __pyx_k_cython_core_tail_pyx[] = "cython/core/tail.pyx";
static const char __pyx_k_filled_triangulation[] = "filled_triangulation";
static const char __pyx_k_get_HT_knot_by_index[] = "get_HT_knot_by_index";
static const char __pyx_k_gluing_equations_pgl[] = "gluing_equations_pgl";
static const char __pyx_k_ignore_cusp_ordering[] = "ignore_cusp_ordering";
static const char __pyx_k_ignore_solution_type[] = "ignore_solution_type";
static const char __pyx_k_initialize_structure[] = "initialize_structure";
static const char __pyx_k_is_alpha_DT_exterior[] = "is_alpha_DT_exterior";
static const char __pyx_k_is_twister_splitting[] = "is_twister_splitting";
static const char __pyx_k_list_snappy_Manifold[] = "'list[snappy.Manifold]'";
static const char __pyx_k_python_major_version[] = "python_major_version";
static const char __pyx_k_q_D_AQ_vQha_J_a_t9AQ[] = "\320\004/\250q\360\014\000\t\r\210D\220\014\230A\230Q\330\010\017\210v\220Q\220h\230a\320\037J\310!\330\014\020\320\020&\240a\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_snappy_Triangulation[] = "'snappy.Triangulation'";
static const char __pyx_k_triangulation_isosig[] = "triangulation_isosig";
static const char __pyx_k_use_field_conversion[] = "use_field_conversion";
static const char __pyx_k_vertex_image_indices[] = "vertex_image_indices";
static const char __pyx_k_vertex_to_index_dict[] = "_vertex_to_index_dict";
static const char __pyx_k_AP_D_q_r_3_6a_U_q_1AQ[] = "\200A\360P\001\000\t\r\210D\220\017\230q\330\010\017\210r\320\021\"\240!\2403\320&6\260a\330\021\025\220U\230%\230q\240\003\2401\240A\240Q";
static const char __pyx_k_A_4_1_AQ_Qd_9_AQ_Gq_s[] = "\200A\360\030\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\035\230Q\230d\240!\340\0109\270\021\330\014\020\320\020!\240\023\240A\240Q\330\010\013\210>\230\037\320(G\300q\330\014\r\340\010\017\210s\220.\240\001";
static const char __pyx_k_A_4_31_A_O1A_Qa_4_b_q[] = "\200A\360\016\000\t\033\230!\2304\320\0373\2601\330\033\034\230A\330\010\014\210O\2301\230A\330\010\t\320\t\035\230Q\230a\330\010\t\210\031\220!\2204\220\177\240b\250\001\330\010\017\210q";
static const char __pyx_k_A_4_r_AQ_Ja_q_CuD_a_q[] = "\200A\330\010\023\2204\320\027(\250\001\330\010\021\320\021'\240r\250\023\250A\250Q\330\010\014\210J\220a\330\014\020\220\007\220q\330\020\032\230(\240\"\240C\240u\250D\260\001\330\014\026\220a\330\010\017\210q";
static const char __pyx_k_A_8_q_gS_0_9Kq_Q_V1_q[] = "\200A\360\010\000\t!\240\001\240\024\320%8\270\001\340\010\021\220\021\330\010\020\220\001\330\010\021\220\026\220q\330\010\016\210g\220S\230\001\230\024\320\0350\260\001\330\014\022\220!\2209\230K\240q\330\014\025\220Q\330\014\025\220V\2301\330\010\017\210q";
static const char __pyx_k_A_q_Yd_Ct3d_uAT_E_at1[] = "\200A\360\010\000\t\020\210q\220\001\220\024\220Y\230d\240\"\240C\240t\2503\250d\260%\260u\270A\270T\300\021\330\020\024\220E\230\025\230a\230t\2401";
static const char __pyx_k_AbelianGroup___reduce[] = "AbelianGroup.__reduce__";
static const char __pyx_k_CDirichletDomain_save[] = "CDirichletDomain.save";
static const char __pyx_k_CDirichletDomain_view[] = "CDirichletDomain.view";
static const char __pyx_k_CertifiedShapesEngine[] = "CertifiedShapesEngine";
static const char __pyx_k_HolonomyGroup__number[] = "HolonomyGroup._number_";
static const char __pyx_k_Index_is_out_of_range[] = "Index is out of range.";
static const char __pyx_k_LengthSpectrum___repr[] = "LengthSpectrum.__repr__";
static const char __pyx_k_ListOnePerLine___repr[] = "ListOnePerLine.__repr__";
static const char __pyx_k_Manifold__from_isosig[] = "Manifold._from_isosig";
static const char __pyx_k_Manifold__from_string[] = "Manifold._from_string";
static const char __pyx_k_Manifold_chern_simons[] = "Manifold.chern_simons";
static const char __pyx_k_Nonorientable_lengths[] = "Nonorientable_lengths";
static const char __pyx_k_ObsCensusKnots___init[] = "ObsCensusKnots.__init__";
static const char __pyx_k_ObsCensusKnots___repr[] = "ObsCensusKnots.__repr__";
static const char __pyx_k_ObsMorwenLinks___init[] = "ObsMorwenLinks.__init__";
static const char __pyx_k_SnapPea_KLPProjection[] = "SnapPea_KLPProjection";
static const char __pyx_k_Triangulation_DT_code[] = "Triangulation.DT_code";
static const char __pyx_k_cover_c_triangulation[] = "cover_c_triangulation";
static const char __pyx_k_cython_core_basic_pyx[] = "cython/core/basic.pyx";
static const char __pyx_k_get_tetrahedra_shapes[] = "_get_tetrahedra_shapes";
static const char __pyx_k_length_spectrum_dicts[] = "length_spectrum_dicts";
static const char __pyx_k_morwen_link_directory[] = "morwen_link_directory";
static const char __pyx_k_orientation_reversing[] = "orientation-reversing";
static const char __pyx_k_owns_c_symmetry_group[] = "owns_c_symmetry_group";
static const char __pyx_k_sage_interfaces_magma[] = "sage.interfaces.magma";
static const char __pyx_k_set_peripheral_curves[] = "set_peripheral_curves";
static const char __pyx_k_set_tetrahedra_shapes[] = "set_tetrahedra_shapes";
static const char __pyx_k_simplify_presentation[] = "simplify_presentation";
static const char __pyx_k_splitting_from_string[] = "splitting_from_string";
static const char __pyx_k_stopping_displacement[] = "stopping_displacement";
static const char __pyx_k_verify_complex_volume[] = "verify_complex_volume";
static const char __pyx_k_8_4q_4_1_g_t1_l_1_aq_q[] = "\320\0048\270\001\360:\000\t\014\2104\210q\330\014\033\2304\320\0371\260\021\260!\330\014\022\220,\230g\240\\\260\021\340\014\017\210t\2201\330\020\026\220l\240!\2401\330\014\022\220$\320\026.\250a\250q\330\010\017\210q";
static const char __pyx_k_A_6Q_4_1_4z_4_1_j_1A_q[] = "\200A\360\016\000\t6\260Q\360\006\000\t\014\2104\320\017 \240\003\2401\330\014\023\2204\220z\240\021\240!\330\010\032\230!\2304\320\0371\260\021\260!\330\010\022\220$\220j\240\001\240\021\330\010\017\320\017#\2401\240A\330\010\017\210q";
static const char __pyx_k_A_F_E_Q_uBc_Q_j_q_Qd_S[] = "\200A\360\026\000\t\021\220\004\220F\230!\330\010\014\210E\220\021\220#\220Q\330\014\017\210u\220B\220c\230\024\230Q\330\020\026\220j\240\001\240\021\330-/\250q\340\010\017\320\017%\240Q\240d\320*=\270S\300\001";
static const char __pyx_k_CCuspNeighborhood_view[] = "CCuspNeighborhood.view";
static const char __pyx_k_CFundamentalGroup_sage[] = "CFundamentalGroup.sage";
static const char __pyx_k_CHolonomyGroup__matrix[] = "CHolonomyGroup._matrix";
static const char __pyx_k_Cusp_Neighborhood_with[] = "Cusp Neighborhood with ";
static const char __pyx_k_CuspedCensus___getitem[] = "CuspedCensus.__getitem__";
static const char __pyx_k_Manifold_copy_line_308[] = "Manifold.copy (line 308)";
static const char __pyx_k_Manifold_is_two_bridge[] = "Manifold.is_two_bridge";
static const char __pyx_k_Manifold_solution_type[] = "Manifold.solution_type";
static const char __pyx_k_MatrixWithExplanations[] = "MatrixWithExplanations";
static const char __pyx_k_Nonalternating_numbers[] = "Nonalternating_numbers";
static const char __pyx_k_Nonalternating_offsets[] = "Nonalternating_offsets";
static const char __pyx_k_PLink_was_not_imported[] = "PLink was not imported.";
static const char __pyx_k_The_solution_type_is_s[] = "The solution type is: %s";
static const char __pyx_k_Triangulation___reduce[] = "Triangulation.__reduce__";
static const char __pyx_k_Triangulation_homology[] = "Triangulation.homology";
static const char __pyx_k_Triangulation_set_name[] = "Triangulation.set_name";
static const char __pyx_k_Triangulation_simplify[] = "Triangulation.simplify";
static const char __pyx_k_choose_generators_info[] = "_choose_generators_info";
static const char __pyx_k_current_shape_accuracy[] = "current_shape_accuracy";
static const char __pyx_k_expand_until_certified[] = "expand_until_certified";
static const char __pyx_k_five_tet_nonorientable[] = "five_tet_nonorientable";
static const char __pyx_k_hyperbolic_data__sa_gz[] = "hyperbolic_data_%sa.gz";
static const char __pyx_k_hyperbolic_data__sn_gz[] = "hyperbolic_data_%sn.gz";
static const char __pyx_k_index_within_crossings[] = "index_within_crossings";
static const char __pyx_k_initial_shape_accuracy[] = "initial_shape_accuracy";
static const char __pyx_k_orientation_preserving[] = "orientation-preserving";
static const char __pyx_k_polyhedral_description[] = "polyhedral_description";
static const char __pyx_k_ptolemyManifoldMethods[] = "ptolemyManifoldMethods";
static const char __pyx_k_remove_finite_vertices[] = "remove_finite_vertices";
static const char __pyx_k_sage_groups_free_group[] = "sage.groups.free_group";
static const char __pyx_k_symmetries_of_manifold[] = "symmetries_of_manifold";
static const char __pyx_k_A_4_1_AQ_Qd_AT1C1A_Gq_s[] = "\200A\360\"\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\035\230Q\230d\240!\340\010,\250A\250T\3201C\3001\300A\340\010\013\210>\230\037\320(G\300q\330\014\r\340\010\017\210s\220.\240\001";
static const char __pyx_k_CCuspNeighborhood_reach[] = "CCuspNeighborhood.reach";
static const char __pyx_k_CDirichletDomain_volume[] = "CDirichletDomain.volume";
static const char __pyx_k_Does_not_extend_to_link[] = "Does not extend to link";
static const char __pyx_k_IsCompositionMappingRep[] = "IsCompositionMappingRep";
static const char __pyx_k_KnotExteriors___getitem[] = "KnotExteriors.__getitem__";
static const char __pyx_k_Manifold_cover_line_549[] = "Manifold.cover (line 549)";
static const char __pyx_k_Manifold_symmetry_group[] = "Manifold.symmetry_group";
static const char __pyx_k_Not_a_valid_permutation[] = "Not a valid permutation";
static const char __pyx_k_ObsLinkExteriors___init[] = "ObsLinkExteriors.__init__";
static const char __pyx_k_ObsLinkExteriors___repr[] = "ObsLinkExteriors.__repr__";
static const char __pyx_k_PermutationGroupElement[] = "PermutationGroupElement";
static const char __pyx_k_Triangulation__to_bytes[] = "Triangulation._to_bytes";
static const char __pyx_k_Triangulation_cusp_info[] = "Triangulation.cusp_info";
static const char __pyx_k_Triangulation_dehn_fill[] = "Triangulation.dehn_fill";
static const char __pyx_k_Triangulation_num_cusps[] = "Triangulation.num_cusps";
static const char __pyx_k_Triangulation_randomize[] = "Triangulation.randomize";
static const char __pyx_k_character_variety_ideal[] = "character_variety_ideal";
static const char __pyx_k_closed_census_directory[] = "closed_census_directory";
static const char __pyx_k_cusp_cross_section_info[] = "_cusp_cross_section_info";
static const char __pyx_k_generators_in_originals[] = "generators_in_originals";
static const char __pyx_k_is_link_complement1_pat[] = "is_link_complement1_pat";
static const char __pyx_k_is_link_complement2_pat[] = "is_link_complement2_pat";
static const char __pyx_k_is_link_complement3_pat[] = "is_link_complement3_pat";
static const char __pyx_k_num_original_generators[] = "num_original_generators";
static const char __pyx_k_number_to_native_number[] = "number_to_native_number";
static const char __pyx_k_sage_matrix_constructor[] = "sage.matrix.constructor";
static const char __pyx_k_symmetric_triangulation[] = "symmetric_triangulation";
static const char __pyx_k_A_4q_aq_IQd_Q_q_T_d_1L_q[] = "\200A\360\010\000\t\014\2104\210q\330\014\022\220,\230a\230q\330\010\014\210I\220Q\220d\230+\240Q\330\010\017\210q\220\001\220\021\220#\220T\230\025\230d\240)\2501\250L\270\001\330\010\017\210q\220\001\220\021";
static const char __pyx_k_AlternatingKnotExteriors[] = "AlternatingKnotExteriors";
static const char __pyx_k_CCuspNeighborhood_volume[] = "CCuspNeighborhood.volume";
static const char __pyx_k_CDirichletDomain__number[] = "CDirichletDomain._number_";
static const char __pyx_k_Invalid_generator_status[] = "Invalid generator status";
static const char __pyx_k_Invalid_permutation_data[] = "Invalid permutation data.";
static const char __pyx_k_Isometry_extends_to_link[] = "Isometry.extends_to_link";
static const char __pyx_k_LowIndexSubgroupsFpGroup[] = "LowIndexSubgroupsFpGroup";
static const char __pyx_k_Manifold__complex_volume[] = "Manifold._complex_volume";
static const char __pyx_k_Manifold_browse_line_386[] = "Manifold.browse (line 386)";
static const char __pyx_k_Manifold_covers_line_618[] = "Manifold.covers (line 618)";
static const char __pyx_k_Manifold_drill_line_1505[] = "Manifold.drill (line 1505)";
static const char __pyx_k_Manifold_is_isometric_to[] = "Manifold.is_isometric_to";
static const char __pyx_k_Manifold_length_spectrum[] = "Manifold.length_spectrum";
static const char __pyx_k_Manifold_split_line_1768[] = "Manifold.split (line 1768)";
static const char __pyx_k_Manifold_volume_line_728[] = "Manifold.volume (line 728)";
static const char __pyx_k_No_associated_link_known[] = "No associated link known.";
static const char __pyx_k_NormalSurfaceInfo___repr[] = "NormalSurfaceInfo.__repr__";
static const char __pyx_k_ObsCensusKnots___getitem[] = "ObsCensusKnots.__getitem__";
static const char __pyx_k_ObsMorwenLinks___getitem[] = "ObsMorwenLinks.__getitem__";
static const char __pyx_k_SymmetryGroup_is_abelian[] = "SymmetryGroup.is_abelian";
static const char __pyx_k_SymmetryGroup_isometries[] = "SymmetryGroup.isometries";
static const char __pyx_k_Triangulation__to_string[] = "Triangulation._to_string";
static const char __pyx_k_Triangulation_cover_info[] = "Triangulation.cover_info";
static const char __pyx_k_contains_flat_tetrahedra[] = "contains flat tetrahedra";
static const char __pyx_k_cython_core_manifold_pyx[] = "cython/core/manifold.pyx";
static const char __pyx_k_eliminate_fixed_ptolemys[] = "eliminate_fixed_ptolemys";
static const char __pyx_k_face_list_locals_genexpr[] = "face_list.<locals>.genexpr";
static const char __pyx_k_get_triangulation_tester[] = "get_triangulation_tester";
static const char __pyx_k_remove_finite_vertices_2[] = "_remove_finite_vertices";
static const char __pyx_k_to_string_locals_genexpr[] = "_to_string.<locals>.genexpr";
static const char __pyx_k_A_4_1_AQ_Qd_AT1C1A_Gq_s_2[] = "\200A\360\022\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\035\230Q\230d\240!\340\010,\250A\250T\3201C\3001\300A\340\010\013\210>\230\037\320(G\300q\330\014\r\340\010\017\210s\220.\240\001";
static const char __pyx_k_A_4_1_AQ_Qd_AT1C1A_Gq_s_3[] = "\200A\360\026\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\035\230Q\230d\240!\340\010,\250A\250T\3201C\3001\300A\340\010\013\210>\230\037\320(G\300q\330\014\r\340\010\017\210s\220.\240\001";
static const char __pyx_k_AbelianGroup_betti_number[] = "AbelianGroup.betti_number";
static const char __pyx_k_CCuspNeighborhood__number[] = "CCuspNeighborhood._number_";
static const char __pyx_k_CCuspNeighborhood_get_tie[] = "CCuspNeighborhood.get_tie";
static const char __pyx_k_CCuspNeighborhood_set_tie[] = "CCuspNeighborhood.set_tie";
static const char __pyx_k_CCuspNeighborhood_stopper[] = "CCuspNeighborhood.stopper";
static const char __pyx_k_CDirichletDomain_manifold[] = "CDirichletDomain.manifold";
static const char __pyx_k_LengthSpectrumInfo___repr[] = "LengthSpectrumInfo.__repr__";
static const char __pyx_k_Manifold__is_isometric_to[] = "Manifold._is_isometric_to";
static const char __pyx_k_Manifold_dirichlet_domain[] = "Manifold.dirichlet_domain";
static const char __pyx_k_ObsOrientableClosedCensus[] = "ObsOrientableClosedCensus";
static const char __pyx_k_ObsOrientableCuspedCensus[] = "ObsOrientableCuspedCensus";
static const char __pyx_k_PresentationMatrix_row_op[] = "PresentationMatrix.row_op";
static const char __pyx_k_SymmetryGroup_is_dihedral[] = "SymmetryGroup.is_dihedral";
static const char __pyx_k_The_braid_word_is_invalid[] = "The braid word is invalid.";
static const char __pyx_k_Triangulation__covers_gap[] = "Triangulation._covers_gap";
static const char __pyx_k_Triangulation__empty_save[] = "Triangulation._empty_save";
static const char __pyx_k_Triangulation__from_bytes[] = "Triangulation._from_bytes";
static const char __pyx_k_Triangulation__set_DTcode[] = "Triangulation._set_DTcode";
static const char __pyx_k_Triangulation__set_PDcode[] = "Triangulation._set_PDcode";
static const char __pyx_k_Triangulation_or_Manifold[] = "Triangulation or Manifold";
static const char __pyx_k_c_canonized_triangulation[] = "c_canonized_triangulation";
static const char __pyx_k_c_symmetric_triangulation[] = "c_symmetric_triangulation";
static const char __pyx_k_canonical_retriangulation[] = "_canonical_retriangulation";
static const char __pyx_k_cusps_compute_cusp_shapes[] = "cusps_compute_cusp_shapes";
static const char __pyx_k_cython_core_dirichlet_pyx[] = "cython/core/dirichlet.pyx";
static const char __pyx_k_ignore_curve_orientations[] = "ignore_curve_orientations";
static const char __pyx_k_init_hyperbolic_structure[] = "init_hyperbolic_structure";
static const char __pyx_k_list_snappy_Triangulation[] = "'list[snappy.Triangulation]'";
static const char __pyx_k_real_coerced_to_bits_prec[] = "_real_coerced_to_bits_prec";
static const char __pyx_k_unpickle_dirichlet_domain[] = "_unpickle_dirichlet_domain";
static const char __pyx_k_with_hyperbolic_structure[] = "with_hyperbolic_structure";
static const char __pyx_k_A_1_q_IQ_4wgQ_D_2_t7_q_1_Q[] = "\200A\330\037 \330%+\2501\330\")\250\021\330(/\250q\360$\000\t\021\220\010\230\014\240I\250Q\330\010\t\330\014\023\2204\220w\230g\240Q\320&:\270!\330\017\020\340\010\014\210D\320\020!\240\021\320\"2\260!\330\010\017\210t\2207\230%\230q\330\014\r\320\r#\2401\330\020 \240\001\330\020\035\230Q\330\020\032\230!\330\014\r\330\r\016";
static const char __pyx_k_A_4y_q_U_4q_G1_XRt81F_Q_AQ[] = "\200A\360\020\000\t\014\2104\210y\230\007\230q\330\014\023\220:\230U\240!\2404\240q\330\r\021\220\030\230\023\230G\2401\330\014\023\220:\230X\240R\240t\2508\2601\260F\270&\300\005\300Q\340\014\022\220*\230A\230Q";
static const char __pyx_k_A_A_H_gQfHG1_q_1A_6a_4q_IQ[] = "\200A\360\006\000\026-\250A\330\031 \240\001\330\r\016\360H\001\000\t\022\220\035\230g\240Q\240f\250H\260G\2701\330\010\017\210q\320\020+\2501\250A\330,6\260a\330,;\2704\270q\330\020\024\220I\230Q";
static const char __pyx_k_All_cusps_must_be_fillable[] = "All cusps must be fillable.";
static const char __pyx_k_CCuspNeighborhood_manifold[] = "CCuspNeighborhood.manifold";
static const char __pyx_k_CCuspNeighborhood_topology[] = "CCuspNeighborhood.topology";
static const char __pyx_k_CDirichletDomain_edge_list[] = "CDirichletDomain.edge_list";
static const char __pyx_k_CDirichletDomain_face_list[] = "CDirichletDomain.face_list";
static const char __pyx_k_CDirichletDomain_in_radius[] = "CDirichletDomain.in_radius";
static const char __pyx_k_CDirichletDomain_num_edges[] = "CDirichletDomain.num_edges";
static const char __pyx_k_CDirichletDomain_num_faces[] = "CDirichletDomain.num_faces";
static const char __pyx_k_CFundamentalGroup_meridian[] = "CFundamentalGroup.meridian";
static const char __pyx_k_CFundamentalGroup_relators[] = "CFundamentalGroup.relators";
static const char __pyx_k_Cannot_convert_s_to_a_Real[] = "Cannot convert %s to a Real.";
static const char __pyx_k_Info_objects_are_immutable[] = "Info objects are immutable.";
static const char __pyx_k_LengthSpectrumFormatString[] = "LengthSpectrumFormatString";
static const char __pyx_k_Manifold_canonize_line_146[] = "Manifold.canonize (line 146)";
static const char __pyx_k_Manifold_cusp_neighborhood[] = "Manifold.cusp_neighborhood";
static const char __pyx_k_Manifold_fundamental_group[] = "Manifold.fundamental_group";
static const char __pyx_k_Manifold_tetrahedra_shapes[] = "Manifold.tetrahedra_shapes";
static const char __pyx_k_NeumannZagierTypeEquations[] = "NeumannZagierTypeEquations";
static const char __pyx_k_ObsLinkExteriors___getitem[] = "ObsLinkExteriors.__getitem__";
static const char __pyx_k_Please_specify_a_file_name[] = "Please specify a file name.";
static const char __pyx_k_PresentationMatrix_explode[] = "PresentationMatrix.explode";
static const char __pyx_k_SNAPPEA_MANIFOLD_DIRECTORY[] = "SNAPPEA_MANIFOLD_DIRECTORY";
static const char __pyx_k_The_Triangulation_is_empty[] = "The Triangulation is empty.";
static const char __pyx_k_Triangulation__from_isosig[] = "Triangulation._from_isosig";
static const char __pyx_k_Triangulation__from_pickle[] = "Triangulation._from_pickle";
static const char __pyx_k_Triangulation__from_string[] = "Triangulation._from_string";
static const char __pyx_k_direct_product_description[] = "direct_product_description";
static const char __pyx_k_get_tetrahedra_gluing_data[] = "_get_tetrahedra_gluing_data";
static const char __pyx_k_polished_tetrahedra_shapes[] = "polished_tetrahedra_shapes";
static const char __pyx_k_q_A_1A_aq_1_AQ_Yaq_Q__AQ_1[] = "\200\001\360\010\000\005\010\200q\320\010\031\230\023\230A\330\010\017\320\017#\2401\240A\340\004\026\220a\220q\320\030*\250!\2501\330\004 \240\001\240\021\330\004\010\320\010\034\230A\230Q\330\004\005\320\005\031\230\021\230!\330\004\005\200Y\210a\210q\220\005\220Q\330\004\005\200_\220A\220Q\330\004\013\2101";
static const char __pyx_k_s_3c_t1A_1_E_QfARq_E_QfARq[] = "\210\001\330\014\017\210s\220!\2203\220c\230\021\330\020\027\220t\2301\230A\340\014\023\2201\330\020\024\220E\230\021\230#\230Q\230f\240A\240R\240q\330\020\024\220E\230\021\230#\230Q\230f\240A\240R\240q";
static const char __pyx_k_sage_structure_sage_object[] = "sage.structure.sage_object";
static const char __pyx_k_unrecognized_solution_type[] = "unrecognized solution type";
static const char __pyx_k_A_L_t_4_hfAQ_7_Q_4y_q0A_1_q[] = "\320\004$\240A\360\016\000\t\025\220L\240\001\240\026\240t\250?\270!\330\010\021\320\021!\240\021\240!\340\010\021\320\021\"\240!\2404\320'>\270h\300f\310A\310Q\330\010\013\2107\220#\220Q\330\014\023\2204\220y\240\001\240\036\250q\3200A\300\021\300!\3001\330\010\017\210q";
static const char __pyx_k_A_aq_E_JfA_q_waq_QfE_1_IWAQ[] = "\200A\340\010\022\220$\220a\220q\330\010\014\210E\220\027\230\004\230J\240f\250A\330\014\r\330\020\027\220q\230\007\230w\240a\240q\330\023\024\340\010\r\210Q\210f\220E\230\031\240!\2401\330\010\014\210I\220W\230A\230Q";
static const char __pyx_k_CCuspNeighborhood_horoballs[] = "CCuspNeighborhood.horoballs";
static const char __pyx_k_CCuspNeighborhood_max_reach[] = "CCuspNeighborhood.max_reach";
static const char __pyx_k_CCuspNeighborhood_num_cusps[] = "CCuspNeighborhood.num_cusps";
static const char __pyx_k_CDirichletDomain__to_string[] = "CDirichletDomain._to_string";
static const char __pyx_k_CDirichletDomain_export_stl[] = "CDirichletDomain.export_stl";
static const char __pyx_k_CDirichletDomain_out_radius[] = "CDirichletDomain.out_radius";
static const char __pyx_k_CFundamentalGroup__gap_init[] = "CFundamentalGroup._gap_init_";
static const char __pyx_k_CFundamentalGroup_longitude[] = "CFundamentalGroup.longitude";
static const char __pyx_k_D_AQ_4q_A_A_4_Qk_q_t9AT_Yaq[] = "\320\004(\250\001\360\024\000\t\r\210D\220\014\230A\230Q\330\010*\250!\2504\250q\330+,\330+,\250A\330+,\250A\330\010\013\2104\210~\230Q\230k\250\036\260q\270\001\330\010\017\210t\2209\230A\230T\240\024\240Y\250a\250q";
static const char __pyx_k_Manifold__choose_generators[] = "Manifold._choose_generators";
static const char __pyx_k_Manifold_from_Triangulation[] = "Manifold_from_Triangulation";
static const char __pyx_k_Manifold_splitting_surfaces[] = "Manifold.splitting_surfaces";
static const char __pyx_k_Manifolds_must_be_non_empty[] = "Manifolds must be non-empty.";
static const char __pyx_k_No_tetrahedra_data_provided[] = "No tetrahedra data provided";
static const char __pyx_k_NonalternatingKnotExteriors[] = "NonalternatingKnotExteriors";
static const char __pyx_k_PresentationMatrix_add_rows[] = "PresentationMatrix.add_rows";
static const char __pyx_k_PresentationMatrix_get_data[] = "PresentationMatrix.get_data";
static const char __pyx_k_PresentationMatrix_simplify[] = "PresentationMatrix.simplify";
static const char __pyx_k_SnapPea_crashed_in_function[] = "SnapPea crashed in function ";
static const char __pyx_k_SymmetryGroup_is_full_group[] = "SymmetryGroup.is_full_group";
static const char __pyx_k_SymmetryGroup_is_polyhedral[] = "SymmetryGroup.is_polyhedral";
static const char __pyx_k_SymmetryGroup_order_line_62[] = "SymmetryGroup.order (line 62)";
static const char __pyx_k_Triangulation__covers_magma[] = "Triangulation._covers_magma";
static const char __pyx_k_Triangulation__three_to_two[] = "Triangulation._three_to_two";
static const char __pyx_k_Triangulation__two_to_three[] = "Triangulation._two_to_three";
static const char __pyx_k_Triangulation_copy_line_466[] = "Triangulation.copy (line 466)";
static const char __pyx_k_Triangulation_edge_valences[] = "Triangulation.edge_valences";
static const char __pyx_k_Triangulation_from_Manifold[] = "Triangulation_from_Manifold";
static const char __pyx_k_Triangulation_is_orientable[] = "Triangulation.is_orientable";
static const char __pyx_k_Triangulation_save_line_653[] = "Triangulation.save (line 653)";
static const char __pyx_k_binary_dihedral_group_2_2_d[] = "binary dihedral group <2,2,%d>";
static const char __pyx_k_from_tetrahedra_gluing_data[] = "_from_tetrahedra_gluing_data";
static const char __pyx_k_ignore_filling_orientations[] = "ignore_filling_orientations";
static const char __pyx_k_list_as_word_locals_genexpr[] = "list_as_word.<locals>.genexpr";
static const char __pyx_k_maximize_injectivity_radius[] = "maximize_injectivity_radius";
static const char __pyx_k_nonabelian_group_of_order_d[] = "nonabelian group of order %d";
static const char __pyx_k_ptolemy_obstruction_classes[] = "ptolemy_obstruction_classes";
static const char __pyx_k_9_D_q_AT_G9A_at_B_q_q_A_AQ_q[] = "\320\004&\320&9\270\021\360\022\000\t\035\230D\240\017\250q\340\010\030\230\001\330\010\030\320\030,\250A\250T\260\021\330\010\014\210G\2209\230A\330\014\027\220\177\240a\240t\320+B\300!\330\014\017\210q\330\020\027\320\027)\250\021\250!\340\020\027\320\027'\240q\250\n\260*\270A\330\014\031\230\027\240\001\240\021\330\014\034\230A\230Q\330\010\017\210q";
static const char __pyx_k_A_AT_4A_t1_e3at_a_9IQ_Q_4q_q[] = "\200A\360\010\000\t\035\230A\230T\320!4\260A\340\010\021\220\021\330\010\020\220\001\330\010\017\210t\2201\330\010\016\210e\2203\220a\220t\320\033.\250a\330\014\022\220!\2209\230I\240Q\330\014\025\220Q\330\014\023\2204\220q\330\010\017\210q";
static const char __pyx_k_A_S_2_47J_1_4q_AQ_E_aq_0_1_0[] = "\200A\360\024\000\t\026\220S\230\001\320\0312\260!\2604\3207J\310!\3101\330\010\013\2104\210q\330\014\022\220*\230A\230Q\340\010\021\220\021\330\010\014\210E\220\025\220a\220q\230\001\330\014\022\220'\230\021\230!\320\0330\260\001\260\021\360\006\000\t\020\210|\2301\320\0340\260\001";
static const char __pyx_k_CDirichletDomain___reduce_ex[] = "CDirichletDomain.__reduce_ex__";
static const char __pyx_k_CDirichletDomain_vertex_list[] = "CDirichletDomain.vertex_list";
static const char __pyx_k_CFundamentalGroup_gap_string[] = "CFundamentalGroup.gap_string";
static const char __pyx_k_CFundamentalGroup_generators[] = "CFundamentalGroup.generators";
static const char __pyx_k_ClosedOrientableDistinct_txt[] = "ClosedOrientableDistinct.txt";
static const char __pyx_k_Invalid_pickle_byte_sequence[] = "Invalid pickle byte sequence";
static const char __pyx_k_Manifold_cusp_info_line_1128[] = "Manifold.cusp_info (line 1128)";
static const char __pyx_k_Manifold_dehn_fill_line_1251[] = "Manifold.dehn_fill (line 1251)";
static const char __pyx_k_Manifold_set_target_holonomy[] = "Manifold.set_target_holonomy";
static const char __pyx_k_ObsNonorientableClosedCensus[] = "ObsNonorientableClosedCensus";
static const char __pyx_k_ObsNonorientableCuspedCensus[] = "ObsNonorientableCuspedCensus";
static const char __pyx_k_Splitting_S__1_0_b1_A0_a0_B1[] = "Splitting(S_{1,0}, [b1, A0], [a0,B1])";
static const char __pyx_k_StrLongestLen_locals_genexpr[] = "_StrLongestLen.<locals>.genexpr";
static const char __pyx_k_SymmetryGroup_abelianization[] = "SymmetryGroup.abelianization";
static const char __pyx_k_The_Triangulation_is_empty_2[] = "The Triangulation is empty";
static const char __pyx_k_Triangulation__is_symplectic[] = "Triangulation._is_symplectic";
static const char __pyx_k_Triangulation__reindex_cusps[] = "Triangulation._reindex_cusps";
static const char __pyx_k_Triangulation_and_text_files[] = "Triangulation and text files";
static const char __pyx_k_Triangulation_name_line_1081[] = "Triangulation.name (line 1081)";
static const char __pyx_k_Triangulation_num_tetrahedra[] = "Triangulation.num_tetrahedra";
static const char __pyx_k_Triangulation_plink_line_343[] = "Triangulation.plink (line 343)";
static const char __pyx_k_polish_hyperbolic_structures[] = "_polish_hyperbolic_structures";
static const char __pyx_k_try_hard_to_shorten_relators[] = "try_hard_to_shorten_relators";
static const char __pyx_k_without_hyperbolic_structure[] = "without_hyperbolic_structure";
static const char __pyx_k_CCuspNeighborhood_Ford_domain[] = "CCuspNeighborhood.Ford_domain";
static const char __pyx_k_CCuspNeighborhood_check_index[] = "CCuspNeighborhood.check_index";
static const char __pyx_k_CDirichletDomain__vertex_list[] = "CDirichletDomain._vertex_list";
static const char __pyx_k_CDirichletDomain_num_vertices[] = "CDirichletDomain.num_vertices";
static const char __pyx_k_CDirichletDomain_spine_radius[] = "CDirichletDomain.spine_radius";
static const char __pyx_k_CFundamentalGroup__magma_init[] = "CFundamentalGroup._magma_init_";
static const char __pyx_k_CFundamentalGroup__word_moves[] = "CFundamentalGroup._word_moves";
static const char __pyx_k_CHolonomyGroup_complex_length[] = "CHolonomyGroup.complex_length";
static const char __pyx_k_CallFuncList_function_local_F[] = "CallFuncList(function() local F, ";
static const char __pyx_k_Manifold__from_bytes_line_283[] = "Manifold._from_bytes (line 283)";
static const char __pyx_k_Manifold_filled_triangulation[] = "Manifold.filled_triangulation";
static const char __pyx_k_Manifold_use_field_conversion[] = "Manifold.use_field_conversion";
static const char __pyx_k_MatrixWithExplanations___init[] = "MatrixWithExplanations.__init__";
static const char __pyx_k_MatrixWithExplanations___repr[] = "MatrixWithExplanations.__repr__.<locals>.format_explain_list";
static const char __pyx_k_SymmetryGroup___reduce_cython[] = "SymmetryGroup.__reduce_cython__";
static const char __pyx_k_SymmetryGroup_center_line_256[] = "SymmetryGroup.center (line 256)";
static const char __pyx_k_SymmetryGroup_is_amphicheiral[] = "SymmetryGroup.is_amphicheiral";
static const char __pyx_k_Triangulation__covers_snappea[] = "Triangulation._covers_snappea";
static const char __pyx_k_Triangulation__num_fake_cusps[] = "Triangulation._num_fake_cusps";
static const char __pyx_k_Triangulation_cover_line_2395[] = "Triangulation.cover (line 2395)";
static const char __pyx_k_Triangulation_isomorphisms_to[] = "Triangulation.isomorphisms_to";
static const char __pyx_k_Triangulation_ptolemy_variety[] = "Triangulation.ptolemy_variety";
static const char __pyx_k_covers_low_index_locals_index[] = "_covers_low_index.<locals>.index";
static const char __pyx_k_cython_core_abelian_group_pyx[] = "cython/core/abelian_group.pyx";
static const char __pyx_k_cython_core_triangulation_pyx[] = "cython/core/triangulation.pyx";
static const char __pyx_k_j_T_Qa_1_q_0_k_q_a_4z_BgQ_l_1[] = "\320\004\036\230j\250\001\360\024\000\t\026\220T\230\034\240Q\240a\330\010\013\2101\330\014\023\220<\230q\320 0\260\006\260k\300\021\330 '\240q\330 &\240a\330$+\2504\250z\270\023\270B\270g\300Q\330$(\250\001\330\010\016\210l\230!\2301";
static const char __pyx_k_minimize_number_of_generators[] = "minimize_number_of_generators";
static const char __pyx_k_1Z_4_1_AQ_Qd_z_r_6_AS_E_aq_U_q[] = "\320\004#\2401\360Z\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\021\320\021%\240Q\240d\250!\330&'\240z\260\021\260!\330\010\017\210r\220\022\2206\230\021\230\"\230A\230S\240\004\240E\250\025\250a\250q\330\021\025\220U\230%\230q\240\001\330\010\035\230Q\230h\240a\340\010\014\210E\220\025\220a\220t\230:\240Q\330\014\030\230\004\230J\240a\240q\330\014\017\210y\230\001\330\020\030\230\002\230\"\230E\240\022\2401\340\020\030\230\001\230\031\240!\330\014\021\220\023\220F\230!\330\020\026\320\026'\240q\250\004\250A\330(+\2503\250a\250t\2603\260a\260t\2701\270A\330\020\024\220G\2301\230A\230S\240\001\240\023\240D\250\005\250U\260!\2601\330\020\"\240!\2401\340\010\013\2105\220\003\2201\330\014\023\2206\230\021\230!\340\010\013\2105\220\003\2201\330\014\022\220*\230A\230Q\340\010\017\210q\330\010\014\210G\2201\330\014\020\220\004\220O\2401\330\014\017\210t\2201\220C\220q\230\003\2301\230C\230q\240\001\330\014\020\220\001\330\014\020\220\005\220U\230!\2301\330\020\024\220C\220q\230\001\230\021\230\"\230B\230a\330\020\021\220\021\220%\220s\230!\2301\230A\230S\240\002\240!\330\020\021\220\021\220%\220q\230\003\2301\230A\230Q\230b\240\002\240#\240R\240q\330\020\025\220Q\220e\2302\230R\230w\240a\330\014\020\220\007\220s\230#\230S\240\001\330\010\017\210q";
static const char __pyx_k_1_D_4_1_AQ_D_gQ_A_A_l_Rt_S_a_a[] = "\320\0041\260\031\270!\360D\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\024\220D\230\n\240!\340\010\013\210;\220g\230Q\330\014\031\230\033\240A\330\020\034\230A\330\020\021\340\014\026\220l\240!\330\014\031\230\031\240#\240R\240t\250:\260S\270\001\330\014\031\230\021\230$\230a\330\032&\240a\330\032%\240Q\240a\330\032%\240Q\240a\330\014\020\220\007\220v\230Q\230h\240a\340\014\017\210z\230\022\2302\230T\240\023\240A\240^\2603\260a\330\020\025\220T\230\027\240\001\240\036\250q\330\025\030\230\004\230G\2401\240L\260\001\260\024\260Q\330\024\032\230*\240A\240Q\360\006\000\r\020\210z\230\023\230B\230d\240#\240Q\240n\260C\260q\330\020\035\230Z\240q\250\006\250n\270A\330\020\021\330\014\017\210s\220!\220>\240\022\2401\330\020\026\220j\240\001\240\021\330BC\330!\"\330\014\020\220\003\2208\2309\240A\240Q\330\020\035\230Z\240q\250\006\250f\260A";
static const char __pyx_k_1_WE_5_Qd_AQ_0_N_Jc_j_iq_waq_y[] = "\320\004#\2401\330\010\014\320\014\035\230W\240E\250\021\250.\270\001\340\010\013\2105\220\002\220#\220]\240#\240Q\240d\250!\330\014\022\220*\230A\230Q\330.0\260\001\340\010\014\210N\230!\340\010\014\210J\220c\230\021\230$\230j\250\001\250\021\340\010\016\210i\220q\230\007\230w\240a\240q\330#'\240y\260\007\260q\270\001\330\037&\240a\240q";
static const char __pyx_k_1_q_O3j_aq_q_A_q_aq_1_q_1A_Q_r[] = "\320\0001\260\021\330 !\360\010\000\005\t\210\017\220q\230\014\240O\2603\260j\300\016\310a\310q\330\004\007\200q\320\010\031\230\023\230A\330\010\017\210q\330\004\026\220a\220q\320\030*\250!\2501\330\004\005\320\005\031\230\021\230!\330\004\007\200q\360\006\000\t\024\2201\220A\330\010\013\320\013\035\230Q\320\036/\250r\260\021\330\014\"\240!\2401\330\014\027\220q\230\001\340\010*\250!\2501\330\010\027\220q\230\001\340\004\005\200Y\210a\210q\220\005\220Q\330\004\005\200_\220A\220Q\330\004\013\2101";
static const char __pyx_k_33Faz_4_1_AQ_9Cq_t_S_iq_AV_a_S[] = "\320\004\"\320\"3\3203F\300a\360z\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\013\2109\220C\220q\330\014\017\210t\220:\230S\240\001\330\020\026\220i\230q\240\001\360\010\000\r\024\320\023,\250A\250V\260;\270a\330.:\270!\340\010\013\210:\220S\230\001\330\014\023\220>\240\021\240!\2404\240z\260\021\260!\330#'\240u\250E\260\021\260$\260j\300\001\340\010\013\210:\220Q\220k\240\021\330\014\023\2201\220A\220Q\220k\240\024\240U\250$\250j\270\001\330\010\025\220[\240\001\330\014\027\220t\230:\240Q\330\014\r\340\010\025\220Q\220d\320\032,\250A\330\026\027\220z\240\021\240-\250q\260\003\2601\260A\330\026\027\220\177\240a\240q\330\026\027\320\027/\250q\260\001\330\026\027\320\027(\250\001\250\021\330\010\024\220A\220T\320\031+\2501\330\025\026\220l\240!\2401\330\025\026\320\026)\250\021\250!\330\010\017\210~\230Q\230a\330\010\r\210\\\230\021\330\010\023\220>\240\021\240!\330\010\020\220\014\230A\330\010\024\220N\240!\2401\330\010\021\220\034\230Q\330\010\022\220.\240\001\240\021\330\010\t\330\014\026\220a\330\014\031\230\034\240Q\240a\330\014\034\230C\230q\240\001\330\014\031\230\032\2401\240D\250\n\260!\2601\330\014\025\220T\230\031\240!\2401\330\014\036\230a\330\014\027\220t\2309\240A\240Q\330\014\033\2304\230y\250\001\250\033\260D\270\t\300\021\300!\330\014%\320%7\260q\360\006\000\t\026\220Q\220d\320\032,\250A\330\026\027\320\027*\250!\250?\270!\2701\340\010\013\320\013\035\230S\240\001\330\014\032\230.\250\001\250\021\330\014\027\220|\2401\330\014\020\220\007\220q\330\020\037\230t\2409\250A\250Q\330\020%\240Q\360\006\000\t\020\210x\220s\230!";
static const char __pyx_k_4_1_AQ_1_AQ_4A_AT_31_2_7q_r9K1[] = "\320\004(\250\001\360<\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\360\010\000\t\014\2101\330\014\017\210}\230A\230Q\330\020\023\220?\320\"4\260A\330\024\031\230\023\230A\230T\320!3\2601\330\024#\2402\320%7\260q\270\001\330\024%\240\\\260\026\260r\3209K\3101\330\024\030\320\030(\250\001\250\021\330\024\033\2304\230v\240Q\240a\240q\250\001\250\023\250D\260\005\260Q\330\026%\320%G\300s\310!\330\026%\320%=\270Q\330\024\030\230\001\330\024\033\2304\230v\240Q\240a\240y\260\001\260\021\260&\270\002\270+\300Q\300a\340\024\032\230*\240A\240Q\340\021 \240\001\240\021\330\020\035\230T\240\021\240/\260\025\260a\330\020\023\220;\230c\240\021\330\024\031\230\025\230a\230t\320#5\260Q\330\024\030\230\002\230,\240a\240q\330\025 \240\003\2401\330\024\030\230\001\330\024\027\220t\2304\230q\240\001\240\026\240r\250\025\250d\260#\260Q\330\030\036\230i\240q\250\001\360\006\000\025\033\230)\2401\240A\340\020\025\220U\230!\2301\360\n\000\021#\240!\320#7\260r\270\025\270a\360\006\000 !\330\020\"\240!\2401\240B\240b\250\002\250$\250e\2604\260w\270a\330#'\240x\250q\340\010\014\210D\320\020\"\240!\330\010\033\2304\320\0371\260\021\260!\330\010\021\220\023\220A\220_\240A\240W\250C\250q\3200A\300\022\3007\310!\360\016\000\t \230q\320 A\300\021\300$\300a\340\010\032\230/\250\021\250$\250a\330*+\330*/\250q\330\010\020\220\004\220J\230a\230q\330\010\r\320\r!\240\021\240!\330\010\r\210_\230A\330\014\027\220t\2305\240\001\330\014\027\220{\240!\320#3\2601\330\014\027\220q\340\010\r\210Y\220a\220t\2305\240\003\2401\240D\250\002\250$\250a\250w\260b\270\001\330\010\033\2301\230A\330\034\035\320\0355\260Q\330\034 \240\n\250!\330\010\017\210q";
static const char __pyx_k_4_1_AQ_S_4z_uE_j_Qk_1AQk_U_j_t[] = "\320\004\"\240!\360>\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\013\210:\220S\230\001\330\014\023\220>\240\021\240!\2404\240z\260\021\260!\330#'\240u\250E\260\021\260$\260j\300\001\330\010\013\210:\220Q\220k\240\021\330\014\023\2201\220A\220Q\220k\240\024\240U\250$\250j\270\001\330\010\025\220[\240\001\330\014\027\220t\230:\240Q\330\014\r\340\010\025\220Q\220d\320\032,\250A\330\026\027\220z\240\021\240-\250q\260\003\2601\260A\330\026\027\220\177\240a\240q\330\026\027\320\027/\250q\260\001\330\026\027\320\027(\250\001\250\021\330\010\t\330\013\025\220Q\330\013\030\230\014\240A\240Q\330\013\033\2303\230a\230q\330\013\030\230\n\240!\2404\240z\260\021\260!\360\006\000\t\020\210x\220s\230!";
static const char __pyx_k_4_q_AQ_6_1_M_gQ_fAQ_4AV7_1_4_1[] = "\320\004:\270!\360 \000\t\014\2104\320\017 \240\007\240q\330\014\022\220*\230A\230Q\340\010\020\320\020#\2406\250\021\250!\330\010\013\2101\330\014\024\220M\240\025\240g\250Q\330\r\026\220f\230A\230Q\330\014\031\230\021\360\006\000\r\016\340\010\014\320\014 \240\001\330\0144\260A\260V\2707\300!\3001\360\006\000\t\014\2104\320\017 \240\003\2401\330\014\r\340\010\013\2101\330\014\034\320\034;\2701\270F\300!\340\010\013\2101\330\014\020\320\020(\250\001";
static const char __pyx_k_4xq_Q_F_1_q_3hj_4s_4s_1_xq_T_q[] = "\200\001\330\004\013\2104\210x\220q\230\005\230Q\330\004\010\320\010\034\230F\240!\2401\330\004\007\200q\330\010\013\2103\210h\220j\240\001\240\027\250\001\330\010\013\2104\210s\220!\2204\220s\230!\2301\330\010\021\220\026\220x\230q\240\005\240T\250\030\260\021\260%\260q\330\010\022\220'\230\030\240\021\240%\240t\2508\2601\260E\270\021\330\010\022\220'\230\030\240\022\2403\240a\330\010\017\210w\220j\240\001\240\030\250\031\260,\270a";
static const char __pyx_k_4xq_Q_q_q_3l_7_4s_4s_1_IXQe4xq[] = "\200\001\330\004\013\2104\210x\220q\230\005\230Q\330\004\010\320\010\031\230\026\230q\240\001\330\004\007\200q\330\010\013\2103\210l\230!\2307\240!\330\010\013\2104\210s\220!\2204\220s\230!\2301\330\010\024\220I\230X\240Q\240e\2504\250x\260q\270\005\270Q\330\010\022\220'\230\030\240\022\2403\240a\330\010\017\210w\220g\230Q\230k\250\034\260Q";
static const char __pyx_k_7q_T_Qa_8_1_aq_E_a_1_l_1_q_q_y[] = "\320\004%\320%7\260q\360\030\000\t\026\220T\230\034\240Q\240a\330\010\027\320\0278\270\001\330\014\020\220\001\330\014\r\330\010\013\210=\230\003\2301\330\014\022\220,\230a\230q\330\010\021\220\021\330\010\014\210E\220\025\220a\220|\2401\330\014\026\220l\240(\250!\2501\330\014\017\210q\330\020\021\330\024\030\230\t\240\021\240.\260\001\260\027\270\t\300\021\300!\330\024\030\230\t\240\021\240.\260\001\260\027\270\t\300\021\300!\340\020\030\230\017\240q\250\007\250y\270\001\270\021\330\030'\240q\250\007\250y\270\001\270\021\330\014\022\220'\230\021\230!\330\010+\2501\250A\330\010\017\210q";
static const char __pyx_k_8_J_4_1_AQ_D_1_AQ_q_7_Q_1_Cq_1[] = "\320\0048\270\001\360J\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\014\210D\220\n\230!\330\010\013\320\013#\2401\330\014\022\220*\230A\230Q\330\010*\250!\340\010'\240q\340\010\013\2107\220#\220Q\330\014\033\2301\330\r\024\220C\220q\330\014\033\2301\330\014\036\230a\330\r\024\220C\220q\330\014\033\2301\330\014\036\230a\340\014\022\220*\230A\230Q\340\010\024\220I\230Q\230d\320\"4\260K\270q\300\004\300E\310\023\310B\310a\330\010\031\230\032\2406\250\021\250!\2501\250A\330\010\014\210E\220\025\220a\220q\330\014\032\230!\2305\240\001\340\010\023\2201\220K\320\037/\250~\270Q\330\010\035\230Q\230a\330\010\037\230q\240\001\330\010\031\230\021\230!\330\010\023\2201\220A\330\010\025\320\025)\250\021\250!\330\010\022\320\022&\240a\240q\330\010\014\210A\210Q\330\010\017\210q";
static const char __pyx_k_99QQR_4N_8_AT_4wh6H_WX_HA_wa_q[] = "\320\004)\320)9\3209Q\320QR\330!4\260N\300!\3608\000\t\022\220\023\220A\220T\230\032\2404\240w\250h\3206H\310\017\320WX\330\r\021\220\021\220*\230H\240A\330\014\020\220\010\230\001\330\020\023\220<\230w\240a\330\024\037\230q\330\020\033\2306\240\021\240!";
static const char __pyx_k_A_r_3a_oQa_r_t3a_l_1_T_Cs_AZxr[] = "\200\001\340\004,\250A\330\004\007\200r\210\032\2203\220a\330\010\n\210,\220o\240Q\240a\330\004\017\210r\220\021\330\004\n\210\"\320\014\"\240!\330\004\007\200t\2103\210a\330\010\016\210l\230!\2301\330\t\r\210T\220\023\220C\220s\230!\330\010\022\220&\230\001\230\021\340\010\020\220\014\230A\230Z\240x\250r\260\022\2608\2701\330\010\020\220\014\230A\230R\230x\240q\330\010\032\320\032:\270!\2701\330\010\013\320\013\033\2307\240!\330\014.\250a\250q\330\010\013\2108\320\023$\240G\2501\330\014\036\230a\230x\240q\330\010\020\320\020$\240A\240Q\330\010\020\220\007\220v\230Q\230h\240a\330\010\022\220&\230\001\230\021";
static const char __pyx_k_B_4_a_Q_A_G9A_1D0Gq_q_q_Ya_WAQ[] = "\320\004/\320/B\300!\360\030\000\t\034\2304\230\177\250a\330\010!\240\024\320%=\270Q\330\010\024\220A\330\010\014\210G\2209\230A\330\014\022\320\022+\2501\250D\3200G\300q\330\014\017\210q\330\020\027\320\027)\250\021\250!\340\020\027\320\027'\240q\250\005\250Y\260a\330\014\025\220W\230A\230Q\330\014\034\230A\230Q\330\010\017\210q";
static const char __pyx_k_Brings_up_a_link_editor_window[] = "\n        Brings up a link editor window if the manifold is stored\n        as a link complement in your current session.\n\n        >>> M = Manifold('4_1') # stored as a triangulation with a link\n        >>> M.link()\n        <Link: 1 comp; 4 cross>\n        >>> N = Manifold('m004') # stored as a triangulation without a link\n        >>> N.link() #doctest: +ELLIPSIS\n        Traceback (most recent call last):\n        ...\n        ValueError: No associated link known.\n\n        ";
static const char __pyx_k_CCuspNeighborhood_translations[] = "CCuspNeighborhood.translations";
static const char __pyx_k_CDirichletDomain_pairing_words[] = "CDirichletDomain.pairing_words";
static const char __pyx_k_CDirichletDomain_save_line_643[] = "CDirichletDomain.save (line 643)";
static const char __pyx_k_CDirichletDomain_triangulation[] = "CDirichletDomain.triangulation";
static const char __pyx_k_CFundamentalGroup_magma_string[] = "CFundamentalGroup.magma_string";
static const char __pyx_k_CFundamentalGroup_num_relators[] = "CFundamentalGroup.num_relators";
static const char __pyx_k_CHolonomyGroup___reduce_cython[] = "CHolonomyGroup.__reduce_cython__";
static const char __pyx_k_Change_the_triangulation_to_an[] = "\n        Change the triangulation to an arbitrary retriangulation of\n        the canonical cell decomposition. See\n        :py:meth:`canonical_retriangulation <snappy.Manifold.canonical_retriangulation>`\n        to get the actual canonical cell decomposition.\n\n        >>> M = Manifold('m007')\n        >>> M.num_tetrahedra()\n        3\n        >>> M.canonize()\n        >>> M.num_tetrahedra()\n        4\n\n        Note: Due to rounding error, it is possible that this is actually\n        not a retriangulation of the canonical cell decomposition.\n        ";
static const char __pyx_k_Export_the_Dirichlet_domain_as[] = "\n        Export the Dirichlet domain as an stl file suitable for 3d printing.\n\n        Arguments can be given to modify the model produced:\n\n        * model='klein' - (alt. 'poincare') the model of HH^3 to use.\n\n        * cutout=False - remove the interior of each face\n\n        * shrink_factor=0.9 - the fraction to cut out of each face\n\n        * cuttoff_radius=0.9 - maximum rescaling for projection into Poincare model\n\n        * num_subdivision=3 - number of times to subdivide for the Poincare model\n\n        For printing domains in the Poincare model, cutoff_radius is critical for avoiding\n        infinitely thin cusps, which cannot be printed.\n\n        This can take a long time for finely subdivided domains. So we call UI_callback\n        every so often if it is not None.\n\n        >>> D = Manifold('m004').dirichlet_domain()\n        >>> D.export_stl('fig-eight-klein.stl')     #doctest: +SKIP\n        >>> D.export_stl('fig-eight-poincare.stl', model='poincare')     #doctest: +SKIP\n        >>> D.export_stl('fig-eight-klein-wireframe.stl', cutout=True)     #doctest: +SKIP\n        >>> D.export_stl('fig-eight-poincare-wireframe.stl', model='poincare', cutout=True)     #doctest: +SKIP\n        ";
static const char __pyx_k_FormatHomForSnapPea_function_f[] = "                     FormatHomForSnapPea := function(f)\n                         subone := function(L)   return [x - 1 : x in L]; end function;\n                         return [subone(Eltseq(f(g))) : g in Generators(Domain(f))];\n                       end function;";
static const char __pyx_k_LengthSpectrumFormatStringBase[] = "LengthSpectrumFormatStringBase";
static const char __pyx_k_M_A_6_A_1_1G_Q_8_XQa_1_5_q_wfA[] = "\320\004\034\230M\250\021\360&\000\t\021\220\004\220A\330\010\013\2106\220\023\220A\330\014\023\2201\330\r\021\220\032\2301\230G\240:\250Q\330\014\020\220\013\2308\240:\250X\260Q\260a\330\010\013\2101\330\014\023\2205\230\007\230q\240\007\240w\250f\260A\340\014\017\210q\330\020\027\220u\230G\2401\240C\240q\250\003\2504\250u\260E\270\021\340\020\027\220u\230A";
static const char __pyx_k_Manifold__from_string_line_267[] = "Manifold._from_string (line 267)";
static const char __pyx_k_Manifold_chern_simons_line_821[] = "Manifold.chern_simons (line 821)";
static const char __pyx_k_Manifold_dual_curves_line_1403[] = "Manifold.dual_curves (line 1403)";
static const char __pyx_k_Manifold_set_peripheral_curves[] = "Manifold.set_peripheral_curves";
static const char __pyx_k_Manifold_set_tetrahedra_shapes[] = "Manifold.set_tetrahedra_shapes";
static const char __pyx_k_P_crossings_0_9_P_components_0[] = "(?P<crossings>[0-9]+)[\\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$";
static const char __pyx_k_Return_a_reasonably_short_byte[] = "\n        Return a reasonably short byte sequence which encodes the\n        combinatorics of this triangulation.\n        >>> M = Manifold('m125')\n        >>> seed = M._to_bytes()\n        >>> len(seed)\n        12\n        >>> N = Manifold('empty')\n        >>> N._from_bytes(seed)\n        >>> N == M\n        True\n        ";
static const char __pyx_k_Return_a_string_containing_the[] = "\n        Return a string containing the contents of a SnapPea triangulation\n        file.\n        >>> M = Manifold('7_4')\n        >>> seed = M._to_string()\n        >>> N = Manifold(seed)\n        >>> N == M\n        True\n        ";
static const char __pyx_k_Return_the_commutator_subgroup[] = "\n        Return the commutator subgroup of the SymmetryGroup\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S\n        D4\n        >>> S.commutator_subgroup()\n        Z/2\n        ";
static const char __pyx_k_Returns_a_copy_of_the_manifold[] = "\n        Returns a copy of the manifold\n\n        >>> M = Manifold('m015')\n        >>> N = M.copy()\n        ";
static const char __pyx_k_Save_the_Dirichlet_domain_as_a[] = "\n        Save the Dirichlet domain as a text file in \"% Generators\" format.\n\n        >>> from snappy.number import Number\n        >>> acc, Number._accuracy_for_testing = Number._accuracy_for_testing, None\n        >>> M = Manifold('m125')\n        >>> D = M.dirichlet_domain()\n        >>> from tempfile import NamedTemporaryFile\n        >>> f = NamedTemporaryFile(delete=False)\n        >>> f.close()\n        >>> D.save(f.name)\n        >>> E = DirichletDomain(generator_file=f.name); E\n        30 finite vertices, 2 ideal vertices; 50 edges; 20 faces\n        >>> os.unlink(f.name)\n        >>> from pickle import dumps, loads\n        >>> E = loads(dumps(D)); E\n        30 finite vertices, 2 ideal vertices; 50 edges; 20 faces\n        >>> Number._accuracy_for_testing = acc\n        ";
static const char __pyx_k_T_Kt_itSZZ_mmqqr_G1F_a_vWA_q_t[] = "\200\001\360\010\000\005\016\210T\220\037\240\004\240K\250t\260?\300$\300i\310t\320SZ\320Z^\320^m\320mq\320qr\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\230>\250\027\260\005\260S\270\004\270J\300g\310U\320RU\320UY\320Yg\320gn\320ns\320sv\320vz\360\000\000{\001C\002\360\000\000C\002J\002\360\000\000J\002O\002\360\000\000O\002R\002\360\000\000R\002V\002\360\000\000V\002d\002\360\000\000d\002k\002\360\000\000k\002l\002\330\004\007\200q\330\010\017\320\0173\2604\260q\270\007\270{\310'\320QR\340\010\017\320\0173\2604\260q\270\007\270{\310!";
static const char __pyx_k_That_Magma_type_not_recognized[] = "That Magma type not recognized.";
static const char __pyx_k_Triangulation__isomorphisms_to[] = "Triangulation._isomorphisms_to";
static const char __pyx_k_Triangulation__symplectic_form[] = "Triangulation._symplectic_form";
static const char __pyx_k_Triangulation_covers_line_2497[] = "Triangulation.covers (line 2497)";
static const char __pyx_k_Triangulation_gluing_equations[] = "Triangulation.gluing_equations";
static const char __pyx_k_Triangulation_symplectic_basis[] = "Triangulation.symplectic_basis";
static const char __pyx_k_b_auBb_E_Qb_Cq_c_D_1Ba_AS_S_AS[] = "\200\001\330\004\006\200b\210\002\210$\210a\210u\220B\220b\230\004\230E\240\021\240#\240Q\240b\250\004\250C\250q\260\002\260$\260c\270\021\270\"\270D\300\003\3001\300B\300a\330\004\014\210A\210S\220\001\220\024\220S\230\001\230\021\330\004\014\210A\210S\220\001\220\024\220S\230\001\230\021\330\004\014\210D\220\002\220!\2206\230\021\230$\230b\240\004\240B\240a\240v\250Q\250d\260\"\260A\330\014\020\220\002\220!\2206\230\021\230$\230b\240\004\240B\240a\240v\250Q\250d\260\"\260A";
static const char __pyx_k_c_retriangulated_triangulation[] = "c_retriangulated_triangulation";
static const char __pyx_k_canonical_cells_are_tetrahedra[] = "_canonical_cells_are_tetrahedra";
static const char __pyx_k_contains_degenerate_tetrahedra[] = "contains degenerate tetrahedra";
static const char __pyx_k_cython_core_symmetry_group_pyx[] = "cython/core/symmetry_group.pyx";
static const char __pyx_k_data_1_1_2_2_0_1_3_2_2_3_1_0_0[] = "\n        >>> data = [([1, 1, 2, 2], [[0, 1, 3, 2], [2, 3, 1, 0], [0, 1, 3, 2], [3, 0, 1, 2]]),\n        ...         ([0, 2, 2, 0], [[0, 1, 3, 2], [1, 0, 2, 3], [2, 3, 1, 0], [3, 2, 0, 1]]),\n        ...         ([1, 1, 0, 0], [[1, 0, 2, 3], [3, 2, 0, 1], [1, 2, 3, 0], [0, 1, 3, 2]])]\n        >>> M = Triangulation('empty')\n        >>> M._from_tetrahedra_gluing_data(data)\n        >>> N = Triangulation('m007')\n        >>> M == N\n        True\n\n        Check that cusp indices are transmitted. This manfiold has two\n        cusps and trivial symmetry group and we interchange the two\n        cusps.\n\n        >>> M = Manifold('o9_44133')\n        >>> tet_data = M._get_tetrahedra_gluing_data()\n        >>> cusp_data = M._get_cusp_indices_and_peripheral_curve_data()[0]\n        >>> cusp_data = [[1 - c for c in tet_cusps] for tet_cusps in cusp_data]\n        >>> N = Manifold('empty')\n        >>> N._from_tetrahedra_gluing_data(tet_data, num_or_cusps=2, cusp_indices=cusp_data)\n        >>> M.is_isometric_to(N, True)[0].cusp_images()\n        [1, 0]\n\n        A nonorientable example.\n\n        >>> Y = Triangulation('y885')\n        >>> Y.set_peripheral_curves([([1, 0], [0, 1]), ([-1, 0], [0, -1]), ([1, 7], [1, 8])])\n        >>> tets = Y._get_tetrahedra_gluing_data()\n        >>> cusps, curves = Y._get_cusp_indices_and_peripheral_curve_data()\n        >>> max(sum(curves, []))\n        9\n        >>> X = Triangulation('empty')\n        >>> X._from_tetrahedra_gluing_data(tets, 1, 2, cusps, curves)\n        >>> X._get_cusp_indices_and_peripheral_curve_data() == (cusps, curves)\n        True\n        ";
static const char __pyx_k_fillings_may_affect_generators[] = "fillings_may_affect_generators";
static const char __pyx_k_hk_A_1_r_r_t_t_u_XQa_7_4A5J_XY[] = "\200\001\360\006\000\005\010\200\177\220h\230k\250\033\260A\330\010\r\210^\2301\330\010\016\320\016!\360\000\000\"r\002\360\000\000r\002t\002\360\000\000t\002u\002\330\004\023\320\023%\240X\250Q\250a\330\004\007\200|\2207\230!\330\0104\260A\3205J\310.\320XY\330\004\013\2101";
static const char __pyx_k_ptolemy_equations_boundary_map[] = "_ptolemy_equations_boundary_map_3";
static const char __pyx_k_pyx_unpickle_PresentationMatri[] = "__pyx_unpickle_PresentationMatrix";
static const char __pyx_k_q_4_1_1_4_1_aq_a_as_1_1_1_Ba_1[] = "\320\004\037\230q\360,\000\t\014\2104\320\017 \240\003\2401\330\014\023\2201\340\010\032\230!\2304\320\0371\260\021\260!\330\010\026\220a\220q\330\010\022\220!\320\023.\250a\250\177\270a\270s\300!\3001\330\010\032\230!\2301\330\010\013\2101\330\014\024\220B\220a\340\014\023\2201";
static const char __pyx_k_q_4was_1A_4q_d_6_az_4z_Q_aq_4q[] = "\200\001\330\004\007\200q\330\010\013\2104\210w\220a\220s\230!\330\014\020\220\013\2301\230A\330\010\013\2104\210q\220\006\220d\230!\2306\240\021\330\010\021\220\021\320\022&\240a\240z\260\021\340\010\013\2104\210z\230\021\230#\230Q\330\014\020\220\006\220a\220q\330\010\013\2104\210q\220\001\330\010\021\220\021\220#\220Q\220c\230\024\230U\240$\240g\250Q\250c\260\023\260A\260X\270S\300\007\300q\360\006\000\005\010\200r\210\022\2101\330\010\021\220\027\230\002\230!\2304\230q\240\001\240\021\330\004\007\200r\210\022\2101\330\010\014\210E\220\025\220a\220r\230\022\2301\330\014\022\220'\230\021\230!\360\006\000\005\r\210A\210R\210t\2205\230\007\230s\240\"\240C\240q\330\004\017\210q\220\002\220$\220e\2307\240#\240R\240s\250!\330\004\014\210E\220\021\330\004\013\2109\220B\220a";
static const char __pyx_k_q_F_Q_r_e1A_AQ_X_j_V1_Jc_31_iq[] = "\320\004\027\220q\330\010\013\320\013$\240F\250#\250Q\330\014\027\220r\230\025\230e\2401\240A\330$%\330\014 \240\004\240A\240Q\330\014%\240X\320->\270j\310\001\330\014\035\230V\2401\330\010\014\210J\220c\230\021\320\0323\2601\330\010\016\210i\220q\230\006\230a";
static const char __pyx_k_sage_groups_perm_gps_permgroup[] = "sage.groups.perm_gps.permgroup";
static const char __pyx_k_set_peripheral_from_decoration[] = "set_peripheral_from_decoration";
static const char __pyx_k_with_Dehn_filling_coefficients[] = " with Dehn filling coefficients (M, L) = ";
static const char __pyx_k_wj_8q_31_4_1_AQ_4wgQ_8_q_A_7_Q[] = "\320\004'\240w\250j\270\001\360\014\000\t8\260q\330\0103\2601\330\010:\270!\360\014\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\t\330\014\023\2204\220w\230g\240Q\320&8\270\001\330\017\020\360\006\000\t\022\320\021'\240q\250\004\250A\330()\250\021\330()\250\021\330()\250\021\330()\250\021\340\010\013\2107\220#\220Q\330\014\022\220*\230A\230Q\360\006\000\t#\240$\240j\260\001\260\021\330\010\037\320\0373\2601\260A\330\010\014\210G\2205\230\001\320\0312\260!\340\010\031\230\035\240a\240s\250!\320+;\2701\330\010\013\2101\330\014\037\230q\240\001\330\014\032\320\0320\260\001\260\021\340\014\037\230q\240\001\330\014\032\320\0320\260\001\260\021\340\010\017\210t\2207\230%\230q\320 0\3200B\300!";
static const char __pyx_k_00C1_9Cq_q_j_6_iz_1_d_q_1_D_1_4[] = "\320\004\036\320\0360\3200C\3001\360<\000\t\014\2109\220C\220q\330\014\017\210q\330\020\026\220j\240\001\330\024\025\360\006\000\r\024\2206\230\037\250\001\330\020\026\220i\230z\250\032\2601\340\010\016\210d\220-\230q\330\010\013\2101\330\014\024\220D\230\t\240\021\240&\250\003\2501\340\014\023\2204\220y\240\001\240\021";
static const char __pyx_k_1_31_B_4_1_1_4t_E_3is_T_2_q_A_7[] = "\320\004%\320%;\2701\330$3\2601\330$%\360B\001\000\t\014\2104\320\017 \240\003\2401\330\014\023\2201\360\n\000\t\014\2104\210t\220>\240\023\240E\250\032\2603\260i\270s\300!\330\014\025\220T\320\031+\2502\320-?\270q\330',\250A\330'7\260q\330'1\260\033\270I\300Q\330'1\260\032\2703\270a\330\014\017\210u\220G\2301\330\020\027\220q\340\020\027\220~\240Q\240a\340\010\021\220\021\330\010\013\210:\220S\230\001\330\014\017\320\017\037\230s\240!\330\020\026\220j\240\001\330\024\025\340\014\025\220T\320\0314\260A\330\020\026\220i\230z\250\032\2601\330\020%\240Q\330\014\020\220\005\220Q\330\020\026\220g\230Q\230i\240q\250\005\250Q\330(,\250A\250T\260\021\330(4\260F\270&\300\006\300a\340\014\020\220\005\220U\230!\2304\230\177\250a\330\020\035\230Q\230d\320\"4\260C\260x\270q\330\036\037\230y\250\001\250\031\260!\2608\2701\270A\330\036\037\230|\2501\250A\330\036\037\230|\2501\250A\330\036\037\230q\340\020\033\2306\240\021\240,\250a\250y\270\001\330\020\032\230-\240q\250\014\260A\330\020\032\230&\240\001\240\034\250Q\250h\260a\330\020\031\230\035\240a\240|\2601\330\020\023\2205\230\004\230H\240G\2501\340\024\032\230'\240\021\240)\2501\330\034!\240\024\240Y\250a\250q\330\034 \240\004\240I\250Q\250a\330\034(\250\014\260A\330(4\260A\340\024\032\230'\240\021\240)\2501\330\034!\240\024\240Y\250a\250q\330\034 \240\004\240I\250Q\250a\330\034#\240:\250W\260A\330\034(\250\014\260A\330(4\260A\340\010\013\2101\330\014\017\210z\230\023\230A\330\020\031\230\026\320\0375\260Q\330\024\032\230!\2301\230A\230X\240T\250\025\250a\330\024\035\230Z\240z\260\021\340\020\031\230\026\320\0375\260Q\330\024\032\230!\2301\230A\230X\240T\250\025\250a\330\024 \240\004\240K\250q\330\014\017\210t\2206\320\0310\260\001\330\020\026\220l\240!\2401\360\006\000\r\026\220R\220y\240\001\240\025\240a\330!%\240Q\240d\250!\330!-\250U\260%\260u\270A\330\027\033\2305\240\006\240a\340\010\013\2105\220\007\220q\330\014\r\330\020\027\220q\230\001\230\021\230&\240\004\240E\250\021\330\023\024\330\020\026\220j\240\001\240\021""\360\006\000\r\024\220>\240\021\240!";
static const char __pyx_k_2_D_q_A_1A_1A_1_G9A_1IQb_q_iq_1[] = "\320\0042\260!\330)*\330-.\330*+\330&'\360D\001\000\t\030\220q\230\004\230A\330\030#\2401\240A\330\030\031\330\030\031\330\030\031\330\030#\2401\240A\330\030\031\230\021\330\030\031\230\021\330\010\023\2201\330\010\014\210G\2209\230A\330\014\025\220^\2401\240I\250Q\250b\260\001\330\014\031\230\026\230q\240\001\240\021\240$\240i\250q\260\013\2701\270F\300)\3101\310B\310g\320UV\320VX\320XY\320YZ\330\"&\240e\2505\260\001\260\024\260T\270\025\270e\3001\300A\330\014\r\330\020\033\2304\230y\250\001\250\021\330\020\033\230<\240q\250\t\260\021\260\"\260A\330\020\035\230Y\240a\240y\260\001\260\022\2601\330\020\"\240)\2501\250B\250a\330\020\033\2301\340\014\025\220Y\230a\230r\240\021\330\014\017\210q\330\020\021\220\021\220*\320\034,\250A\330\024\034\230D\320 B\300!\340\014\024\220G\2301\320\034.\250c\260\021\330\010\034\230A\230[\250\001\330\010\017\210~\230Q\230a";
static const char __pyx_k_33CCVVW_L_1_1_D_r_2Rr_T_e1A_c_1[] = "\320\0043\3203C\320CV\320VW\360$\000\t\021\220\004\220L\240\001\330\010\013\2101\330\014\023\2201\340\010\014\210D\320\020(\250\001\340\010\020\220\001\220\026\220r\230\022\2302\230R\230r\240\024\240T\250\025\250e\2601\260A\340\010\016\210c\220\021\220'\230\022\2301\330\014\020\220\005\220T\230\021\230!\330\014\017\210r\220\023\220C\220q\230\001\330\020\024\220E\230\026\230q\240\001\360\006\000\021\027\220h\230e\2402\240T\250\025\250a\250q\260\001\260\021\330\020\030\230\001\230\025\230a\230v\240R\240r\250\027\3200A\300\021\300%\300q\310\001\310\021\330\031\035\230U\240!\330\020\025\220W\230A\320\035-\250Q\250c\260\021\260'\270\021\340\020\024\220E\230\024\230Q\230a\330\020\023\2202\220S\230\001\330\024\031\230\021\230%\230u\240B\240a\330\024\034\230E\240\023\240A\330\025\027\220s\230!\2301\330\024\031\230\021\230%\320\0370\260\001\260\025\260a\260q\340\024\027\220t\2305\240\001\240\023\240A\240U\250%\250q\260\003\2601\260A\330\024\027\220q\230\001\230\022\2302\230Q\330\030\034\320\034-\250Q\250a\330\024\031\230\021\230#\230Q\230f\320$4\260A\260Q\260a\260u\270B\270b\300\007\300q\310\001\310\021\340\010\013\2101\330\014\023\2205\230\001\230\021\340\014\020\220\004\320\024,\250A\330\014\023\2202\220\\\240\021\240&\250\003\250>\270\024\270X\300U\310!\3101";
static const char __pyx_k_33I_H_q_A_4_1_1_1_t3a_Rr_iq_V1B[] = "\320\0043\3203I\310\021\360H\001\000\t\026\320\025'\240q\250\004\250A\360\010\000\t\014\2104\320\017 \240\003\2401\330\014\023\2201\340\010\013\2101\330\014\017\210t\2203\220a\220{\240#\240R\240r\250\021\330\020\026\220i\230q\240\001\330\014\032\230+\240V\2501\250B\250b\260\002\260\"\260A\330\014\020\220\005\220U\230!\2302\230R\230q\330\020\033\2301\230E\240\025\240i\250q\260\010\270\001\330\014\036\230a\230t\2401\330\037 \240\001\340\014\026\220a\330\014\020\220\005\220U\230!\2301\330\020\036\230a\330\020\"\240!\2404\240q\330#$\240A\330\020\031\230\036\240q\250\001\330\020\023\220:\230Q\230h\240c\250\021\330\024\036\230a\330\024\025\340\024&\240a\240q\340\014\017\210t\2201\330\020\026\220l\240!\2401\360\006\000\t1\260\001\330\0200\260\001\340\010\014\210A\210Q\340\010\022\320\022&\240a\240q\330\010\017\320\017#\2401\240A\330\010\017\210y\230\001\230\024\230U\240#\240R\240q\340\010\017\210q";
static const char __pyx_k_3a_E_as_3b_AQa_r_AQ_S_E_as_Qc_1[] = "\200\001\330\004\020\220\001\330\004\007\200|\2203\220a\330\010\014\210E\220\025\220a\220s\230!\330\014\017\320\017\"\240!\2403\240b\250\001\330\020\034\230A\230Q\230a\330\020\021\330\010!\240\026\240r\320)<\270A\270Q\330\t\025\220S\230\001\330\010\014\210E\220\025\220a\220s\230!\330\014\017\320\017%\240Q\240c\250\022\2501\330\020\034\230A\230Q\230a\330\020\021\330\010!\240\026\240r\320)?\270q\300\001\330\004\013\2105\220\002\220*\230B\230l\250\"\250E\260\023\3204K\3102\310Q\330\004\013\210>\230\021\230!";
static const char __pyx_k_4A_D_6_9A_A_A_1_1_s_81D_1AQ_d_S[] = "\320\0044\260A\360\010\000\t\r\210D\320\020\"\240!\340\010\023\2206\230\021\230!\2309\240A\240\\\260\027\270\004\270A\340\010\030\320\030(\250\004\250A\330\010\023\2201\340\010\013\2101\330\014\017\210s\220!\2208\2301\230D\240\003\2401\240A\240Q\330\020!\240\021\240$\240d\250'\260\031\270#\270S\300\001\300\025\300c\310\021\310!\3101\330\020 \240\010\250\001\250\023\250A\250Q\330\020\033\2301\330\021\024\220A\220X\230Q\230d\240#\240Q\240a\240q\330\020!\240\021\240$\240d\250'\260\031\270#\270S\300\001\300\025\300c\310\021\310!\3101\330\020 \240\010\250\001\250\023\250A\250Q\340\010\017\210y\320\030)\250\021\250!\250?\270!\330*+\330*+\330*+\330*3\2601\330*6\260a\340\010\t\360\006\000\t\022\220\021\220$\220f\230A\230S\240\004\240E\250\025\250c\260\025\260a\260s\270#\270Q\330\010\014\210C\210u\220I\230Q\230a\330\014\r\210Y\220a\220q\230\005\230S\240\002\240\"\240E\250\021\330\010\017\210q";
static const char __pyx_k_4wgQa_4_1_q_HAT_2S_q_1_y_q_aq_a[] = "\320\004\032\230!\360\024\000\t\n\330\014\023\2204\220w\230g\240Q\240a\330\017\020\360\014\000\t\014\2104\320\017 \240\003\2401\330\014\023\220<\230q\330\010\014\210H\220A\220T\230\021\330\010\013\2102\210S\220\001\330\014\037\230q\330\014\"\240!\2401\330\014\020\220\007\220y\240\001\240\021\330\020 \240\007\240q\250\001\320)>\270a\270q\330\014\036\230a\230q\330\014\025\220\\\240\021\320\"6\260a\340\014\r\330\020\031\230\024\320\035-\250Q\330\023\024\330\020\031\230\024\230]\250!\330\010\017\210t\2207\230%\230q\240\010\250\001";
static const char __pyx_k_7qj_2Rr_Bb_AQ_a_AQ_4_1_AQ_A_q_q[] = "\320\004&\320&7\260q\360j\002\000\t\014\2102\210R\210r\220\023\220B\220b\230\001\330\014\022\220*\230A\230Q\340\010\013\210>\230\030\240\021\330!\"\330!)\250\030\260\021\330!\"\330!.\250a\330\014\022\220*\230A\230Q\340\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\024\220A\330\010\027\220q\330\010\027\220q\340\010\013\210>\230\025\230g\320%7\260q\360\006\000\r*\250\021\250$\250a\330*+\250:\260Q\330\014\022\220#\220_\320$C\3001\300A\330\014\031\230\021\330\014\034\230A\340\010\013\210>\230\025\230g\320%7\260q\360\006\000\r*\250\021\250$\250a\330*+\250:\260Q\330\014\022\220#\220_\320$C\3001\300A\330\014\031\230\021\330\014\034\230A\340\010\013\210>\230\025\230g\320%8\270\001\360\006\000\r.\250Q\250d\260!\330./\250z\270\021\330\014\022\220#\220_\320$C\3001\300A\330\014\031\230\021\330\014\034\230A\340\010\013\210>\230\024\230W\240N\260-\270q\360\010\000\r\021\220\005\220U\230!\2304\230z\250\021\330\020\034\230D\240\n\250!\2501\340\020\030\230\001\360\010\000\021\024\2209\230A\360\006\000\025\030\220~\240U\250,\260n\300A\330\030!\240\023\240B\240a\330\030(\250\001\330\0340\260\003\2603\260d\270%\270u\300A\300Q\300a\300q\360\006\000\025\030\220~\240U\250-\260~\300Q\330\030!\240\023\240B\240a\330\030(\250\001\330\0341\260\023\260C\260t\2705\300\005\300Q\300a\300q\310\001\360\n\000\025\036\230R\230y\250\001\330\024$\240A\330\030+\2503\250c\260\024\260U\270%\270q\300\001\300\021\300!\360\006\000\021\026\220S\230\006\230a\340\024*\250!\2504\250q\330+,\250A\330+.\250c\260\023\260A\340\024\032\230#\230Q\330\0307\260q\270\001\330\024!\240\021\340\010\013\210:\220S\230\001\340\014\023\2201\340\010\017\320\017)\250\021\250&\260\001\260\021\330*+\330*+";
static const char __pyx_k_9_T_Qa_1_aq_G9L_l_1_q__AWIQa_AW[] = "\320\004'\320'9\270\021\360\022\000\t\026\220T\230\034\240Q\240a\330\010\027\320\027:\270!\330\014\020\220\001\330\014\r\330\010\013\210=\230\003\2301\330\014\022\220,\230a\230q\330\010\021\220\021\330\010\014\210G\2209\230L\250\001\330\014\026\220l\240(\250!\2501\330\014\017\210q\330\020\021\330\024\030\230\t\240\021\240.\260\001\260\027\270\t\300\021\300!\330\024\030\230\t\240\021\240.\260\001\260\027\270\t\300\021\300!\340\020\035\230_\250A\250W\260I\270Q\270a\330\035,\250A\250W\260I\270Q\270a\330\014\027\220w\230a\330\027\036\230a\330\027\036\230a\330\014\022\220'\230\022\230>\250\033\260L\300\001\330\010+\2501\250A\330\010\017\210q";
static const char __pyx_k_A6_Kq_T_Kq_d_E_aq_Q_3k_G3a_1_Qc[] = "\200A\3606\000\t\r\210K\220q\330\014\025\220T\230\037\250\001\330\014\r\340\010\014\210K\220q\330\014\030\230\001\330\014\r\340\010\016\210d\320\022\"\240/\260\021\330\010\014\210E\220\025\220a\220q\330\014\022\220#\220Q\340\010\013\2103\210k\230\021\230\"\230G\2403\240a\330\014\023\2201\340\010\021\220\034\230Q\230c\240\033\250A\250T\260\021\260!\330\036\037\230t\320#3\2601\340\010\013\2107\220#\220Q\330\014\020\220\007\220v\230Q\230j\250\001\330\014\020\320\020.\250a\340\010\017\210q";
static const char __pyx_k_AQj_b_RvS_1_1_1A_Rq_A_A_1A_3a_b[] = "\200\001\330\004\t\210\021\330\004\014\210A\210Q\210j\230\002\230!\330\004\010\210\010\220\006\220b\230\001\330\010\030\230\005\230R\230v\240S\250\001\330\010\013\210=\230\003\2301\330\014\033\2301\330\010\n\210'\220\021\220!\2201\220A\330\010\030\230\005\230R\230q\330\010\013\210>\230\023\230A\330\014\034\230A\330\010\n\210'\220\021\220!\2201\220A\330\004\007\200|\2203\220a\330\010\020\220\006\220b\230\002\230\"\230B\230b\240\006\240b\250\001\330\010\017\210q\330\010\014\210E\220\025\220a\220q\330\014\020\220\006\220c\230\025\230c\240\024\240S\250\001\330\020\022\220!\2205\230\001\230\022\2301\230A\330\004\013\2102\210R\210q";
static const char __pyx_k_A_1_4A_31_2_B_4_1_AQ_q_q_4wgQ_A[] = "\200A\340$+\2501\330-4\260A\330,3\2601\330+2\260!\330\r\016\360B\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\020\320\020'\240q\330\020/\250q\330\010\t\330\014\023\2204\220w\230g\240Q\320&<\270A\330\017\020\360\006\000\t\022\220\035\230a\230w\240a\330\010\017\210t\2207\230%\230q\240\010\320(>\270a";
static const char __pyx_k_A_1_Q_4_1_AQ_at1_F_1AQ_9IQa_5_q[] = "\200A\330,-\330./\330'(\360\020\000\t,\2501\330\010-\250Q\340\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\014\320\014\036\230a\230t\2401\330\010\013\210>\230\027\240\001\330\014!\240\033\250F\260!\2601\260A\260Q\330\014\020\220\003\2209\230I\240Q\240a\330\020\"\240!\2405\250\017\260q\270\007\270q\300\001\330\010\013\320\013\033\2307\240!\330\014#\240;\250f\260A\260Q\260a\260q\330\014\020\220\003\2209\230I\240Q\240a\330\020$\240A\240U\250/\270\021\270'\300\021\300!\330\010\013\2101\330\014\025\220Q\220d\320\032,\250A\330\010\026\220a\220t\2301\330\027\030\330\027\030\330\010\032\230!\2304\230q\330\010\037\230q\240\004\240A\330\010\013\320\013\036\230c\240\021\330\014\020\220\001\220\021\330\010\013\320\013 \240\003\2401\330\014\020\220\001\220\021\330\010\014\210G\2206\230\021\230(\240!";
static const char __pyx_k_A_4AN_4_5_50A_A_AQ_t9Cs_y_1_1_1[] = "\200A\340-4\260A\360N\001\000\t)\250\001\340\010\013\2104\320\017 \240\003\2405\250\003\2505\3200A\300\023\300A\330\014\022\220*\230A\230Q\340\010\t\330\014\017\210t\2209\230C\230s\240%\240y\260\001\330\020\023\2201\330\024\033\2301\340\024\033\2301\330\017\020\360\006\000\t\014\2101\330\014\025\320\025'\240q\250\004\250A\330(-\250Q\330()\250\021\330()\250\034\260Q\340\014\025\320\025'\240q\250\004\250A\330(-\250Q\330()\250\037\270\006\270a\340\010\013\210:\220Q\220h\230c\240\021\330\014\022\220*\230A\230Q\360\006\000\t\014\210:\220Q\220h\230c\240\021\330\014\022\220,\230a\230q\360\006\000\t\017\210d\220!\2201\340\010\013\2101\330\014\017\210t\2201\330\020\027\220q\340\020\023\220;\230c\240\021\330\024\032\230*\240A\240Q\330\020\026\320\026.\250a\250q\330\020\"\240!\2401\340\010\017\210q";
static const char __pyx_k_A_4_1_AQ_6_Ba_D_T_1_AQ_at1_1AWA[] = "\200A\360\036\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\013\2106\220\023\220B\220a\220}\240D\250\005\250T\260\032\2701\330\014\022\220*\230A\230Q\330\010\022\220,\230a\230t\2401\330\010\022\220)\2301\230A\230W\240A\330\010\016\210f\220C\220q\330\010\014\210G\2209\230A\230Q\230g\240Q\330\014\017\210w\320\026'\240q\250\001\330\020\030\230\002\230#\230Q\330\014\023\2201\330\014\017\210t\2202\220R\220s\230!\330\020\027\220w\230a\230q\330\020\026\220f\230C\230q\330\010\013\2101\330\014\023\2207\230!\2301\330\010\014\210G\2209\230B\230b\240\007\240q\330\014\023\2207\230!\2307\240.\260\001\260\021\330\010\014\210G\2209\230B\230b\240\007\240q\330\014\023\2207\230!\2307\240-\250q\260\001\330\010 \240\001\240\021\330\010\017\320\017!\240\021\240!";
static const char __pyx_k_A_4_1_AQ_D_A_ARt5_Qc_4DATI_6_Bb[] = "\200A\330 *\250!\360$\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\014\210D\220\n\230!\330\010\013\210>\230\023\230A\330\014\034\230A\230R\230t\2405\250\005\250Q\250c\260\023\3204D\300A\300T\320I[\320[\\\340\010\013\2106\220\023\220B\220b\230\003\2305\240\001\240\024\240T\250\025\250a\330\014\022\220*\230A\230Q\340\010\013\2102\210S\220\001\320\021!\240\021\240$\320&8\270\001\330\021\025\220U\230!\330\014\022\220*\230A\230Q\360\010\000\t.\250Q\340\010'\240q\340\010\031\230\032\2406\250\021\250!\2501\250A\330\010\014\210E\220\025\220a\220q\330\014\032\230!\2305\240\010\250\002\250#\320-@\300\001\330\010\023\2203\220a\220q\230\002\230#\230^\2504\250u\260E\270\021\270!\330\010\027\220z\240\021\240$\240a\330\"2\260$\260a\330\010\014\210A\210Q\330\010\025\220T\230\032\2401\240A\330\010\022\320\022&\240a\240q\330\010\022\220)\2301\230D\240\005\240S\250\002\250!\330\010\017\210q";
static const char __pyx_k_A_4_1_AQ_Qd_AQ_7_Q_aq_QoQ_M_8_5[] = "\200A\360@\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\021\320\021%\240Q\240d\320*<\270A\270Q\330\010\013\2107\220#\220Q\330\014\022\220,\230a\230q\340\010\013\210:\220Q\220o\240Q\330\014\034\230M\250\021\340\010\027\320\0278\270\001\270\021\330\010\013\2105\220\002\220#\320\025%\240Q\330\014\022\220*\230A\320\035g\320gu\320uv\340\010\021\320\021+\2501\250J\260o\300Q\330\010\013\2107\220#\220Q\330\014\022\220,\230a\230q\340\010\016\210a\330\010\013\2106\220\021\220#\220S\230\001\330\014\021\220\024\220Z\230q\240\001\330\014\016\320\016\"\240!\2406\250\021\250!\330\014\016\210i\220q\230\004\230E\240\023\240B\240a\330\014\017\210w\220a\220q\330\010\013\2106\220\021\220#\220S\230\001\330\014\021\220\024\220Z\230q\240\001\330\014\016\320\016\"\240!\2406\250\021\250!\330\014\016\210i\220q\230\004\230E\240\023\240B\240a\330\014\017\210w\220a\220q\340\010\034\230A\230Q\330\010\017\210q";
static const char __pyx_k_A_4_5_50A_A_AQ_1D_Q_Ql_Q_Q_Qa_1[] = "\200A\360*\000\t)\250\001\340\010\013\2104\320\017 \240\003\2405\250\003\2505\3200A\300\023\300A\330\014\022\220*\230A\230Q\340\010#\2401\240D\250\001\330$)\250\021\330$%\240Q\330$%\340\010\013\320\013\035\230Q\230l\250#\250Q\330\014\025\220Q\340\014\025\320\025-\250Q\250a\330\010\032\230!\2301\330\010\017\210q";
static const char __pyx_k_A_4_Q_AQ_6a_AT_j_1A_y_U_Rq_e1_q[] = "\200A\360\034\000\t\014\2104\210~\230Q\330\014\022\220*\230A\230Q\340\0106\260a\360\006\000\t!\240\014\250A\250T\260\021\330\010\022\220$\220j\240\001\240\021\330\010\017\320\017#\2401\240A\330\010\017\210y\230\001\230\024\230U\240#\240R\240q\330\010\017\320\017\037\230{\250$\250e\2601\330\037*\250!\330\037*\250!\330\010\017\210q";
static const char __pyx_k_A_4q_1_E_fAQ_e1_aq_7q_CuIQa_Yaq[] = "\200A\360\010\000\t\014\2104\210q\330\014\022\320\022\"\240!\2401\340\010\014\210E\220\021\220$\320\026(\250\001\330\010\021\220\021\220$\220f\230A\230Q\330\022\026\220e\2301\320\034.\250a\250q\330/7\260q\330\010\014\210C\210u\220I\230Q\230a\330\014\r\210Y\220a\220q\230\005\230S\240\002\240\"\240E\250\021\330\010\017\210q";
static const char __pyx_k_A_4t7_7_wa_1D_G1_1_D_vU_U_4q_AQ[] = "\200A\360\036\000\t\014\2104\210t\2207\230!\330\014\020\220\003\2207\230!\330\r\021\320\021'\240w\250a\330\014\020\320\020#\2401\240D\250\001\330\r\021\220\030\230\023\230G\2401\330\014\020\320\020#\2401\330\014\020\220\n\230(\240\"\240D\250\010\260\001\260\026\260v\270U\300!\330\014\r\210U\220!\2204\220q\340\014\022\220*\230A\230Q";
static const char __pyx_k_A_4t_Q_AQ_at3Fa_at3Fa_q_q_aq_aq[] = "\200A\360\024\000\t\014\2104\210t\320\023%\240Q\330\014\022\220*\230A\230Q\360\020\000\t\026\320\025.\250a\250t\3203F\300a\330\010\025\320\025.\250a\250t\3203F\300a\340\010\023\220=\240\001\240\026\240q\330\010\023\220=\240\001\240\026\240q\330\010\020\320\020&\240a\240q\330\010\020\320\020&\240a\240q\330\010\020\220\n\230!";
static const char __pyx_k_A_A_a_H_7_A_AQ_4_1_AQ_hj_AQ_7_Q[] = "\200A\360\006\000\026-\250A\330\031\036\230a\330\r\016\360H\001\000\t\014\2107\220\"\220A\330\014\022\220*\230A\230Q\340\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\013\210;\220h\230j\250\001\330\014\022\220*\230A\230Q\340\010\013\2107\220#\220Q\330\014\025\220Q\340\014\025\220V\2306\240\021\340\010\013\210;\220c\230\031\240#\240W\250C\250q\330\014\023\2204\320\027'\240q\250\010\260\001\340\010\013\2107\220#\220Q\330\014\023\2204\320\027)\250\021\250!\330\010\013\2107\220#\220Q\330\014\023\2204\220|\2401\240A\330\010\013\2107\220#\220Q\330\014\023\2204\220~\240Q\240a\340\010\016\210j\230\001\230\021";
static const char __pyx_k_A_CuspNeighborhood_object_repre[] = "\n    A CuspNeighborhood object represents an equivariant collection of\n    disjoint horoballs that project to cusp neighborhoods.\n\n    Instantiate as M.cusp_neighborhood()\n    ";
static const char __pyx_k_A_DirichletDomain_object_repres[] = "\n    A DirichletDomain object represents a Dirichlet Domain of\n    a hyperbolic manifold, typically centered at a point which\n    is a local maximum of injectivity radius.  It will have ideal\n    vertices if the manifold is not closed.\n\n    Instantiate as M.dirichlet_domain()\n    where M is a Manifold to\n    obtain a Dirichlet Domain centered at a point which maximizes\n    injectivity radius.\n\n    Other options can be provided to customize the computation, with\n    the default values shown here\n\n    >>> M = Manifold('m003(3,-4)')\n    >>> M.dirichlet_domain(vertex_epsilon=10.0**-8, displacement = [0.0, 0.0, 0.0], centroid_at_origin=True, maximize_injectivity_radius=True)\n    40 finite vertices, 0 ideal vertices; 60 edges; 22 faces\n\n    You can also create a Dirichlet Domain from a file listing matrix\n    generators for the group, in SnapPea's \"% Generator\" format, via\n\n    >>> D = DirichletDomain(generator_file='test.gens') # doctest: +SKIP\n\n    Or from matrices:\n\n    >>> G = Manifold('m004').fundamental_group(False)\n    >>> matrices = [ G.O31('a'), G.O31('b'), G.O31('c') ] # Note: some of the matrices contain (near) 0 entries and thus this tests that Object2Real converts small numbers fromatted by pari as \"1.0 E-10\" (note the pace before \"E\") correctly when not in SageMath.\n    >>> DirichletDomain(O31_generators = matrices,\n    ...                 maximize_injectivity_radius = False)\n    8 finite vertices, 2 ideal vertices; 20 edges; 12 faces\n\n    The group elements for the face-pairings of the Dirichlet domain\n    can be given as words in the original generators by setting\n    ``include_words = True``.\n\n    ";
static const char __pyx_k_A_FundamentalGroup_represents_a[] = "\n    A FundamentalGroup represents a presentation of the fundamental\n    group of a SnapPea Triangulation.  Group elements are described as\n    words in the generators a,b,..., where the inverse of a is denoted\n    A.  Words are represented by Python strings (and the concatenation\n    operator is named \"+\", according to Python conventions).\n\n    Instantiate as T.fundamental_group(), where T is a Triangulation.\n\n    Methods:\n        num_generators() --> number of generators\n        num_relators()   --> number of relators\n        generators()     --> list of generators\n        relators()       --> list of relators\n        meridian(n)      --> word representing the meridian on cusp #n\n        longitude(n)     --> word representing the longitude on cusp #n\n    ";
static const char __pyx_k_A_L_t_6_A_at_B_PQQR_wc_vQ_Qd_1N[] = "\200A\360\016\000\t\025\220L\240\001\240\026\240t\250?\270!\330\010\021\320\021!\240\021\240!\360\006\000\t\014\2106\220\023\220A\330\014\025\320\025&\240a\240t\320+B\300(\310&\320PQ\320QR\330\014\017\210w\220c\230\021\330\020\027\220v\230Q\330\024\025\220Q\220d\230)\2401\240N\260!\2601\260G\2701\270B\270a\270q\330\026\032\230%\230u\240A\240T\250\024\250U\260%\260q\270\001\330\r\023\2203\220a\330\014\025\320\025&\240a\240t\320+B\300(\310#\310Q\330\014\017\210w\220c\230\021\330\020\027\220v\230Q\330\024\025\220Q\220d\230)\2401\240K\250q\260\006\260a\260q\270\002\270!\2701\330\026\032\230%\230u\240A\240T\250\024\250U\260%\260q\270\001\340\014\023\2201";
static const char __pyx_k_A_Q_1_Cq_1_AQ_E_at_0_6_9AYaxq_q[] = "\200A\360\032\000\t\014\210?\230#\230Q\330\014\023\2201\330\r\034\230C\230q\330\014\023\2201\340\014\022\220*\230A\230Q\330\010\021\220\021\330\010\014\210E\220\025\220a\220t\230?\250!\330\014\031\230\021\230$\320\0360\260\003\2606\270\021\330\032\033\2309\240A\240Y\250a\250x\260q\270\001\330\032\033\230<\240q\250\014\260A\260\\\300\021\300!\330\032\033\2301\330\014\022\220'\230\021\230&\240\001\240\034\250Q\250i\260q\330\010\017\210q";
static const char __pyx_k_A_Qc_4z_81D_2Rq_HBa_2Rt1_a_4waq[] = "\200A\360\006\000\t\014\210:\220Q\220c\230\021\330\014\023\2204\220z\240\021\240!\2408\2501\250D\260\001\330\010\013\2102\210R\210q\330\014\020\220\004\220H\230B\230a\330\010\013\2102\210R\210t\2201\330\014\026\220a\330\014\033\2304\230w\240a\240q\330\r\017\210r\220\024\220]\240\"\240D\250\001\330\014\026\220a\330\014\033\2302\230R\230t\2401\330\r\017\210r\220\024\220]\240\"\240D\250\014\260B\260d\270!\330\014\026\220a\330\014\033\2302\230R\230t\240=\260\002\260$\260a\330\016\022\220/\240\023\240M\260\026\260q\270\001\330\016\023\2202\220R\220t\230=\250\002\250$\250l\270!\330\023\027\220~\240R\240t\2501\330\014\034\230B\230b\240\004\240M\260\022\2604\260q\330\034\036\230d\240!\340\014\022\220$\220a\220q\330\014\023\2204\220r\230\023\230B\230b\240\002\240#\240Q\240f\250B\250a\330\014\026\220k\240\022\2401\330\014\r\330\020\033\2304\230\177\250l\270!\2708\3005\310\001\330\020\"\320\"@\300\001\300\021\340\020\026\220g\230Q\230a\330/1\260\021\330\014\025\220X\230Q\230e\2401\330\014\022\320\022&\240a\240q\330\014\023\2201\360\006\000\r\023\220*\230A\230Q\330\010\032\320\0321\260\021\330\014\020\220\007\220y\240\004\320$4\260A\330\010\013\320\013\033\2303\230a\330\014\021\220\021\220)\2301\330\014\022\220,\230a\230q\330\010\021\220\030\230\021\230%\230q\330\010\016\320\016\"\240!\2401\330\010\017\210q";
static const char __pyx_k_A_Qc_4z_81D_9G3d_5_6_1_s_T_9_AQ[] = "\200A\360\006\000\t\014\210:\220Q\220c\230\021\330\014\023\2204\220z\240\021\240!\2408\2501\250D\260\001\330\010\013\2109\220G\2303\230d\320\";\2705\300\001\300\022\3006\310\021\330\010\032\320\0321\260\021\330\014\020\220\007\220s\230!\230:\240T\320)9\270\023\270A\270Q\330\010\013\320\013\033\2303\230a\330\014\021\220\021\220)\2301\330\014\022\220,\230a\230q\330\010\021\220\035\230a\230u\240A\330\010\016\320\016\"\240!\2401\330\010\016\210j\230\002\230#\230Q\230d\240#\240Q\240a\330\010\017\210v\320\025/\250q";
static const char __pyx_k_A_Qc_4z_81D_A_U_3a_6_as_Q_0_9Cs[] = "\200A\330\010\013\210:\220Q\220c\230\021\330\014\023\2204\220z\240\021\240!\2408\2501\250D\260\001\340\014\024\220A\330\014\020\220\005\220U\230!\2303\230a\330\020\023\2206\230\022\320\033.\250a\250s\260#\260Q\330\024\035\320\0350\260\001\260\021\330\024\025\340\024\033\2309\240C\240s\250\"\250B\250f\260B\260a\330\024\025\330\014\017\210q\330\020\032\320\032+\2502\250Q\330\020\021\330\024\037\230t\240=\260\014\270A\270X\300U\310!\330\024&\320&D\300A\300Q\340\024\032\230'\240\021\320\"F\300b\310\001\330\020\031\230\035\240a\240q\330\020\026\320\026*\250!\2501\330\020\026\220i\230q\240\001\330\020\027\220v\320\0357\260q\340\020\026\220j\240\001\240\021";
static const char __pyx_k_A_Qc_4z_81D_E_at_A_Jat_q_WBa_wb[] = "\200A\330\010\013\210:\220Q\220c\230\021\330\014\023\2204\220z\240\021\240!\2408\2501\250D\260\001\330\010\021\220\021\330\010\014\210E\220\025\220a\220t\230?\250\"\250A\330\014\020\220\004\220J\230a\230t\240<\250q\260\001\330\014\025\220W\230B\230a\330\014\017\210w\220b\230\001\330\020\024\220B\220b\230\007\230r\240\022\2402\240Q\330\020\033\230>\250\023\250D\260\r\270S\300\001\330\020\023\2204\220|\2402\240Q\330\024\033\230;\240c\250\023\250D\260\r\270Q\340\024\033\2308\2403\240c\250\021\330\020\032\320\032,\250B\250a\330\020\021\330\024\037\230t\240>\260\034\270Q\270h\300e\3101\330\024&\320&D\300A\300Q\340\024\032\230'\240\021\240!\330+-\250Q\330\020\031\230\035\240a\240q\330\020\026\320\026*\250!\2501\330\020\026\220i\230q\240\001\330\020\027\220v\320\0357\260q";
static const char __pyx_k_A_T_Qa_7q_q_A_aq_G9M_q_t9A_1D_t[] = "\320\004\037\320\037/\250}\270A\330!\"\360\024\000\t\026\220T\230\034\240Q\240a\330\010\030\320\0307\260q\330\014\020\220\001\330\014\r\330\014\r\330\014\027\220q\230\001\330\010\013\210>\230\023\230A\330\014\022\220,\230a\230q\330\010\021\220\021\330\010\014\210G\2209\230M\250\021\330\014\023\220=\240\t\250\021\250!\330\014\017\210q\330\020\021\330\024\037\230t\2409\250A\250^\2701\270D\300\001\330\024\037\230t\2409\250A\250[\270\001\270\024\270Q\330\024\037\230t\2401\340\020\030\230\013\240?\260!\2604\260q\330\030#\240:\250Q\250d\260!\330\030#\2404\240q\330\014\022\220'\230\021\230!\330\010,\250A\250Q\330\010\017\210q";
static const char __pyx_k_A_WA_c_ir_5_A_2T_d_q_3b_3b_Ct9D[] = "\200A\360\014\000\t\026\220W\230A\330\010\016\210c\220\021\220$\220i\230r\240\021\330\014\020\220\003\2205\230\004\230A\330\020\021\330\014\032\230!\2302\230T\240\025\240d\250-\260q\270\003\2703\270b\300\003\3003\300b\310\001\310\021\330\014\032\230\"\230C\230t\2409\250D\260\002\260\"\260D\270\001\330\033\037\230u\240D\250\r\260Q\260a\330\014\023\2204\220q\230\002\230!\330\014\020\220\005\220Q\330\020\024\220D\230\001\230\024\230Q\230b\240\001\360\006\000\021\025\220C\220x\230q\330\024\032\230\"\230A\330\024\033\2304\230y\250\004\250A\250T\260\021\330\024\030\230\005\230Q\230d\240%\240r\250\021\250!\2501\330\014\020\220\r\230T\240\021\240!";
static const char __pyx_k_A_q_4_1_AQ_gQ_A_D_G6_3a_j_q_A_S[] = "\200A\330)?\270q\360$\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\013\210;\220g\230Q\330\014\031\230\033\240A\330\020\034\230D\240\n\250!\330\020\021\340\010\014\210G\2206\230\021\230(\240!\330\010\013\320\013\033\2303\230a\330\014\017\210{\230'\240\021\330\020\026\220j\240\001\240\021\340\014'\240q\250\004\250A\330\014\r\330\r\035\230S\240\001\330\014\017\210q\330\020\033\230?\250&\260\001\260\024\260Z\270s\300!\33012\330\020+\2501\250D\3200B\300!\330\020\027\220q\330\020\024\220E\230\025\230a\230t\240:\250Q\330\024\030\230\007\230q\240\002\240\"\240H\250A\250R\250q\260\002\260!\2604\260x\270q\300\002\300!\3002\300Q\300a\330\"$\240H\250A\250R\250q\260\002\260!\2604\260x\270q\300\002\300!\3002\300Q\300a\330\020\024\220A\220Q\330\020\027\220q\340\020!\240\021\240$\240a\330\r\030\230\007\230q\330\014\026\220l\240!\330\014\017\210t\2201\330\014\017\210t\2201\330\014\017\210q\220\001\220\022\2202\220Q\220a\220r\230\023\230B\230e\2404\240~\260S\270\003\2701\270A\270R\270r\300\021\300!\3002\300T\310\021\330\020\023\2204\220~\240Q\330\024\032\230*\240A\240Q\360\006\000\025\033\230*\240A\240Q\340\014\017\210x\220s\230$\230j\250\001\250\033\260A\260Q\330\020\023\2202\220S\230\002\230#\230R\230s\240!\330\024\032\230*\240A\240Q\360\006\000\r\030\220\177\240f\250A\250T\260\032\2703\270a\330-.\340\014\020\220\005\220U\230!\2304\230z\250\021\330\020\024\220B\220e\2302\230R\230t\2402\240T\250\022\2504\250r\260\021\330\024\034\230A\230R\230q\240\002\240!\2405\250\005\250R\250s\260'\270\021\340\014\024\220A\220[\240\001\240\022\2401\240E\250\021\330\014\024\220A\220[\240\001\240\022\2401\240E\250\021\330\014\024\220A\220[\240\001\240\022\2401\240E\250\021\330\014\024\220A\220[\240\001\240\022\2401\240E\250\021\330\014\017\210t\220>\240\021\330\020\031\320\0311\260\021\260$\3206H\310\001\340\020\031\320\031?\270q\330\024\030\320\030*\250!\330\014\020\220\001\220\021\330\014\017\210w\220c\230\021\330\020\026\220j\240\001\240\021\3309;\2702\270R\270q\360""\006\000\r\020\210t\220:\230S\240\003\2402\240T\250\023\250A\320->\270c\300\021\330\020\024\320\024*\250!\320+<\270A\330\020\021\330\014\017\210s\220!\320\023$\240B\240d\250*\260A\330\020\026\220j\240\001\240\021\360\006\000\r\030\220\177\240f\250A\250T\260\032\2703\270a\330-.\340\014\020\220\005\220U\230!\2304\230z\250\021\330\020\024\220C\220u\230B\230c\240\025\240c\250\025\250c\260\025\260c\270\021\330\024\034\230A\230R\230q\240\002\240!\2405\250\005\250R\250s\260'\270\021\340\014\020\220\003\2209\230I\240Q\240a\340\020\032\230,\240a\330\020\023\2204\220q\330\020\023\2204\220q\330\020\023\2201\220A\220R\220r\230\021\230!\2302\230S\240\002\240%\240t\250>\270\023\270C\270q\300\001\300\022\3002\300Q\300a\300r\310\024\310Q\330\024\027\220t\230>\250\021\330\030\034\230A\230Q\330\030\036\230j\250\001\250\021\360\006\000\031\035\230A\230Q\330\030\036\230j\250\001\250\021\360\006\000\021\024\2208\2303\230d\240*\250A\250R\250q\260\001\330\024\027\220r\230\023\230B\230c\240\022\2403\240a\330\030\034\230A\230Q\330\030\036\230j\250\001\250\021\360\006\000\021\031\230\001\230\022\2301\230B\230a\230u\240A\330\020\030\230\001\230\022\2301\230B\230a\230u\240A\330\020\030\230\001\230\022\2301\230B\230a\230u\240A\330\020\030\230\001\230\022\2301\230B\230a\230u\240A\340\014\017\210t\220>\240\021\330\020\031\320\0311\260\021\260$\3206H\310\001\340\020\031\320\031?\270q\330\024\030\320\030*\250!\330\014\020\220\001\220\021\330\014\017\210w\220c\230\021\330\020\026\220j\240\001\320!M\310Q\330!\"";
static const char __pyx_k_A_q_A_at1_Qd_d_d_d_Qd_T_U_1_WAT[] = "\200A\340\010\037\230q\240\004\240A\330\010\036\230a\230t\2401\330\010\025\220Q\220d\230!\330\010\017\210\177\230d\240!\330\010\016\210d\320\022\"\240/\260\021\330\010\016\210d\220#\220Q\220d\320\032*\250!\330\014\033\320\033-\250T\260\021\330\014\020\220\005\220U\230!\2301\330\020\035\230W\240A\240T\250\031\260!\260;\270a\270v\300S\310\005\310Q\310a\330\020%\240Q\330\020\024\220E\230\025\230a\230q\330\024\027\220r\230\023\230A\330\030*\250'\260\021\260$\260i\270q\330\034'\240q\250\006\250c\260\036\270|\3101\310B\310a\310q\340\030*\250'\260\021\260!\330\020\037\230w\240a\240q\330\014\021\220\027\230\001\230\021\330\014\030\230\007\230q\240\001\330\014\022\220#\220Q\340\010\033\2301\230D\240\001\330\010\017\210w\220a";
static const char __pyx_k_A_s_is_specified_by_a_string_or[] = "\n    A %s is specified by a string or a byte sequence, according to the\n    conventions detailed in its docstring.\n    ";
static const char __pyx_k_AbelianGroup___reduce___line_82[] = "AbelianGroup.__reduce__ (line 82)";
static const char __pyx_k_Add_a_possibly_degenerate_hyper[] = "\n        Add a (possibly degenerate) hyperbolic structure, turning the\n        :class:`Triangulation` into a :class:`Manifold`.\n\n        >>> M = Triangulation('m004')\n        >>> N = M.with_hyperbolic_structure()\n        >>> N.volume() # doctest: +NUMERIC6\n        2.02988321\n        ";
static const char __pyx_k_Base_class_for_Iterators_Sequen[] = "\n    Base class for Iterators/Sequences for manifolds in the SnapPea\n    Cusped Census.\n    ";
static const char __pyx_k_Base_class_for_manifold_Iterato[] = "\n    Base class for manifold Iterators/Sequences.\n    ";
static const char __pyx_k_Bb_3a_Q_Cq_Q_X_0_q_2Q_aq_Qa_wav[] = "\200\001\330\004\014\210B\210b\220\013\2303\230a\330\004\r\210Q\330\004\010\210\014\220C\220q\330\014\020\220\n\230#\230Q\330\014\020\220\002\220#\220X\320\0350\260\001\260\021\330\010\021\220\021\220\"\320\024'\240q\250\013\2602\260Q\330\010\031\230\025\230a\230q\330\010\017\320\017 \240\005\240Q\240a\330\010\021\220\026\220w\230a\230v\240R\240v\250Q\330\n\026\220c\230\021\330\n\016\210j\230\003\2301\330\n\016\210b\220\003\2208\320\0331\260\021\260!\330\010\021\220\022\2202\320\025+\2501\250K\260r\270\021\330\010\034\230E\240\021\240!\330\010\017\320\017#\2405\250\001\250\024\250Q\250a\330\010\021\220\026\220w\230a\230v\240S\250\004\250A\250T\260\021\340\010\016\210j\230\001\230\021\360\010\000\005\n\210\037\230\001\230\030\240\033\250A\330\004\013\2101";
static const char __pyx_k_Byte_encoding_requires_complete[] = "Byte encoding requires complete cusps.";
static const char __pyx_k_CCuspNeighborhood_triangulation[] = "CCuspNeighborhood.triangulation";
static const char __pyx_k_CCuspNeighborhood_view_line_289[] = "CCuspNeighborhood.view (line 289)";
static const char __pyx_k_CDirichletDomain__edge_to_index[] = "CDirichletDomain._edge_to_index_dict";
static const char __pyx_k_CFundamentalGroup_generators_in[] = "CFundamentalGroup.generators_in_originals";
static const char __pyx_k_CFundamentalGroup_meridian_line[] = "CFundamentalGroup.meridian (line 306)";
static const char __pyx_k_Can_t_compare_triangulations_of[] = "Can't compare triangulations of manifolds with Dehn fillings.";
static const char __pyx_k_ClosedNonorientableDistinct_txt[] = "ClosedNonorientableDistinct.txt";
static const char __pyx_k_Communication_with_PLink_failed[] = "Communication with PLink failed.";
static const char __pyx_k_Constructs_a_reasonable_selecti[] = "\n        Constructs a *reasonable* selection of simple closed curves in\n        a manifold's dual 1-skeleton.  In particular, it returns those\n        that appear to represent geodesics. The resulting curves can\n        be drilled out.\n\n        >>> M = Manifold('m015')\n        >>> curves = M.dual_curves()\n        >>> curves # doctest: +NUMERIC6\n        [  0: orientation-preserving curve of length 0.56239915 - 2.81543089*I,\n           1: orientation-preserving curve of length 1.12479830 + 0.65232354*I,\n           2: orientation-preserving curve of length 1.26080402 + 1.97804689*I,\n           3: orientation-preserving curve of length 1.58826933 + 1.67347167*I,\n           4: orientation-preserving curve of length 1.68719745 + 2.81543089*I]\n\n        Each curve is returned as an info object with these keys\n\n        >>> sorted(curves[0].keys())\n        ['complete_length', 'filled_length', 'index', 'max_segments', 'parity']\n\n        We can drill out any of these curves to get a new manifold\n        with one more cusp.\n\n        >>> N = M.drill(curves[0])\n        >>> (M.num_cusps(), N.num_cusps())\n        (1, 2)\n\n        By default, this function only finds curves of length 6; this\n        can be changed by specifying the optional argument\n        max_segments\n\n        >>> M.dual_curves(max_segments=2) # doctest: +NUMERIC6\n        [  0: orientation-preserving curve of length 0.56239915 - 2.81543089*I]\n        ";
static const char __pyx_k_Cover_degree_should_be_at_least[] = "Cover degree should be at least 1";
static const char __pyx_k_Cover_specified_by_unrecognized[] = "Cover specified by unrecognized GAP type";
static const char __pyx_k_Create_a_3D_picture_of_the_horo[] = "\n        Create a 3D picture of the horoball packing.  One can specify\n        which cusp to put at infinity and how large of horoballs to\n        look at, e.g.\n\n        >>> M = Manifold('m125')\n        >>> C = M.cusp_neighborhood()\n        >>> C.view(which_cusp = 1, cutoff=0.2)   #doctest: +CYOPENGL\n        ";
static const char __pyx_k_Drills_out_the_specified_dual_c[] = "\n        Drills out the specified dual curve from among all dual curves\n        with at most max_segments, which defaults to 6. The method\n        dual_curve allows one to see the properties of curves before\n        choosing which one to drill out.\n\n        >>> M = Manifold('v3000')\n        >>> N = M.drill(0, max_segments=3)\n        >>> (M.num_cusps(), N.num_cusps())\n        (1, 2)\n        ";
static const char __pyx_k_Each_cusp_has_a_preferred_marki[] = "\n        Each cusp has a preferred marking. In the case of a torus\n        cusp, this is pair of essential simple curves meeting in one\n        point; equivalently, a basis of the first homology of the\n        boundary torus. These curves are called the meridian and the\n        longitude.\n\n        This method changes these markings in various ways.  In many\n        cases, if the flag return_matrices is True then it returns\n        a list of change-of-basis matrices is returned, one per\n        cusp, which will restore the original markings if passed\n        as peripheral_data.\n\n        - Make the shortest curves the meridians, and the second\n          shortest curves the longitudes.\n\n          >>> M = Manifold('5_2')\n          >>> M.cusp_info('shape') # doctest: +NUMERIC6\n          [-2.49024467 + 2.97944707*I]\n          >>> cob = M.set_peripheral_curves('shortest', return_matrices=True)\n          >>> M.cusp_info('shape') # doctest: +NUMERIC6\n          [-0.49024467 + 2.97944707*I]\n          >>> cob\n          [[[1, 0], [-2, 1]]]\n          >>> M.set_peripheral_curves(cob)\n          >>> M.cusp_info('shape') # doctest: +NUMERIC6\n          [-2.49024467 + 2.97944707*I]\n\n          You can also make just the meridians as short as\n          possible while fixing the longitudes via the option\n          'shortest_meridians', and conversely with\n          'shortest_longitudes'.\n\n        - If cusps are Dehn filled, make those curves meridians.\n\n          >>> M = Manifold('m125(0,0)(2,5)')\n          >>> M.set_peripheral_curves('fillings')\n          >>> M\n          m125(0,0)(1,0)\n\n        - Change the basis of a particular cusp, say the first one:\n\n          >>> M.set_peripheral_curves( [ (1,2), (1,3) ] , 0)\n\n          Here (1,2) is the new meridian written in the old basis, and\n          (1,3) the new longitude.\n\n        - Change the basis of all the cusps at once\n\n          >>> new_curves = [ [(1,-1), (1,0)],  [(3,2), (-2,-1)] ]""\n          >>> M.set_peripheral_curves(new_curves)\n          >>> M\n          m125(0,0)(-1,-2)\n        ";
static const char __pyx_k_Elementary_divisors_must_be_non[] = "Elementary divisors must be non-negative integers.\n";
static const char __pyx_k_Extend_the_Neumann_Zagier_matri[] = "\n        Extend the Neumann-Zagier matrix to one which is symplectic\n        (up to factors of 2) using oscillating curves, see\n        `Mathews and Purcell '22 <https://arxiv.org/abs/2208.06969>`_.\n        Only accepts triangulations with 1 cusp.\n\n          >>> M = Manifold(\"4_1\")\n          >>> M.symplectic_basis()\n          [-1  0 -1 -1]\n          [ 2  0 -2  0]\n          [-2 -1 -2 -1]\n          [ 0 -1 -2 -1]\n\n\n        :param verify: Explicitly test if the resulting matrix is symplectic.\n        ";
static const char __pyx_k_Failed_to_construct_permutation[] = "Failed to construct permutation representation.";
static const char __pyx_k_Fill_an_empty_manifold_from_a_b[] = "\n        Fill an empty manifold from a byte sequence generated by\n        _to_bytes.\n        >>> M = Manifold('m125')\n        >>> N = Manifold('empty')\n        >>> N._from_bytes(M._to_bytes())\n        >>> N.is_isometric_to(M)\n        True\n        ";
static const char __pyx_k_Fill_an_empty_triangulation_fro[] = "\n        Fill an empty triangulation from a byte sequence generated by\n        _to_bytes.\n        >>> M = Manifold('m125')\n        >>> seed = M._to_bytes()\n        >>> len(seed)\n        12\n        >>> N = Manifold('empty')\n        >>> N._from_bytes(seed)\n        >>> N == M\n        True\n        ";
static const char __pyx_k_For_a_Triangulation_that_descri[] = "\n        For a Triangulation that describes a closed manifold, returns\n        the unsimplified finite triangulation that the kernel builds.\n\n        >>> M = Triangulation('m004(1, 2)')\n        >>> F = M._unsimplified_filled_triangulation()\n        >>> F.num_tetrahedra(), F._num_fake_cusps()\n        (58, 7)\n\n        The default is to use the kernel's original fold method as\n        the final step to close off the cusp. Specifying\n        method='layered' uses a 1-tetrahedron solid torus instead.\n        For method='layered_and_marked', the core solid tori are marked\n        internally so that any calls to simplify/randomize will leave\n        these in place.\n\n        >>> M = Triangulation('m004(1, 2)')\n        >>> F = M._unsimplified_filled_triangulation(method='layered')\n        >>> F.num_tetrahedra(), F._num_fake_cusps()\n        (60, 7)\n        >>> F.simplify(); F.num_tetrahedra() < 15\n        True\n        >>> M = Triangulation('K8n1(1,0)')\n        >>> F = M._unsimplified_filled_triangulation(method='layered_and_marked')\n        >>> F.num_tetrahedra() > 2\n        True\n\n        You can determine which tets are the cores, and remove the\n        marks to allow unrestricted simplification.\n\n        >>> any(F._marked_tetrahedra(clear_marks=True))\n        True\n        >>> F.simplify()\n        >>> F.num_tetrahedra() <= 2\n        True\n        ";
static const char __pyx_k_For_a_non_orientable_Triangulat[] = "\n        For a non-orientable Triangulation, returns the 2-fold cover which\n        is orientable.\n\n        >>> X = Triangulation('x123')\n        >>> Y = X.orientation_cover()\n        >>> (X.is_orientable(), Y.is_orientable())\n        (False, True)\n        >>> Y\n        x123~(0,0)(0,0)\n        >>> Y.cover_info()['type']\n        'cyclic'\n        ";
static const char __pyx_k_Give_the_triangulation_a_new_na[] = "\n        Give the triangulation a new name.\n\n        >>> M = Triangulation('4_1')\n        >>> M.set_name('figure-eight-comp')\n        >>> M\n        figure-eight-comp(0,0)\n        ";
static const char __pyx_k_Gives_the_shapes_of_the_tetrahe[] = "\n        Gives the shapes of the tetrahedra in the current solution to\n        the gluing equations.  Returns a list containing one info object\n        for each tetrahedron.  The keys are:\n\n        - rect : the shape of the tetrahedron, as a point in the\n          complex plane.\n\n        - log : the log of the shape\n\n        - accuracies: a list of the approximate accuracies of the\n          shapes, in order (rect re, rect im, log re, log im)\n\n        If the optional variable 'part' is set to one of the above,\n        then the function returns only that component of the data.\n\n        If the flag 'fixed_alignment' is set to False, then the edges\n        used to report the shape parameters are chosen so as to\n        normalize the triangle.\n\n        >>> M = Manifold('m015')\n        >>> M.tetrahedra_shapes(part='rect') # doctest: +NUMERIC6\n        [0.66235898 + 0.56227951*I, 0.66235898 + 0.56227951*I, 0.66235898 + 0.56227951*I]\n        >>> M.tetrahedra_shapes() #doctest:+SKIP\n        [{'accuracies': (11, 11, 12, 11), 'log': -0.14059979 + 0.70385772*I, 'rect': 0.66235898 + 0.56227951*I},\n         {'accuracies': (11, 11, 11, 11), 'log': -0.14059979 + 0.70385772*I, 'rect': 0.66235898 + 0.56227951*I},\n         {'accuracies': (11, 11, 11, 11), 'log': -0.14059979 + 0.70385772*I, 'rect': 0.66235898 + 0.56227951*I}]\n        ";
static const char __pyx_k_Got_the_empty_link_from_PLink_a[] = "\nGot the empty link from PLink and so not changing the triangulation.\n";
static const char __pyx_k_Group_elements_which_pair_the_f[] = "\n        Group elements which pair the faces of this DirichletDomain\n        as words in the original generators:\n\n        >>> M = Manifold('m004')\n        >>> D = M.dirichlet_domain(include_words = True)\n        >>> sorted(D.pairing_words()) #doctest: +ELLIPSIS\n        ['A', ...]\n\n        Requires that DirichletDomain was computed with\n        include_words = True.\n        ";
static const char __pyx_k_If_the_SymmetryGroup_is_a_nontr[] = "\n        If the SymmetryGroup is a nontrivial direct product with at\n        least one nonabelian factor, return a pair of SymmetryGroups\n        consisting of the (two) factors.\n\n        >>> S = Manifold('s960').symmetry_group()\n        >>> S.direct_product_description()\n        (Z/4, D3)\n        ";
static const char __pyx_k_If_the_manifold_is_the_compleme[] = "\n        If the manifold is the complement of a two-bridge knot or link\n        in :math:`S^3`, then this method returns :math:`(p,q)` where\n        :math:`p/q` is the fraction describing the link.\n        Otherwise, returns ``False``.\n\n        >>> M = Manifold('m004')\n        >>> M.is_two_bridge()\n        (2, 5)\n        >>> M = Manifold('m016')\n        >>> M.is_two_bridge()\n        False\n\n        Note: An answer of ``True`` is rigorous, but not the answer\n        ``False``, as there could be numerical errors resulting in\n        finding an incorrect canonical triangulation.\n        ";
static const char __pyx_k_If_the_symmetry_group_is_abelia[] = "\n        If the symmetry group is abelian, return it as an AbelianGroup\n\n        >>> S = Manifold('v3379').symmetry_group()\n        >>> S.abelian_description()\n        Z/2 + Z/2 + Z/2\n        ";
static const char __pyx_k_If_this_triangulation_is_a_subd[] = "\n        If this triangulation is a subdivision of the canonical cell\n        decomposition, return the canonical retriangulation as Triangulation.\n\n        Warning: Many operations on a SnapPy Triangulation will remove the\n        finite vertices or change the triangulation so it is no longer the\n        canonical retriangulation.\n        By default, the algorithm numerically checks that the tilts are close\n        to zero to determine which faces are opaque or transparent.\n        But it can also be passed an explicit list of 4 * num_tetrahedra bool's\n        (one per face of each tet) that mark the opaque faces.\n\n        For example, m412's canonical cell decomposition consists of a single\n        cube. The canonical retriangulation thus has 12 simplices.\n\n        >>> M = Manifold(\"m412\")\n\n        Some isometries of M are not visible in this triangulation (not\n        even after calling M.canonize())\n\n        >>> len(M.isomorphisms_to(M))\n        4\n        >>> T = M._canonical_retriangulation()\n        >>> T.num_tetrahedra()\n        12\n\n        But all isometries of M are visible in its canonical retriangulation.\n\n        >>> len(T.isomorphisms_to(T))\n        8\n\n        ";
static const char __pyx_k_Immutable_dictionary_whose_data[] = "\n    Immutable dictionary whose data can be accessed either as\n    attributes or by mapping.\n    Initialize with keyword arguments, or **dict.\n    ";
static const char __pyx_k_In_the_default_mode_this_functi[] = "\n        In the default mode, this function returns a matrix with rows\n        of the form\n\n                  a b c  d e f  ...\n\n        which means\n\n            a*log(z0) + b*log(1/(1-z0)) + c*log((z0-1)/z0) + d*log(z1) +... = 2 pi i\n\n        for an edge equation, and (same) = 0 for a cusp equation.\n        Here, the cusp equations come at the bottom of the matrix, and\n        are listed in the form: meridian of cusp 0, longitude of cusp\n        0, meridian of cusp 1, longitude of cusp 1,...\n\n        In terms of the tetrahedra, a is the invariant of the edge\n        (2,3), b the invariant of the edge (0,2) and c is the\n        invariant of the edge (1,2).  See kernel_code/edge_classes.c\n        for a detailed account of the convention used.\n\n        If the optional argument form='rect' is given, then this\n        function returns a list of tuples of the form:\n\n           ( [a0, a1,..,a_n], [b_0, b_1,...,b_n], c)\n\n        where this corresponds to the equation\n\n           z0^a0 (1 - z0)^b0 z1^a1(1 - z1)^b1 ...  = c\n\n        where c = 1 or -1.\n\n        >>> M = Triangulation('m004(2,3)')\n        >>> M.gluing_equations()\n        [ 2  1  0  1  0  2]\n        [ 0  1  2  1  2  0]\n        [ 2  0  0  0 -8  6]\n        >>> M.gluing_equations(form='rect')\n        [([2, -1], [-1, 2], 1), ([-2, 1], [1, -2], 1), ([2, -6], [0, 14], 1)]\n        ";
static const char __pyx_k_Iterator_Sequence_for_Alternati[] = "\n    Iterator/Sequence for Alternating knot exteriors from the\n    Hoste-Thistlethwaite tables.   Goes through 16 crossings.\n    ";
static const char __pyx_k_Iterator_Sequence_for_nonAltern[] = "\n    Iterator/Sequence for nonAlternating knot exteriors from the\n    Hoste-Thistlethwaite tables.  Goes through 16 crossings.\n    ";
static const char __pyx_k_M_ptolemy_variety_N_obstruction[] = "\n        M.ptolemy_variety(N, obstruction_class = None, simplify = True, eliminate_fixed_ptolemys = False)\n\n        Returns a Ptolemy variety as described in\n\n        * Stavros Garoufalidis, Dyland Thurston, Christian K. Zickert:\n          \"The Complex Volume of SL(n,C)-Representations of 3-Manifolds\"\n          (http://arxiv.org/abs/1111.2828)\n        * Stavros Garoufalidis, Matthias Goerner, Christian K. Zickert:\n          \"Gluing Equations for PGL(n,C)-Representations of 3-Manifolds \"\n          (http://arxiv.org/abs/1207.6711)\n\n        The variety can be exported to magma or sage and solved there. The\n        solutions can be processed to compute invariants. The method can also\n        be used to automatically look up precomputed solutions from the\n        database at http://ptolemy.unhyperbolic.org/data .\n\n        Example for m011 and PSL(2,C)-representations:\n\n        >>> M = Manifold(\"m011\")\n\n        Obtain all Ptolemy varieties for PSL(2,C)-representations:\n\n        >>> p = M.ptolemy_variety(2, obstruction_class = 'all')\n\n        There are two Ptolemy varieties for the two obstruction classes:\n\n        >>> len(p)\n        2\n\n        Retrieve the solutions from the database\n\n        >>> sols = p.retrieve_solutions() #doctest: +SKIP\n\n        Compute the solutions using magma (default in SnapPy)\n\n        >>> sols = p.compute_solutions(engine = 'magma') #doctest: +SKIP\n\n        Compute the solutions using singular (default in sage)\n\n        >>> sols = p.compute_solutions(engine = 'sage') #doctest: +SKIP\n\n        Note that magma is significantly faster.\n\n        Compute all resulting complex volumes\n\n        >>> cvols = sols.complex_volume_numerical() #doctest: +SKIP\n        >>> cvols  #doctest: +SKIP\n        [[[-4.29405713186238 E-16 + 0.725471193740844*I,\n           -0.942707362776931 + 0.459731436553693*I,\n           0.942707362776931 + 0.459731436553693*I]],\n         [[3.94159248086745 E-15 + 0.31268268751""8267*I,\n           4.64549527022581 E-15 + 0.680993020093457*I,\n           -2.78183391239608 - 0.496837853805869*I,\n           2.78183391239608 - 0.496837853805869*I]]]\n\n        Show complex volumes as a non-nested list:\n\n        >>> cvols.flatten(depth=2) #doctest: +SKIP\n        [-4.29405713186238 E-16 + 0.725471193740844*I,\n         -0.942707362776931 + 0.459731436553693*I,\n         0.942707362776931 + 0.459731436553693*I,\n         3.94159248086745 E-15 + 0.312682687518267*I,\n         4.64549527022581 E-15 + 0.680993020093457*I,\n         -2.78183391239608 - 0.496837853805869*I,\n         2.78183391239608 - 0.496837853805869*I]\n\n        For more examples, go to http://ptolemy.unhyperbolic.org/\n\n        === Optional Arguments ===\n\n        obstruction_class --- class from Definition 1.7 of (1).\n        None for trivial class or a value returned from ptolemy_obstruction_classes.\n        Short cuts: obstruction_class = 'all' returns a list of Ptolemy varieties\n        for each obstruction. For easier iteration, can set obstruction_class to\n        an integer.\n\n        simplify --- boolean to indicate whether to simplify the equations which\n        significantly reduces the number of variables.\n        Simplifying means that several identified Ptolemy coordinates x = y = z = ...\n        are eliminated instead of adding relations x - y = 0, y - z = 0, ...\n\n        eliminate_fixed_ptolemys --- boolean to indicate whether to eliminate\n        the Ptolemy coordinates that are set to 1 for fixing the decoration.\n        Even though this simplifies the resulting representation, setting it to\n        True can cause magma to run longer when finding a Groebner basis.\n\n        === Examples for 4_1 ===\n\n        >>> M = Manifold(\"4_1\")\n\n        Get the varieties for all obstruction classes at once (use\n        help(varieties[0]) for more information):\n\n        >>> varieties = M.ptolemy_variety(2, obstruction_class = \"all\")\n\n        Pr""int the variety as an ideal (sage object) for the non-trivial class:\n\n        >>> varieties[1].ideal    #doctest: +SKIP\n        Ideal (-c_0011_0^2 + c_0011_0*c_0101_0 + c_0101_0^2, -c_0011_0^2 - c_0011_0*c_0101_0 + c_0101_0^2, c_0011_0 - 1) of Multivariate Polynomial Ring in c_0011_0, c_0101_0 over Rational Field\n\n        Print the equations of the variety for the non-trivial class:\n\n        >>> for eqn in varieties[1].equations:\n        ...     print(eqn)          #doctest: +NORMALIZE_WHITESPACE\n             - c_0011_0 * c_0101_0 + c_0011_0^2 + c_0101_0^2\n             c_0011_0 * c_0101_0 - c_0011_0^2 - c_0101_0^2\n             - 1 + c_0011_0\n\n        Generate a magma file to compute Primary Decomposition for N = 3:\n\n        >>> p = M.ptolemy_variety(3)\n        >>> s = p.to_magma()\n        >>> print(s.split(\"ring and ideal\")[1].strip())     #doctest: +ELLIPSIS\n        R<c_0012_0, c_0012_1, c_0102_0, c_0111_0, c_0201_0, c_1011_0, c_1011_1, c_1101_0> := PolynomialRing(RationalField(), 8, \"grevlex\");\n        MyIdeal := ideal<R |\n                  c_0012_0 * c_1101_0 + c_0102_0 * c_0111_0 - c_0102_0 * c_1011_0,\n            ...\n\n        === If you have a magma installation ===\n\n        Call p.compute_solutions() to automatically call magma on the above output\n        and produce exact solutions!!!\n\n        >>> try:\n        ...     sols = p.compute_solutions()\n        ... except:\n        ...     # magma failed, use precomputed_solutions\n        ...     sols = None\n\n        Check solutions against manifold\n        >>> if sols:\n        ...     dummy = sols.check_against_manifold()\n\n        === If you do not have a magma installation ===\n\n        Load a precomputed example from magma which is provided with the package:\n\n        >>> from snappy.ptolemy.processMagmaFile import _magma_output_for_4_1__sl3, solutions_from_magma\n        >>> print(_magma_output_for_4_1__sl3)      #doctest: +ELLIPSIS\n        <BLANKLINE>\n        ==TRIAN""GULATION=BEGINS==\n        % Triangulation\n        4_1\n        ...\n\n        Parse the file and produce solutions:\n\n        >>> sols = solutions_from_magma(_magma_output_for_4_1__sl3)\n\n        >>> dummy = sols.check_against_manifold()\n\n        === Continue here whether you have or do not have magma ===\n\n        Pick the first solution of the three different solutions (up to Galois\n        conjugates):\n\n        >>> len(sols)\n        3\n        >>> solution = sols[0]\n\n        Read the exact value for c_1020_0 (help(solution) for more information\n        on how to compute cross ratios, volumes and other invariants):\n\n        >>> solution['c_1020_0']\n        Mod(-1/2*x - 3/2, x^2 + 3*x + 4)\n\n        Example of simplified vs non-simplified variety for N = 4:\n\n        >>> simplified = M.ptolemy_variety(4, obstruction_class = 1)\n        >>> full = M.ptolemy_variety(4, obstruction_class = 1, simplify = False)\n        >>> len(simplified.variables), len(full.variables)\n        (21, 63)\n        >>> len(simplified.equations), len(full.equations)\n        (24, 72)\n        ";
static const char __pyx_k_Manifold__get_tetrahedra_shapes[] = "Manifold._get_tetrahedra_shapes";
static const char __pyx_k_Manifold_cusp_neighborhood_line[] = "Manifold.cusp_neighborhood (line 320)";
static const char __pyx_k_Manifold_fundamental_group_line[] = "Manifold.fundamental_group (line 430)";
static const char __pyx_k_Manifold_tetrahedra_shapes_line[] = "Manifold.tetrahedra_shapes (line 878)";
static const char __pyx_k_MatrixWithExplanations___repr_2[] = "MatrixWithExplanations.__repr__";
static const char __pyx_k_New_triangulation_received_from[] = "\nNew triangulation received from PLink!\n";
static const char __pyx_k_Opens_browser_window_with_a_gra[] = "\n        Opens browser window with a graphical interface, which allows to\n        explore the manifold and interact with it.\n        This includes: invariants, Dirichlet domain, cusp neighborhoods,\n        inside view, symmetry, Dehn filling, drilling, etc.\n\n        >>> M = Manifold('m125')\n        >>> M.browse()  #doctest: +CYOPENGL\n\n        This does not work when using SnapPy in a Docker container.\n        ";
static const char __pyx_k_P_crossings_0_9_P_alternation_a[] = "(?P<crossings>[0-9]+)(?P<alternation>[an])(?P<index>[0-9]+)$";
static const char __pyx_k_P_crossings_0_9___P_index_0_9_P[] = "(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\\^](?P<components>[0-9]+)$";
static const char __pyx_k_Perform_random_Pachner_moves_on[] = "\n        Perform random Pachner moves on the underlying triangulation,\n        including some initial 3 -> 2 moves that increase the number of\n        tetrahedra by blowup_multiple.\n\n        >>> M = Triangulation('Braid:[1,2,-3,-3,1,2]')\n        >>> M.randomize()\n        ";
static const char __pyx_k_Q_1_D_q_vQaq_q_6a_avQc_U_q_AQ_1[] = "\320\004-\250Q\330\010\033\2301\330\010\014\210D\220\017\230q\330\010\021\220\026\220v\230Q\230a\230q\240\001\330\010\037\230q\240\004\320$6\260a\330\010\016\210a\210v\220Q\220c\230\024\230U\240%\240q\250\001\330\010\014\210A\210Q\330\010\013\2101\330\014%\240Q\240d\250!\330\010\017\210q";
static const char __pyx_k_Removing_any_finite_vertices_by[] = "\n        Removing any finite vertices by simplification and drilling.\n\n        >>> isosig = 'kLLLLMQkccfigghjijjlnabnwnpsii'\n        >>> T = Triangulation(isosig, remove_finite_vertices=False)\n        >>> T.triangulation_isosig(decorated=False) == isosig\n        True\n        >>> T.num_cusps(),  T._num_fake_cusps()\n        (0, 1)\n        >>> T._remove_finite_vertices()\n        >>> T.num_cusps(),  T._num_fake_cusps()\n        (1, 0)\n        ";
static const char __pyx_k_Represents_an_isometry_from_one[] = "\n    Represents an isometry from one manifold to another.\n    ";
static const char __pyx_k_Return_a_class_HolonomyGroup_re[] = "\n        Return a :class:`HolonomyGroup` representing the fundamental group of\n        the manifold, together with its holonomy representation.  If\n        integer Dehn surgery parameters have been set, then the\n        corresponding peripheral elements are killed.\n\n        >>> M = Manifold('m004')\n        >>> G = M.fundamental_group()\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaabABBAb\n        >>> G.peripheral_curves()\n        [('ab', 'aBAbABab')]\n        >>> G.SL2C('baaBA') # doctest: +NUMERIC6\n        [ 2.50000000 - 2.59807621*I -6.06217783 - 0.50000000*I]\n        [ 0.86602540 - 2.50000000*I -4.00000000 + 1.73205081*I]\n\n        There are three optional arguments all of which default to True:\n\n        - simplify_presentation\n        - fillings_may_affect_generators\n        - minimize_number_of_generators\n\n        >>> M.fundamental_group(False, False, False)\n        Generators:\n           a,b,c\n        Relators:\n           CbAcB\n           BacA\n        ";
static const char __pyx_k_Return_a_detailed_list_of_all_t[] = "\n        Return a detailed list of all the isometries in the symmetry group.\n\n        >>> S = Manifold('s959').symmetry_group()\n        >>> isoms = S.isometries()\n        >>> isoms[8]\n        0 -> 1   1 -> 0\n        [-1 -1]  [ 0  1]\n        [ 1  0]  [-1 -1]\n        Does not extend to link\n        ";
static const char __pyx_k_Return_a_list_of_info_objects_d[] = "\n        Return a list of info objects describing the short\n        geodesics up to the specified cutoff length.  The keys are\n        'length', 'parity', 'topology', and 'multiplicity'.  The\n        length is the complex length; the parity specifies whether\n        orientation is preserved; and topology distinguishes between\n        circles and mirrored intervals.  Finally, the key 'matrix'\n        in the fundamental group realizing this element.\n\n        >>> M = Manifold('m004(1,2)')\n        >>> D = M.dirichlet_domain(maximize_injectivity_radius=False)\n        >>> lengths = D.length_spectrum_dicts()\n        >>> len(lengths)\n        2\n        >>> lengths[0].matrix in D.pairing_matrices()\n        True\n\n        If the flag 'grouped' is False, then each geodesic is returned as\n        a separate item rather than collating by (length, parity, topology).\n        If the flag 'multiplicities' is False, then the geodesics *are*\n        collated but the multiplicity of each item is set to 0.\n\n        >>> M = Manifold('m003(-3, 1)')\n        >>> D = M.dirichlet_domain()\n        >>> [g.multiplicity for g in D.length_spectrum_dicts()]\n        [3, 3]\n        >>> [g.multiplicity for g in D.length_spectrum_dicts(grouped=False)]\n        [1, 1, 1, 1, 1, 1]\n        ";
static const char __pyx_k_Return_a_new_Manifold_where_the[] = "\n        Return a new Manifold where the specified cusps have been\n        permanently filled in.\n\n        Filling all the cusps results in a Triangulation rather\n        than a Manifold, since SnapPea can't deal with hyperbolic\n        structures when there are no cusps.\n\n        Examples:\n\n        >>> M = Manifold('m125(1,2)(3,4)')\n        >>> N = M.filled_triangulation()\n        >>> N.num_cusps()\n        0\n\n        Filling cusps 0 and 2 :\n\n        >>> M = Manifold('v3227(1,2)(3,4)(5,6)')\n        >>> M.filled_triangulation([0,2])\n        v3227_filled(3,4)\n        ";
static const char __pyx_k_Return_a_new_manifold_where_the[] = "\n        Return a new manifold where the specified cusps have been\n        permanently filled in.  Examples:\n\n        Filling all the cusps:\n\n        >>> M = Triangulation('m125(1,2)(3,4)')\n        >>> N = M.filled_triangulation()\n        >>> N.num_cusps()\n        0\n\n        Filling cusps 0 and 2 :\n\n        >>> M = Triangulation('v3227(1,2)(3,4)(5,6)')\n        >>> M.filled_triangulation([0,2])\n        v3227_filled(3,4)\n        ";
static const char __pyx_k_Return_the_Dowker_Thistlethwait[] = "\n        Return the Dowker-Thistlethwaite code of this link complement,\n        if it is a link complement. The DT code is intended to be an\n        immutable attribute, for use with knot and link exteriors\n        only, which is set only when the manifold was created.\n\n        Here is the Whitehead link:\n\n        >>> M = Manifold('L5a1')\n        >>> M.DT_code()\n        [(6, 8), (2, 10, 4)]\n        >>> M.DT_code(alpha=True)\n        'ebbccdaeb'\n        >>> M.DT_code(alpha=True, flips=True)\n        'ebbccdaeb.01110'\n        >>> M.DT_code(flips=True)\n        ([(6, 8), (2, 10, 4)], [0, 1, 1, 1, 0])\n        ";
static const char __pyx_k_Return_the_abelianization_of_th[] = "\n        Return the abelianization of the symmetry group\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.abelianization()\n        Z/2 + Z/2\n        ";
static const char __pyx_k_Return_the_center_of_the_symmet[] = "\n        Return the center of the symmetry group\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.center()\n        Z/2\n        ";
static const char __pyx_k_Return_the_current_generators_i[] = "\n        Return the current generators in terms of the original\n        geometric generators. Note that by default fundamental_group()\n        returns a simplified presentation of the group.\n\n        If the flag \"raw_form\" is set to True, it returns a sequence of\n        instructions for expressing the current generators in terms of\n        the original ones.  This is sometimes much more concise, though\n        the format is somewhat obscure.  See the source code of this\n        function in fundamental_group.pyx for details.\n\n        >>> M = Manifold('K7_1')\n        >>> G = M.fundamental_group()\n        >>> G.generators_in_originals()   #doctest: +NORMALIZE_WHITESPACE\n        ['DBcACbABcaCbDBcACbABcaCbACbaBcaCbd',\n         'DBcACbABcaCbDBcACbABcaCbCbDBcACbABcaBcACbaBcaCbdACbaBcaCbdBcBcACbaBcaCbd']\n        ";
static const char __pyx_k_Return_the_letters_representing[] = "\n        Return the letters representing the generators in the presentation.\n\n        >>> M = Manifold('9_42')\n        >>> G = M.fundamental_group() #Presentation simplified by default\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaaabbABBBAbb\n        >>> H = M.fundamental_group(False) #Unsimplified presentation\n        >>> H\n        Generators:\n           a,b,c,d,e\n        Relators:\n           ECbC\n           dEb\n           dAcaB\n           dbaE\n\n        SnapPy stores a FundamentalGroup as a presentation of the group.\n        The following commands demonstrate how generators in the unsimplified\n        and simplified presentations above correspond:\n\n        >>> G.generators()\n        ['a', 'b']\n        >>> H.generators()\n        ['a', 'b', 'c', 'd', 'e']\n        >>> G.generators_in_originals()\n        ['BABcBcbCABcBcbCCbCba', 'BcBCbCbab']\n        >>> G.original_generators()\n        ['BBAbba', 'A', 'AB', 'abba', 'bba']\n        >>> G.num_generators()\n        2\n        >>> G.num_original_generators()\n        5\n        >>> H.num_generators()\n        5\n        ";
static const char __pyx_k_Return_the_name_of_the_triangul[] = "\n        Return the name of the triangulation.\n\n        >>> M = Triangulation('4_1')\n        >>> M.name()\n        '4_1'\n        ";
static const char __pyx_k_Return_the_number_of_tetrahedra[] = "\n        Return the number of tetrahedra in the triangulation.\n\n        >>> M = Triangulation('m004')\n        >>> M.num_tetrahedra()\n        2\n        ";
static const char __pyx_k_Return_the_order_of_the_symmetr[] = "\n        Return the order of the symmetry group\n\n        >>> S = Manifold('s000').symmetry_group()\n        >>> S.order()\n        4\n        ";
static const char __pyx_k_Return_the_original_geometric_g[] = "\n        Return the original geometric generators (before\n        simplification) in terms of the current generators.\n\n        >>> M = Manifold('v0000')\n        >>> G = M.fundamental_group()\n        >>> G.original_generators(as_int_list=True)\n        [[1], [-1, -2, 1, 2], [-1, 2], [-2, -1, 2], [2]]\n        ";
static const char __pyx_k_Return_the_total_number_of_cusp[] = "\n        Return the total number of cusps.  By giving the optional argument\n        'orientable' or 'nonorientable' it will only count cusps of that type.\n\n        >>> M = Triangulation('m125')\n        >>> M.num_cusps()\n        2\n        ";
static const char __pyx_k_Return_whether_a_one_cusped_has[] = "\n        Return whether a one-cusped has a symmetry that acts on the\n        cusp via the matrix -I.\n\n        >>> S = Manifold('m015').symmetry_group()\n        >>> S.is_invertible_knot()\n        True\n        ";
static const char __pyx_k_Return_whether_the_SymmetryGrou[] = "\n        Return whether the SymmetryGroup is a nontrivial direct\n        product with at least one nonabelian factor.\n\n        >>> S = Manifold('s960').symmetry_group()\n        >>> S.is_direct_product()\n        True\n        >>> S\n        Z/4 x D3\n        ";
static const char __pyx_k_Return_whether_the_full_symmetr[] = "\n        Return whether the full symmetry group has been found.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_full_group()\n        True\n        ";
static const char __pyx_k_Return_whether_the_manifold_has[] = "\n        Return whether the manifold has an orientation reversing symmetry.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_amphicheiral()\n        True\n        ";
static const char __pyx_k_Return_whether_the_symmetry_gro[] = "\n        Return whether the symmetry group is abelian.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_abelian()\n        False\n        ";
static const char __pyx_k_Return_whether_the_underlying_3[] = "\n        Return whether the underlying 3-manifold is orientable.\n\n        >>> M = Triangulation('x124')\n        >>> M.is_orientable()\n        False\n        ";
static const char __pyx_k_Returns_True_if_M_and_N_are_iso[] = "\n        Returns ``True`` if M and N are isometric, ``False`` if they not.\n        A ``RuntimeError`` is raised in cases where the SnapPea kernel fails\n        to determine either answer.  (This is fairly common for closed\n        manifolds.)\n\n        >>> M = Manifold('m004')\n        >>> N = Manifold('4_1')\n        >>> K = Manifold('5_2')\n        >>> M.is_isometric_to(N)\n        True\n        >>> N.is_isometric_to(K)\n        False\n\n        We can also get a complete list of isometries between the two\n        manifolds:\n\n        >>> M = Manifold('5^2_1')  # The Whitehead link\n        >>> N = Manifold('m129')\n        >>> isoms = M.is_isometric_to(N, return_isometries = True)\n        >>> isoms[6]  # Includes action on cusps\n        0 -> 1  1 -> 0\n        [1  2]  [-1 -2]\n        [0 -1]  [ 0  1]\n        Extends to link\n\n        Each transformation between cusps is given by a matrix which\n        acts on the left.  That is, the two *columns* of the matrix\n        give the image of the meridian and longitude respectively.  In\n        the above example, the meridian of cusp 0 is sent to the\n        meridian of cusp 1.\n\n        Note: The answer ``True`` is rigorous, but the answer ``False`` may\n        not be as there could be numerical errors resulting in finding\n        an incorrect canonical triangulation.\n        ";
static const char __pyx_k_Returns_True_if_and_only_if_the[] = "\n        Returns ``True`` if and only if the triangulation has finite (non-ideal)\n        vertices.\n\n        >>> T = Triangulation(\"m004\")\n        >>> T.has_finite_vertices()\n        False\n        >>> T.dehn_fill((12,13))\n        >>> S = T.filled_triangulation()\n        >>> S.has_finite_vertices()\n        True\n\n        When trying to find a hyperbolic structure, SnapPea will eliminate\n        finite vertices:\n\n        >>> M = S.with_hyperbolic_structure()\n        >>> M.has_finite_vertices()\n        False\n        ";
static const char __pyx_k_Returns_a_Dehn_filling_descript[] = "\n        Returns a Dehn filling description of the manifold realizing\n        the symmetry group.\n\n        >>> M = Manifold('m003(-3,1)')\n        >>> M.symmetry_group()\n        D6\n        >>> N = M.symmetric_triangulation()\n        >>> N\n        m003(1,0)(1,0)(1,0)\n        >>> N.dehn_fill( [(0,0), (0,0), (0,0)] )\n        >>> N.symmetry_group(of_link=True)\n        D6\n        ";
static const char __pyx_k_Returns_a_Manifold_computed_dir[] = "\n        Returns a Manifold computed directly from the Dirichlet\n        domain, regarded as polyhedron with faces identified in pairs.\n        Only works if this gives a manifold not an orbifold.\n\n        >>> M = Manifold('7_3')\n        >>> D = M.dirichlet_domain()\n        >>> A = D.manifold()\n        >>> M.is_isometric_to(A)\n        True\n\n        ";
static const char __pyx_k_Returns_a_NeumannZagierTypeEqua[] = "\n        Returns a NeumannZagierTypeEquations object that contains a matrix\n        encoding the gluing equations for boundary-parabolic PGL(N,C)\n        representations together with explanations of the meaning\n        of the rows and the columns of the matrix.\n\n        This method generalizes gluing_equations() to PGL(N,C)-representations\n        as described in\n        Stavros Garoufalidis, Matthias Goerner, Christian K. Zickert:\n        \"Gluing Equations for PGL(n,C)-Representations of 3-Manifolds\"\n        (http://arxiv.org/abs/1207.6711).\n\n        The result of the :meth:`gluing_equations` can be obtained from\n        the general method by:\n\n        >>> M = Triangulation('m004')\n        >>> M.gluing_equations_pgl().matrix\n        [ 2  1  0  1  0  2]\n        [ 0  1  2  1  2  0]\n        [ 1  0  0  0 -1  0]\n        [ 0  0  0  0 -2  2]\n\n        But besides the matrix, the method also returns explanations of\n        the columns and rows:\n\n        >>> M = Triangulation(\"m004\")\n        >>> M.gluing_equations_pgl()\n        NeumannZagierTypeEquations(\n          [ 2  1  0  1  0  2]\n          [ 0  1  2  1  2  0]\n          [ 1  0  0  0 -1  0]\n          [ 0  0  0  0 -2  2],\n          explain_columns = ['z_0000_0', 'zp_0000_0', 'zpp_0000_0', 'z_0000_1', 'zp_0000_1', 'zpp_0000_1'],\n          explain_rows = ['edge_0_0', 'edge_0_1', 'meridian_0_0', 'longitude_0_0'])\n\n        The first row of the matrix means that the edge equation for\n        edge 0 is\n\n        .. math::\n\n           {z_{0000,0}}^2 * z'_{0000,0} * z_{0000,1} * {z''_{0000,1}}^2 = 1.\n\n        Similarly, the next row encodes the edge equation for the other edge\n        and the next two rows encode peripheral equations.\n\n        Following the SnapPy convention, a ``z`` denotes the cross ratio\n        :math:`z` at the edge (0,1), a ``zp`` the cross ratio :math:`z'` at\n        the edge (0,2) and a ``zpp`` the cross\n        ratio :math:`z''` at the edge (1,2). The ent""ire symbol ``z_xxxx_y`` then\n        denotes the cross ratio belonging to the subsimplex at integral\n        point ``xxxx`` (always ``0000`` for ``N = 2``) of the simplex ``y``.\n\n        Note: the SnapPy convention is different from the paper\n        mentioned above, e.g., compare\n        kernel_code/edge_classes.c with Figure 3. We follow the SnapPy\n        convention here so that all computations done in SnapPy are\n        consistent.\n\n        The explanations of the rows and columns can be obtained explicitly by:\n\n        >>> M.gluing_equations_pgl(N = 3, equation_type = 'peripheral').explain_rows\n        ['meridian_0_0', 'meridian_1_0', 'longitude_0_0', 'longitude_1_0']\n        >>> M.gluing_equations_pgl(N = 2).explain_columns\n        ['z_0000_0', 'zp_0000_0', 'zpp_0000_0', 'z_0000_1', 'zp_0000_1', 'zpp_0000_1']\n\n        A subset of all gluing equations can be obtained by setting the\n        ``equation_type``:\n\n        * all gluing equations: ``all``\n        * non-peripheral equations: ``non_peripheral``\n\n          * edge gluing equations: ``edge``\n          * face gluing equations: ``face``\n          * internal gluing equations: ``internal``\n\n        * cusp gluing equations: ``peripheral``\n\n          * cusp gluing equations for meridians: ``meridian``\n          * cusp gluing equations for longitudes: ``longitude``\n        ";
static const char __pyx_k_Returns_a_Triangulation_compute[] = "\n        Returns a Triangulation computed directly from the Dirichlet\n        domain, regarded as polyhedron with faces identified in pairs.\n        Only works if this gives a manifold not an orbifold.\n\n        >>> M = Manifold('7_3')\n        >>> D = M.dirichlet_domain()\n        >>> B = D.triangulation()\n        >>> M.is_isometric_to(B.with_hyperbolic_structure())\n        True\n\n        ";
static const char __pyx_k_Returns_a_class_DirichletDomain[] = "\n        Returns a :class:`DirichletDomain` object representing a Dirichlet\n        domain of the hyperbolic manifold, typically centered at a\n        point which is a local maximum of injectivity radius.  It will\n        have ideal vertices if the manifold is not closed.\n\n        >>> M = Manifold('m015')\n        >>> D = M.dirichlet_domain()\n        >>> D\n        32 finite vertices, 2 ideal vertices; 54 edges; 22 faces\n        >>> D.view()   #Shows 3d-graphical view.  #doctest: +CYOPENGL\n\n        The group elements for the face-pairings of the Dirichlet domain\n        can be given as words in the original generators of the\n        (unsimplified) fundamental group by setting :attr:`include_words = True`:\n\n        >>> sorted(M.dirichlet_domain(include_words = True).pairing_words()) #doctest: +ELLIPSIS\n        ['A', ...]\n\n        Other options can be provided to customize the computation;\n        the default choices are shown below:\n\n        >>> M.dirichlet_domain(vertex_epsilon=10.0**-8,\n        ...    displacement = [0.0, 0.0, 0.0],\n        ...    centroid_at_origin=True, maximize_injectivity_radius=True)\n        32 finite vertices, 2 ideal vertices; 54 edges; 22 faces\n\n        Here's one with different combinatorics:\n\n        >>> E = M.dirichlet_domain(displacement=[0.5, 0.3, -0.2],\n        ...                        maximize_injectivity_radius=False)\n        >>> E\n        44 finite vertices, 1 ideal vertices; 69 edges; 26 faces\n        ";
static const char __pyx_k_Returns_a_class_FundamentalGrou[] = "\n        Returns a :class:`FundamentalGroup` object representing the fundamental\n        group of the manifold.  If integer Dehn surgery parameters\n        have been set, then the corresponding peripheral elements are\n        killed.\n\n        >>> M = Triangulation('m004')\n        >>> G = M.fundamental_group()\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaabABBAb\n        >>> G.peripheral_curves()\n        [('ab', 'aBAbABab')]\n\n        There are four optional arguments all of which default to True:\n\n        - simplify_presentation\n        - fillings_may_affect_generators\n        - minimize_number_of_generators\n        - try_hard_to_shorten_relators\n\n        >>> M.fundamental_group(False, False, False)\n        Generators:\n           a,b,c\n        Relators:\n           CbAcB\n           BacA\n        ";
static const char __pyx_k_Returns_a_class_Manifold_repres[] = "\n        Returns a :class:`Manifold` representing the finite cover specified by a\n        transitive permutation representation.  The representation is\n        specified by a list of permutations, one for each generator of the\n        simplified presentation of the fundamental group.  Each permutation is\n        specified as a list ``P`` such such that ``set(P) == set(range(d))``\n        where ``d`` is the degree of the cover.\n\n        >>> M = Manifold('m004')\n        >>> N0 = M.cover([[1, 3, 0, 4, 2], [0, 2, 1, 4, 3]])\n        >>> abs(N0.volume()/M.volume() - 5) < 0.0000000001\n        True\n\n\n        If within SageMath, the permutations can also be of type\n        ``PermutationGroupElement``, in which case they act on the set\n        ``range(1, d + 1)``.  Or, you can specify a GAP or Magma subgroup\n        of the fundamental group.     Some examples::\n\n          sage: M = Manifold('m004')\n\n        The basic method::\n\n          sage: N0 = M.cover([[1, 3, 0, 4, 2], [0, 2, 1, 4, 3]])\n\n        From a Gap subgroup::\n\n          sage: G = gap(M.fundamental_group())\n          sage: H = G.LowIndexSubgroupsFpGroup(5)[9]\n          sage: N1 = M.cover(H)\n          sage: N0 == N1\n          True\n\n        Or a homomorphism to a permutation group::\n\n          sage: f = G.GQuotients(PSL(2,7))[1]\n          sage: N2 = M.cover(f)\n          sage: N2.volume()/M.volume() # doctest: +NUMERIC9\n          8.00000000\n\n        Or maybe we want larger cover coming from the kernel of this::\n\n          sage: N3 = M.cover(f.Kernel())\n          sage: N3.volume()/M.volume() # doctest: +NUMERIC9\n          168.00000000\n\n        Check the homology against what Gap computes directly::\n\n          sage: N3.homology().betti_number()\n          32\n          sage: len([ x for x in f.Kernel().AbelianInvariants().sage() if x == 0])\n          32\n\n        We can do the same for Magma::\n\n          sage: G = magma(M.fundamental_group())             #doctest: +SKI""P\n          sage: Q, f = G.pQuotient(5, 1, nvals = 2)          #doctest: +SKIP\n          sage: M.cover(f.Kernel()).volume()                 #doctest: +SKIP\n          10.14941606\n          sage: h = G.SimpleQuotients(1, 11, 2, 10000)[1,1]  #doctest: +SKIP\n          sage: N4 = M.cover(h)                              #doctest: +SKIP\n          sage: N2 == N4                                     #doctest: +SKIP\n          True\n        ";
static const char __pyx_k_Returns_a_class_Triangulation_r[] = "\n        Returns a :class:`Triangulation` representing the finite cover specified\n        by a transitive permutation representation.  The representation is\n        specified by a list of permutations, one for each generator of the\n        simplified presentation of the fundamental group.  Each permutation is\n        specified as a list ``P`` such that ``set(P) == set(range(d))`` where\n        ``d`` is the degree of the cover.\n\n        >>> M = Triangulation('m004')\n        >>> N0 = M.cover([[1, 3, 0, 4, 2], [0, 2, 1, 4, 3]])\n        >>> N0.homology()\n        Z + Z + Z\n        >>> N0.cover_info()['type']\n        'irregular'\n        >>> N0.cover_info()['base']\n        'm004'\n        >>> N0.cover_info()['degree']\n        5\n\n        Within Sage the permutations can also be of type\n        ``PermutationGroupElement``, in which case they act on the set\n        ``range(1, d + 1)``.  Or, you can specify a GAP or Magma subgroup\n        of the fundamental group.  For more examples, see the docstring for\n        :meth:`Manifold.cover`.\n        ";
static const char __pyx_k_Returns_a_complete_list_of_comb[] = "\n        Returns a complete list of combinatorial isomorphisms between\n        the two triangulations:\n\n        >>> M = Manifold('5^2_1')\n        >>> N = Manifold('5^2_1')\n        >>> N.set_peripheral_curves([[[2,3],[-1,-1]],[[1,1],[0,1]]])\n        >>> isoms = M.isomorphisms_to(N)\n        >>> isoms[6]\n        0 -> 1  1 -> 0\n        [ 1 0]  [-1 1]\n        [-1 1]  [-3 2]\n        Does not extend to link\n\n        Each transformation between cusps is given by a matrix which\n        acts on the left.  That is, the two *columns* of the matrix\n        give the image of the meridian and longitude respectively.  In\n        the above example, the meridian of cusp 0 is sent to the\n        meridian of cusp 1.\n        ";
static const char __pyx_k_Returns_a_copy_of_the_triangula[] = "\n        Returns a copy of the triangulation.\n\n        >>> M = Triangulation('m125')\n        >>> N = M.copy()\n        ";
static const char __pyx_k_Returns_a_dictionary_whose_keys[] = "\n        Returns a dictionary whose keys are the valences of the edges\n        in the triangulation, and the value associated to a key is the\n        number of edges of that valence.\n\n        >>> M = Triangulation('v3227')\n        >>> M.edge_valences()     # doctest: +SKIP\n        {10: 1, 4: 1, 5: 2, 6: 3}\n        ";
static const char __pyx_k_Returns_a_list_of_Triangulation[] = "\n        Returns a list of Triangulations corresponding to all of the\n        finite covers of the given degree.  The default method is\n        'low_index' for general covers and 'snappea' for cyclic\n        covers.  The former uses Sim's algorithm while the latter\n        uses the original Snappea algorithm.\n\n        WARNING: If the degree is large this might take a very, very,\n        very long time.\n\n        >>> M = Triangulation('m003')\n        >>> covers = M.covers(4)\n        >>> sorted(N.homology() for N in covers)\n        [Z/3 + Z/15 + Z, Z/5 + Z + Z]\n\n        It is faster to look just at cyclic covers.\n\n        >>> covers = M.covers(4, cover_type='cyclic')\n        >>> [(N, N.homology()) for N in covers]\n        [(m003~cyc~0(0,0), Z/3 + Z/15 + Z)]\n\n        Here we check that we get the same number of covers with the\n        'snappea' and 'low_index' methods.\n\n        >>> M = Triangulation('m125')\n        >>> len(M.covers(5))\n        19\n        >>> len(M.covers(5, method='snappea'))\n        19\n\n        If you are using Sage, you can use GAP to find the subgroups,\n        which is often much faster, by specifying the optional\n        argument method = 'gap' If you have Magma installed, you can\n        used it to do the heavy lifting by specifying method='magma'.\n        ";
static const char __pyx_k_Returns_a_list_of_class_Manifol[] = "\n        Returns a list of :class:`Manifold`\\ s corresponding to all of the\n        finite covers of the given degree.  The default method is\n        'low_index' for general covers and 'snappea' for cyclic\n        covers.  The former uses Sim's algorithm while the latter\n        uses the original Snappea algorithm.\n\n        WARNING: If the degree is large this might take a very, very,\n        very long time.\n\n        >>> M = Manifold('m003')\n        >>> covers = M.covers(4)\n        >>> sorted(N.homology() for N in covers)\n        [Z/3 + Z/15 + Z, Z/5 + Z + Z]\n\n        It is faster to look just at cyclic covers.\n\n        >>> covers = M.covers(4, cover_type='cyclic')\n        >>> [(N, N.homology()) for N in covers]\n        [(m003~cyc~0(0,0), Z/3 + Z/15 + Z)]\n\n        Here we check that we get the same number of covers with the\n        'snappea' and 'low_index' methods.\n\n        >>> M = Manifold('m125')\n        >>> len(M.covers(5))\n        19\n        >>> len(M.covers(5, method='snappea'))\n        19\n\n        If you are using Sage, you can use GAP to find the subgroups,\n        which is often much faster, by specifying the optional\n        argument method = 'gap' If you have Magma installed, you can\n        used it to do the heavy lifting by specifying method='magma'.\n        ";
static const char __pyx_k_Returns_a_list_of_geodesics_wit[] = "\n        Returns a list of geodesics (with multiplicities) of length\n        up to the specified cutoff value. (The default cutoff is 1.0.)\n\n        Here's a quick example:\n\n        >>> L = Manifold(\"m016\").length_spectrum(0.75, include_words=True)\n        >>> L # doctest: +SKIP\n        mult  length                                  topology     parity word\n        1     0.58460368501799 +  2.49537045556047*I  circle       +      a\n        1     0.72978937305180 +  3.02669828218116*I  circle       +      Bc\n\n        Access just the length:\n\n        >>> L[0].length # doctest: +NUMERIC6\n        0.584603685017987 + 2.495370455560469*I\n        ";
static const char __pyx_k_Returns_a_list_of_meridian_long[] = "\n        Returns a list of meridian-longitude pairs for all cusps.\n\n        >>> G = Manifold('m125').fundamental_group()\n        >>> G.peripheral_curves()\n        [('aaba', 'abb'), ('baaba', 'Ba')]\n        ";
static const char __pyx_k_Returns_a_list_of_the_O31Matric[] = "\n        Returns a list of the O31Matrices which pair the faces of\n        this DirichletDomain.\n\n        >>> M = Manifold('s345')\n        >>> D = M.dirichlet_domain()\n        >>> matrices = D.pairing_matrices()\n        >>> D1 = DirichletDomain(O31_generators=matrices)\n        >>> N = D1.manifold()\n        >>> M.is_isometric_to(N)\n        True\n        ";
static const char __pyx_k_Returns_a_list_of_variables_and[] = "\n        Returns a list of variables and a list polynomials where the\n        polynomials generate the ideal defining the SL(2, C) character\n        variety of this group.  Each variable is of the form \"Tw\" where\n        \"w\" is a word in the generators and \"Tw\" represents the trace\n        function of that word.\n\n        >>> H = Manifold('dLQacccbjkg')  # Hopf link exterior.\n        >>> G = H.fundamental_group()\n        >>> vars, polys = G.character_variety_vars_and_polys()\n        >>> vars\n        [Ta, Tb, Tab]\n        >>> polys    # doctest: +NORMALIZE_WHITESPACE\n        [Ta^3 - Tab*Tb*Ta^2 + (Tb^2 + (Tab^2 - 4))*Ta,\n         Ta^2 - Tab*Tb*Ta + (Tb^2 + (Tab^2 - 4))]\n\n        When used inside Sage, you can ask for the answer as a proper\n        ideal::\n\n          sage: M = Manifold('m000')  # Gieseking manifold\n          sage: G = M.fundamental_group()\n          sage: I = G.character_variety_vars_and_polys(as_ideal=True)\n          sage: I\n          Ideal (-Ta^3*Tb^2*Tab + Ta^4*Tb + Ta^2*Tb^3 + Ta^2*Tb*Tab^2 + Ta*Tb^2*Tab - 5*Ta^2*Tb - Tb^3 - Tb*Tab^2 + Ta*Tab - Ta + 3*Tb, Tb*Tab - Ta - Tb, -Ta^2*Tb^2*Tab + Ta^3*Tb + Ta*Tb^3 + Ta*Tb*Tab^2 - 4*Ta*Tb + Tab - 2) of Multivariate Polynomial Ring in Ta, Tb, Tab over Rational Field\n          sage: I.dimension()\n          1\n\n        ";
static const char __pyx_k_Returns_a_string_which_will_def[] = "\n        Returns a string which will define this group within GAP:\n\n        >>> M = Manifold('b++LLR')\n        >>> G = M.fundamental_group()\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaaaBAbbAB\n        >>> G.gap_string()\n        'CallFuncList(function() local F, a, b; F := FreeGroup(\"a\", \"b\"); a := F.1; b := F.2;   return F/[a*a*a*a*b^-1*a^-1*b*b*a^-1*b^-1]; end,[])'\n        >>> G.magma_string()\n        'Group<a,b|a*a*a*a*b^-1*a^-1*b*b*a^-1*b^-1>'\n        ";
static const char __pyx_k_Returns_a_word_representing_a_c[] = "\n        Returns a word representing a conjugate of the current\n        meridian for the given cusp.  Guaranteed to commute with the\n        longitude for the same cusp.\n\n        >>> G = Manifold('m125').fundamental_group()\n        >>> G.meridian(0)\n        'aaba'\n        >>> G.meridian(-1)  # The last cusp\n        'baaba'\n        ";
static const char __pyx_k_Returns_an_class_AbelianGroup_r[] = "\n        Returns an :class:`AbelianGroup` representing the first integral\n        homology group of the underlying (Dehn filled) manifold.\n\n        >>> M = Triangulation('m003')\n        >>> M.homology()\n        Z/5 + Z\n\n        ";
static const char __pyx_k_Returns_an_info_object_containi[] = "\n        Returns an info object containing information about the given\n        cusp.   Usage:\n\n        >>> M = Triangulation('v3227(0,0)(1,2)(3,2)')\n        >>> M.cusp_info(1)\n        Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0)\n        >>> c = M.cusp_info(1)\n        >>> c.is_complete\n        False\n        >>> sorted(c.keys())\n        ['filling', 'index', 'is_complete', 'topology']\n\n        You can get information about multiple cusps at once:\n\n        >>> M.cusp_info()\n        [Cusp 0 : torus cusp, not filled,\n         Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0),\n         Cusp 2 : torus cusp with Dehn filling coefficients (M, L) = (3.0, 2.0)]\n        >>> M.cusp_info('is_complete')\n        [True, False, False]\n        ";
static const char __pyx_k_Returns_information_about_the_c[] = "\n        Returns information about the cusp neighborhoods of the\n        manifold, in the form of data about the corresponding horoball\n        diagrams in hyperbolic 3-space.\n\n        >>> M = Manifold('s000')\n        >>> CN = M.cusp_neighborhood()\n        >>> CN.volume() # doctest: +NUMERIC6\n        0.32475953\n        >>> len(CN.horoballs(0.01))\n        178\n        >>> CN.view()  # Opens picture of the horoballs  #doctest: +CYOPENGL\n        ";
static const char __pyx_k_Returns_self_as_a_class_Triangu[] = "\n        Returns self as a :class:`Triangulation`, forgetting the hyperbolic\n        structure in the process.\n\n        >>> M = Manifold('9_42')\n        >>> T = M.without_hyperbolic_structure()\n        >>> hasattr(T, 'volume')\n        False\n        ";
static const char __pyx_k_Returns_the_Chern_Simons_invari[] = "\n        Returns the Chern-Simons invariant of the manifold (normalized by\n        dividing it by :math:`2 \\pi^2`), if it is known.\n\n        >>> M = Manifold('m015')\n        >>> M.chern_simons() # doctest: +NUMERIC6\n        -0.15320413\n\n        The return value has an extra attribute, accuracy, which\n        is the number of digits of accuracy as *estimated* by SnapPea.\n\n        >>> cs, accuracy = M.chern_simons(accuracy = True)\n        >>> accuracy in (8, 9, 56, 57) # Low and High precision\n        True\n\n        By default, when the manifold has at least one cusp, Zickert's\n        algorithm is used; when the manifold is closed we use SnapPea's\n        original algorithm, which is based on Meyerhoff-Hodgson-Neumann.\n\n        Note: When computing the Chern-Simons invariant of a closed\n        manifold, one must sometimes compute it first for the unfilled\n        manifold so as to initialize SnapPea's internals.  For instance,\n\n        >>> M = Manifold('5_2')\n        >>> M.chern_simons() # doctest: +NUMERIC6\n        -0.15320413\n        >>> M.dehn_fill( (1,2) )\n        >>> M.chern_simons() # doctest: +NUMERIC6\n        0.07731787\n\n        works, but will fail with\n        ``ValueError: The Chern-Simons invariant isn't currently known.``\n        if the first call to chern_simons is not made.\n        ";
static const char __pyx_k_Returns_the_decorated_isomorphi[] = "\n        Returns the \"(decorated) isomorphism signature\", a compact text\n        representation of the triangulation::\n\n          >>> T = Triangulation('m004')\n          >>> T.triangulation_isosig()\n          'cPcbbbiht_BaCB'\n\n        This string can be used later to recreate an isomorphic triangulation::\n\n          >>> U = Triangulation('cPcbbbiht_BaCB')\n          >>> T == U\n          True\n\n        The isomorphism signature is also used to compute the\n        :meth:`isometry_signature <snappy.Manifold.isometry_signature>`.\n        It comes in two flavors controlled by the :attr:`decorated` flag.\n\n        **Undecorated isomorphism signature**\n\n        The undecorated isomorphism signature is a complete invariant of the\n        (oriented) triangulation up to combinatorial isomorphism::\n\n            >>> T = Triangulation('m015')\n            >>> T.triangulation_isosig(decorated=False)\n            'dLQbcccdero'\n\n        It was introduced in\n        `Burton '11 <http://arxiv.org/abs/1110.6080>`_. It canonizes and\n        generalizes the ealier dehydration string by\n        `Callahan, Hildebrand and Weeks '99\n        <https://doi.org/10.1090/S0025-5718-99-01036-4>`_.\n        The undecorated isomorphism signature can also be given to\n        `Regina <https://regina-normal.github.io/>`_'s\n        ``Triangulation3.fromIsoSig``.\n\n        By default, the orientation (if orientable) is ignored. More\n        precisely, it computes the string for both orientations (if orientable)\n        and uses the lexicographically smaller string::\n\n            >>> T = Triangulation('m015')\n            >>> T.triangulation_isosig(decorated=False)\n            'dLQbcccdero'\n            >>> T.reverse_orientation()\n            >>> T.triangulation_isosig(decorated=False)\n            'dLQbcccdero'\n\n        When specifying :attr:`ignore_orientation = False`, the result\n        encodes the orientation (if orientable). Now the result is\n        differen""t if we change the orientation of a chiral triangulation::\n\n            >>> T = Triangulation('m015')\n            >>> T.triangulation_isosig(decorated=False, ignore_orientation=False)\n            'dLQbcccdero'\n            >>> T.reverse_orientation()\n            >>> T.triangulation_isosig(decorated=False, ignore_orientation=False)\n            'dLQbccceekg'\n\n        **Decorated isomorphism signature (default)**\n\n        SnapPy can decorate the isomorphism signature to include the following\n        peripheral information in a canonical way (that is invariant under\n        the action by combinatorial isomorphisms of the triangulation):\n\n        #. Indexing of the cusps (that is, ideal vertices).\n\n           * Included by default.\n             Can be suppressed with :attr:`ignore_cusp_ordering = True`.\n\n        #. Peripheral curves (aka meridian and longitude, up to homotopy).\n\n           * Included by default.\n             Can be suppressed with :attr:`ignore_curves = True`.\n           * By default, the decoration encodes the oriented peripheral curves.\n             By specifying :attr:`ignore_curve_orientations = True`, it encodes\n             the unoriented peripheral curves instead.\n\n        #. Dehn-fillings and orientation of core curve (if present).\n\n           * By default, the decoration encodes the Dehn-fillings and the\n             orientation of the core curve.\n             That is, we encode the (unoriented) peripheral curve that is\n             used for the Dehn-filling as well as the orientation of the class\n             of peripheral curves intersecting that peripheral curve ones\n             (this explanation only works if the coefficients are co-prime\n             integers). Note that this behavior has changed in Version 3.3.\n             By specifying :attr:`ignore_filling_orientations = True`, the\n             decoration encodes the Dehn-fillings without any regard to\n             orientation.\n             That i""s, it normalizes the Dehn-filling coefficients by picking\n             a canonical pair among :math:`(m,l)` and :math:`(-m,-l)`.\n\n        Details of the encoding are explained in the\n        `SnapPy source code <https://github.com/3-manifolds/SnapPy/blob/master/python/decorated_isosig.py>`_.\n\n        **Example**\n\n        Let us consider the links :math:`9^2_{34}` and ``L9a21``. Note that we use\n        :meth:`canonical_retriangulation <snappy.Manifold.canonical_retriangulation>`\n        to make the following examples say something intrinsic about the\n        hyperbolic manifold::\n\n          >>> from snappy import Manifold\n          >>> M = Manifold('9^2_34').canonical_retriangulation()\n          >>> N = Manifold('L9a21').canonical_retriangulation()\n\n        The decorated isosig recovers the entire peripheral information faithfully\n        (including orientation, see below)::\n\n          >>> M.triangulation_isosig()\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_baBabbbBbC'\n          >>> K = Triangulation('oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_baBabbbBbC')\n          >>> M.isomorphisms_to(K)\n          [0 -> 0  1 -> 1\n          [1 0]   [1 0]\n          [0 1]   [0 1]\n          Extends to link]\n\n        The two links have isometric complements::\n\n          >>> M.triangulation_isosig(decorated=False)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo'\n          >>> N.triangulation_isosig(decorated=False)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo'\n\n        However, the complements have different handedness::\n\n          >>> M.triangulation_isosig(decorated=False,ignore_orientation=False)\n          'oLLzLPwzQQccdeghjiiklmnmnnuvuvvavovvffffo'\n          >>> N.triangulation_isosig(decorated=False,ignore_orientation=False)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo'\n\n        Also, the cusps/components of the link are indexed differently::\n\n          >>> M.triangulation_isosig(ignore_curves=True)\n       ""   'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_ba'\n          >>> N.triangulation_isosig(ignore_curves=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_ab'\n\n        Ignoring the indexing, we also see that the oriented merdians and\n        longitudes do not match::\n\n          >>> M.triangulation_isosig(ignore_cusp_ordering=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_bBbCBabb'\n          >>> N.triangulation_isosig(ignore_cusp_ordering=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_BbbCbabb'\n\n        However, they are the same links (ignoring indexing and orientation)::\n\n          >>> M.triangulation_isosig(ignore_cusp_ordering=True, ignore_curve_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_bBBcbabb'\n          >>> N.triangulation_isosig(ignore_cusp_ordering=True, ignore_curve_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_bBBcbabb'\n\n        Let us create two surgery presentations from the links (note that we\n        fill after\n        :meth:`canonical_retriangulation <snappy.Manifold.canonical_retriangulation>`\n        since it rejects Dehn-fillings)::\n\n          >>> M.dehn_fill((4, 5),0)\n          >>> N.dehn_fill((4,-5),1)\n\n        They are equivalent surgery presentations (of the same manifold)::\n\n          >>> M.triangulation_isosig(\n          ...         ignore_cusp_ordering=True,\n          ...         ignore_curves=True,\n          ...         ignore_filling_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo(0,0)(1,5)'\n          >>> N.triangulation_isosig(\n          ...         ignore_cusp_ordering=True,\n          ...         ignore_curves=True,\n          ...         ignore_filling_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo(0,0)(1,5)'\n\n        A geometric spun-triangulation of the three-fold cover of m007(3,1)::\n\n          >>> M = Manifold('gLLMQcbeefefujumapn(2,-1)')\n          >>> M.solut""ion_type()\n          'all tetrahedra positively oriented'\n\n        Specifying :attr:`ignore_filling_orientations = True` can change the\n        orientation of the core curve and a triangulation spinning the other\n        way that fails to be geometric::\n\n          >>> isosig = M.triangulation_isosig(\n          ...         ignore_orientation=False,\n          ...         ignore_curves=True,\n          ...         ignore_filling_orientations=True,\n          ...         ignore_cusp_ordering=True)\n          >>> isosig\n          'gLLMQcbeefefujumapn(-2,1)'\n          >>> Manifold(isosig).solution_type()\n          'contains negatively oriented tetrahedra'\n\n        Preserve the unoriented spun-triangulation structure including the\n        direction it is spinning::\n\n          >>> isosig = M.triangulation_isosig(\n          ...         ignore_cusp_ordering=True,\n          ...         ignore_curves=True)\n          >>> isosig\n          'gLLMQcbeefefpjaqupw(1,1)'\n          >>> Manifold(isosig).solution_type()\n          'all tetrahedra positively oriented'\n\n        **Orientation**\n\n        Note that :attr:`ignore_orientation=True` only applies to the undecorated\n        part of the isomorphism signature. The decoration can still capture the\n        the orientation.\n        More, precisely, the result of :meth:`.triangulation_isosig` depends on\n        the orientation (if the triangulation is orientable and chiral) if any\n        of the following is true:\n\n        #. :attr:`ignore_orientation = False`.\n\n        #. :attr:`decorated = True` and\n           :attr:`ignore_curves = False` and\n           :attr:`ignore_filling_orientations = False`.\n\n        In these cases, re-constructing a triangulation from the isomorphism\n        signature yields a triangulation with the same handedness.\n\n        :param decorated:\n                Include peripheral information such as indexing of the cusps,\n                (oriented or unoriented) peripher""al curves and\n                (oriented or unoriented) Dehn-fillings.\n        :param ignore_cusp_ordering:\n                Do not encode the indexing of the cusps.\n                Only relevant if :attr:`decorated = True`.\n        :param ignore_curves:\n                Do not encode the peripheral curves.\n                Only relevant if :attr:`decorated = True`.\n                This is new in SnapPy version 3.2.\n                If :attr:`ignore_curves = True`, the result of this method cannot\n                be given to prior versions.\n        :param ignore_curve_orientations:\n                Do not encode the orientations of the peripheral curves.\n                Only relevant if :attr:`decorated = True` and\n                :attr:`ignore_curves = False`.\n        :param ignore_filling_orientations:\n                Do not encode the orientation of the class of peripheral curves\n                intersecting the Dehn-fillings.\n                Only relevant if :attr:`decorated = True`.\n        :param ignore_orientation:\n                Do not encode the orientation of the triangulation in the\n                undecorated part of the triangulation isosig.\n                See above section about orientation.\n        ";
static const char __pyx_k_Returns_the_number_of_fake_cusp[] = "\n        Returns the number of \"fake\" cusps, which is typically the number\n        of finite vertices.\n\n        >>> M = Triangulation('m004(1,2)')\n        >>> F = M.filled_triangulation()\n        >>> F.num_cusps(),  F._num_fake_cusps()\n        (0, 1)\n        >>> S = Triangulation('bkaagb', remove_finite_vertices=False)\n        >>> S.num_cusps(),  S._num_fake_cusps()\n        (0, 2)\n        ";
static const char __pyx_k_Returns_the_obstruction_classes[] = "\n        Returns the obstruction classes needed to compute\n        pSL(N,C) = SL(N,C)/{+1,-1} representations for even N, i.e., it\n        returns a list with a representative cocycle for each class in\n        H^2(M, boundary M; Z/2). The first element in the list is always\n        representing the trivial obstruction class.\n\n        For example, 4_1 has two obstruction classes:\n\n        >>> M = Manifold(\"4_1\")\n        >>> c = M.ptolemy_obstruction_classes()\n        >>> len(c)\n        2\n\n        The primary use of these obstruction classes is to construct\n        the Ptolemy variety as described in Definition 1.7 of\n        Stavros Garoufalidis, Dylan Thurston, Christian K. Zickert:\n        \"The Complex Volume of SL(n,C)-Representations of 3-Manifolds\"\n        (http://arxiv.org/abs/1111.2828).\n\n        For example, to construct the Ptolemy variety for\n        PSL(2,C)-representations of 4_1 that do not lift to boundary-parabolic\n        SL(2,C)-representations, use:\n\n        >>> p = M.ptolemy_variety(N = 2, obstruction_class = c[1])\n\n        Or the following short-cut:\n\n        >>> p = M.ptolemy_variety(2, obstruction_class = 1)\n\n        Note that this obstruction class only makes sense for even N:\n\n        >>> p = M.ptolemy_variety(3, obstruction_class = c[1])\n        Traceback (most recent call last):\n        ...\n        AssertionError: PtolemyObstructionClass only makes sense for even N, try PtolemyGeneralizedObstructionClass\n\n        To obtain PGL(N,C)-representations for N > 2, use the generalized\n        obstruction class:\n\n        >>> c = M.ptolemy_generalized_obstruction_classes(3)\n        >>> p = M.ptolemy_variety(3, obstruction_class = c[1])\n\n        The original obstruction class encodes a representing cocycle in Z/2 as follows:\n\n        >>> c = M.ptolemy_obstruction_classes()\n        >>> c[1]\n        PtolemyObstructionClass(s_0_0 + 1, s_1_0 - 1, s_2_0 - 1, s_3_0 + 1, s_0_0 - s_0_1, s_1_0 - s_3_1, s_2_0 -"" s_2_1, s_3_0 - s_1_1)\n\n        This means that the cocycle to represent this obstruction class in Z/2\n        takes value 1 in Z/2 on face 0 of tetrahedra 0 (because s_0_0 = -1)\n        and value 0 in Z/2 on face 1 of tetrahedra 0 (because s_1_0 = +1).\n\n        Face 3 of tetrahedra 0 and face 1 of tetrahedra 1 are identified,\n        hence the cocycle takes the same value on those two faces (s_3_0 = s_1_1).\n\n        ";
static const char __pyx_k_Returns_the_product_of_group_el[] = "\n        Returns the product of group elements i and j.  The convention\n        is that products of symmetries read right to left.  That is,\n        the composition (symmetry[i] o symmetry[j]) acts by first\n        doing symmetry[j], then symmetry[i].\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.multiply_elements(2, 3)\n        1\n        ";
static const char __pyx_k_Returns_the_type_of_the_current[] = "\n        Returns the type of the current solution to the gluing\n        equations, basically a summary of how degenerate the solution\n        is.  If the flag :attr:`enum=True` is set, then an integer value is\n        returned. The possible answers are:\n\n        - 0: ``not attempted``\n\n        - 1: ``all tetrahedra positively oriented`` aka *geometric_solution*\n\n          Should correspond to a genuine hyperbolic structure.\n\n        - 2: ``contains negatively oriented tetrahedra`` aka *nongeometric solution*\n\n          Probably corresponds to a hyperbolic structure but some\n          simplices have reversed orientations.\n\n        - 3: ``contains flat tetrahedra`` (should be called ``all tetrahedra flat``)\n\n          All tetrahedra have shape in :math:`\\mathbb{R} - \\{0, 1\\}`.\n\n        - 4: ``contains degenerate tetrahedra``\n\n          Some shapes are close to :math:`\\{0,1, \\infty\\}`.\n\n        - 5: ``unrecognized solution type``\n\n        - 6: ``no solution found``\n\n        >>> M = Manifold('m007')\n        >>> M.solution_type()\n        'all tetrahedra positively oriented'\n        >>> M.dehn_fill( (3,1) )\n        >>> M.solution_type()\n        'contains negatively oriented tetrahedra'\n        >>> M.dehn_fill( (3,-1) )\n        >>> M.solution_type()\n        'contains degenerate tetrahedra'\n        ";
static const char __pyx_k_Returns_the_volume_of_the_curre[] = "\n        Returns the volume of the current solution to the hyperbolic\n        gluing equations; if the solution is sufficiently non-degenerate,\n        this is the sum of the volumes of the hyperbolic pieces in\n        the geometric decomposition of the manifold.\n\n        >>> M = Manifold('m004')\n        >>> M.volume() # doctest: +NUMERIC6\n        2.02988321\n        >>> M.solution_type()\n        'all tetrahedra positively oriented'\n\n        The return value has an extra attribute, accuracy, which is the\n        number of digits of accuracy as *estimated* by SnapPea.  When\n        printing the volume, the result is rounded to 1 more than this\n        number of digits.\n\n        >>> vol, accuracy = M.volume(accuracy = True)\n        >>> accuracy in (10, 63) # Low precision, High precision\n        True\n\n        Inside SageMath, verified computation of the volume of a\n        hyperbolic manifold is also possible (this will verify first\n        that the manifold is indeed hyperbolic)::\n\n            sage: M.volume(verified=True, bits_prec=100)   #doctest: +NUMERIC24\n            2.029883212819307250042405109?\n        ";
static const char __pyx_k_Reverses_the_orientation_of_the[] = "\n        Reverses the orientation of the Triangulation, presuming that\n        it is orientable.\n\n        >>> M = Manifold('m015')\n        >>> cs = M.chern_simons()\n        >>> M.reverse_orientation()\n        >>> abs(cs + M.chern_simons()) # doctest: +NUMERIC9\n        0.0\n        ";
static const char __pyx_k_Save_the_triangulation_as_a_Sna[] = "\n        Save the triangulation as a SnapPea triangulation file.\n\n        >>> M = Triangulation('m004')\n        >>> M.save('fig-eight.tri')     #doctest: +SKIP\n\n        To retrieve a SnapPea triangulation from the saved file\n        you can do the following. The first command creates a cusped\n        manifold M. The second one creates the filled manifold M1\n        with Dehn coefficients (2,3).\n\n        >>> M = Manifold('fig-eight.tri')   #doctest: +SKIP\n        >>> M1 = Manifold('fig-eight.tri(2,3)')   #doctest: +SKIP\n\n        ";
static const char __pyx_k_Searches_for_connected_closed_n[] = "\n        Searches for connected closed normal surfaces of nonnegative Euler\n        characteristic.  If spheres or projective planes are found, then\n        tori and Klein bottles aren't reported.  There is no guarantee\n        that all such normal surfaces will be found nor that any given\n        surface is incompressible.  The search is confined to surfaces\n        whose quads are in the tetrahedra that have degenerate shapes.\n\n        You can split the manifold open along one of these surfaces\n        using the method \"split\".\n\n        A connect sum of two trefoils:\n\n        >>> M1 = Manifold('DT: fafBCAEFD')\n        >>> len(M1.splitting_surfaces())\n        2\n\n        First satellite knot in the table.\n\n        >>> M2 = Manifold('K13n4587')\n        >>> M2.splitting_surfaces()\n        [Orientable two-sided with euler = 0]\n        ";
static const char __pyx_k_Set_the_Dehn_filling_coefficien[] = "\n        Set the Dehn filling coefficients of the cusps.  This can be\n        specified in the following ways, where the cusps are numbered\n        by 0,1,...,(num_cusps - 1).\n\n        - Fill cusp 2:\n\n          >>> M = Triangulation('8^4_1')\n          >>> M.dehn_fill((2,3), 2)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(0,0)\n\n        - Fill the last cusp:\n\n          >>> M.dehn_fill((1,5), -1)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(1,5)\n\n        - Fill the first two cusps:\n\n          >>> M.dehn_fill( [ (3,0), (1, -4) ])\n          >>> M\n          8^4_1(3,0)(1,-4)(2,3)(1,5)\n\n        - When there is only one cusp, there's a shortcut\n\n          >>> N = Triangulation('m004')\n          >>> N.dehn_fill( (-3,4) )\n          >>> N\n          m004(-3,4)\n\n        Does not return a new :class:`Triangulation`.\n        ";
static const char __pyx_k_SnapPea_kernel_style_estimation[] = "SnapPea kernel style estimation of accuracy not available for arbitrary precision/interval arithmetic.";
static const char __pyx_k_Split_the_manifold_open_along_a[] = "\n        Split the manifold open along a surface of positive characteristic found\n        by the method \"splitting_surfaces\".  Returns a list of the pieces, with any\n        sphere boundary components filled in.\n\n        Here's an example of a Whitehead double on the trefoil.\n\n        >>> M = Manifold('K14n26039')\n        >>> S = M.splitting_surfaces()[0]\n        >>> S\n        Orientable two-sided with euler = 0\n\n        >>> pieces = M.split(S); pieces\n        [K14n26039.a(0,0)(0,0), K14n26039.b(0,0)]\n        >>> pieces[0].volume() # doctest: +NUMERIC6\n        3.66386238\n        >>> pieces[1].fundamental_group().relators()\n        ['aabbb']\n\n        You can also specify a surface by its index.\n\n        >>> M = Manifold('L10n111')\n        >>> max( P.volume() for P in M.split(0) ) # doctest: +NUMERIC6\n        5.33348957\n        ";
static const char __pyx_k_Starting_the_link_editor_Select[] = "Starting the link editor.\nSelect Tools->Send to SnapPy to load the link complement.";
static const char __pyx_k_Supply_a_manifold_or_generators[] = "Supply a manifold, or generators.";
static const char __pyx_k_Supported_methods_are_low_index[] = "Supported methods are 'low_index', 'gap', 'magma' and 'snappea'";
static const char __pyx_k_SymmetryGroup___setstate_cython[] = "SymmetryGroup.__setstate_cython__";
static const char __pyx_k_SymmetryGroup_is_direct_product[] = "SymmetryGroup.is_direct_product";
static const char __pyx_k_SymmetryGroup_multiply_elements[] = "SymmetryGroup.multiply_elements";
static const char __pyx_k_Tetrahedra_data_appears_invalid[] = "Tetrahedra data appears invalid";
static const char __pyx_k_The_SnapPea_kernel_was_not_able[] = "The SnapPea kernel was not able to determine if the manifolds are isometric.";
static const char __pyx_k_The_Triangulation_must_be_empty[] = "The Triangulation must be empty.";
static const char __pyx_k_The_amount_of_data_given_is_not[] = "The amount of data given is not consistent with %d O31 or SL2C matrices.";
static const char __pyx_k_The_census_knot_s_was_not_found[] = "The census knot %s was not found.";
static const char __pyx_k_The_data_provided_does_not_give[] = "The data provided does not give a (positively oriented) basis.";
static const char __pyx_k_The_drilling_curve_requested_is[] = "The drilling curve requested is not in range(%d).";
static const char __pyx_k_The_homomorphism_image_is_not_a[] = "The homomorphism image is not a permutation group.";
static const char __pyx_k_The_permutation_list_is_invalid[] = "The permutation list is invalid.";
static const char __pyx_k_There_are_only_201_census_knots[] = "There are only 201 census knots.";
static const char __pyx_k_Triangulation_DT_code_line_1108[] = "Triangulation.DT_code (line 1108)";
static const char __pyx_k_Triangulation__covers_low_index[] = "Triangulation._covers_low_index";
static const char __pyx_k_Triangulation__from_isosig_line[] = "Triangulation._from_isosig (line 845)";
static const char __pyx_k_Triangulation__from_string_line[] = "Triangulation._from_string (line 699)";
static const char __pyx_k_Triangulation__get_cusp_indices[] = "Triangulation._get_cusp_indices_and_peripheral_curve_data";
static const char __pyx_k_Triangulation_fundamental_group[] = "Triangulation.fundamental_group";
static const char __pyx_k_Triangulation_orientation_cover[] = "Triangulation.orientation_cover";
static const char __pyx_k_Triangulation_simplify_line_497[] = "Triangulation.simplify (line 497)";
static const char __pyx_k_Try_to_simplify_the_triangulati[] = "\n        Try to simplify the triangulation by doing Pachner moves.\n\n        >>> M = Triangulation('12n123')\n        >>> M.simplify()\n\n        It does four kinds of moves that reduce the number of\n        tetrahedra:\n\n        * 3 -> 2 and 2 -> 0 Pacher moves, which eliminate one or two\n          tetrahedra respectively.\n\n        * On suitable valence-1 edges, does a 2 -> 3 and then 2 -> 0 move,\n          which removes a tetrahedron and creates a new valence-1 edge.\n\n        * When a 2-simplex has two edges of valence-4 giving rise to the\n          suspension of a pentagon, replace these 6 tetrahedra with a\n          single edge of valence 5.\n\n        It also does random 4 -> 4 moves in hopes of setting up a\n        simplfication.  The argument passes_at_fours is the number of\n        times it goes through the valence-4 edges without progress\n        before giving up.\n\n        ";
static const char __pyx_k_Used_by_pickle_dumps_from_pickl[] = "\n        Used by pickle.dumps.\n\n        >>> from pickle import loads, dumps\n        >>> from spherogram import random_link\n        >>> M = Manifold('m125')\n        >>> M == loads(dumps(M))\n        True\n        >>> M.dehn_fill((2,3),0)\n        >>> len(dumps(M)) < len(M._to_string())\n        True\n        >>> N = loads(dumps(M))\n        >>> N\n        m125(2,3)(0,0)\n        >>> M.is_isometric_to(N)\n        True\n        >>> M = Manifold('m024')\n        >>> M.is_orientable()\n        False\n        >>> N = loads(dumps(M))\n        >>> N == M\n        True\n        >>> N.volume() == M.volume()\n        True\n        >>> while True:\n        ...    M = random_link(500).exterior()\n        ...    if M.num_tetrahedra() > 256:\n        ...       break\n        ...\n        >>> M == loads(dumps(M))\n        True\n        ";
static const char __pyx_k_Used_by_the_pickle_module_to_pi[] = "\n        Used by the pickle module to pickle an Abelian Group.\n        >>> from pickle import loads, dumps\n        >>> A = AbelianGroup([[n**2 + 3 for n in range(n+3,n+10)] for n in range(7)])\n        >>> A\n        Z/8 + Z + Z + Z + Z\n        >>> A == loads(dumps(A))\n        True\n        ";
static const char __pyx_k_WARNING_Users_should_not_use_th[] = "\n        WARNING: Users should not use this function directly.  To\n        create a Triangulation or Manifold or ManifoldHP from a string\n        containing the contents of a triangulation file, simply do:\n\n        >>> M = Manifold('7_4')\n        >>> seed = M._to_string()\n        >>> N = Manifold(seed)\n        >>> N == M\n        True\n\n        Fill an empty Triangulation from a string generated by\n        _to_string.\n        ";
static const char __pyx_k_a_Qm1_a_Q_at5_2V2Q_Q_1D_Q_Q_we1[] = "\320\004.\250a\360&\000\t\014\210:\220Q\220m\2401\330\014\033\230;\240a\330\014\032\230+\240Q\340\010\023\220;\230a\230t\2405\250\003\2502\250V\2602\260Q\330\010\025\220Q\340\010\023\2201\220D\230\001\330\024\025\330\024\025\220Q\330\024\025\220Q\340\010\013\210<\220w\230e\2401\240A\330\014\022\220*\230A\230Q\330-/\250q\340\010\032\230*\240A\240T\250\021\330%/\250q\260\001\330%&\330\010\030\230\001\230\034\240Q\340\010\013\320\013\033\2303\230a\330\014\022\220,\230a\230q\340\014\025\220T\230\032\2401\240A\330\014\022\320\022&\240a\240q\330\014\023\2201";
static const char __pyx_k_abcdefghijklmnopqrstuvwxyzZYXWV[] = "$abcdefghijklmnopqrstuvwxyzZYXWVUTSRQPONMLKJIHGFEDCBA";
static const char __pyx_k_get_cusp_indices_and_peripheral[] = "_get_cusp_indices_and_peripheral_curve_data";
static const char __pyx_k_get_ptolemy_obstruction_classes[] = "get_ptolemy_obstruction_classes";
static const char __pyx_k_get_triangulation_tester_doctes[] = "\n    >>> get_triangulation_tester() # doctest: +NUMERIC6\n    L13n9331(0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    m003(0,0) 2.02988321 Z/5 + Z\n    m004(0,0) 2.02988321 Z\n    v1205(2,3) 4.70744340 Z/40\n    x012(0,0)(0,0) 3.54972978 Z/2 + Z\n    y123(0,0) 5.02755480 Z\n    L13n9331(3,4)(2,3)(2,1) 14.60215339 Z/53\n    K7_1(0,0) 3.57388254 Z\n    6_1(0,0) 3.16396323 Z\n    5^2_1(3,4)(1,-2) 2.73300075 Z/3\n    8^3_3(0,0)(0,0)(0,0) 8.96736085 Z + Z + Z\n    4_1(0,0) 2.02988321 Z\n    12n123(0,0) 18.15036328 Z\n    16n1235(0,0) 21.29383093 Z\n    b++RL(0,0) 2.02988321 Z\n    b-+RRL(0,0) 2.40690959 Z/3 + Z\n    b+-RL(0,0) 2.02988321 Z/5 + Z\n    b--RRL(0,0) 2.40690959 Z/3 + Z\n    Braid:[1, 2, -1, -2](0,0)(0,0) 4.05976643 Z + Z\n    DT:[(8, 10, -14), (2, 6, 20), (-4, 22, 24, 12, 26, 18, 16)](0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    DT[4,6,2](0,0) 0.0 Z\n    DT[mcccgdeGacjBklfmih](0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    DT:mcccgdeGacjBklfmih(0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    a0*B1(0,0) 2.02988321 Z\n    b1*A0 a0*B1(1,0) 0.0 Z/2\n    dLQbcccdxwb(0,0) 2.56897060 Z/3 + Z\n    L13n9331(0,0)(0,0)(0,0) Z + Z + Z\n    m003(0,0) Z/5 + Z\n    m004(0,0) Z\n    v1205(2,3) Z/40\n    x012(0,0)(0,0) Z/2 + Z\n    y123(0,0) Z\n    L13n9331(3,4)(2,3)(2,1) Z/53\n    K7_1(0,0) Z\n    6_1(0,0) Z\n    5^2_1(3,4)(1,-2) Z/3\n    8^3_3(0,0)(0,0)(0,0) Z + Z + Z\n    4_1(0,0) Z\n    12n123(0,0) Z\n    16n1235(0,0) Z\n    b++RL(0,0) Z\n    b-+RRL(0,0) Z/3 + Z\n    b+-RL(0,0) Z/5 + Z\n    b--RRL(0,0) Z/3 + Z\n    Braid:[1, 2, -1, -2](0,0)(0,0) Z + Z\n    DT:[(8, 10, -14), (2, 6, 20), (-4, 22, 24, 12, 26, 18, 16)](0,0)(0,0)(0,0) Z + Z + Z\n    DT[4,6,2](0,0) Z\n    DT[mcccgdeGacjBklfmih](0,0)(0,0)(0,0) Z + Z + Z\n    DT:mcccgdeGacjBklfmih(0,0)(0,0)(0,0) Z + Z + Z\n    a0*B1(0,0) Z\n    b1*A0 a0*B1(1,0) Z/2\n    dLQbcccdxwb(0,0) Z/3 + Z\n    ";
static const char __pyx_k_import_itertools_M_Manifold_L14[] = "\n        >>> import itertools\n        >>> M = Manifold('L14n62484')\n        >>> ['%.5f' % z.real() for z in M.cusp_info('shape')]\n        ['0.10384', '1.17955', '-1.89674', '0.86324']\n        >>> perms = itertools.permutations(range(4))\n        >>> for perm in perms:\n        ...     shapes = M.cusp_info('shape')\n        ...     M._reindex_cusps(perm)\n        ...     new_shapes = M.cusp_info('shape')\n        ...     for i in range(4):\n        ...         assert new_shapes[perm[i]] == shapes[i]\n        ";
static const char __pyx_k_lL_P_components_0_9_1_P_crossin[] = "[lL](?P<components>[0-9]{1})(?P<crossings>[0-9]{2})(?P<index>[0-9]+)$";
static const char __pyx_k_ptolemy_equations_action_by_dec[] = "_ptolemy_equations_action_by_decoration_change";
static const char __pyx_k_ptolemy_equations_identified_co[] = "_ptolemy_equations_identified_coordinates";
static const char __pyx_k_ptolemy_equations_identified_fa[] = "_ptolemy_equations_identified_face_classes";
static const char __pyx_k_ptolemy_generalized_obstruction[] = "ptolemy_generalized_obstruction_classes";
static const char __pyx_k_qP_4_1_AQ_1D_Q_Q_G9A_q_1_Q_1_iq[] = "\320\004'\240q\360P\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\023\2201\220D\230\001\330\024\025\330\024\025\220Q\330\024\025\220Q\330\010\021\220\021\330\010\014\210G\2209\230A\330\014\037\230q\330\020\032\230!\2301\330\020\021\220\021\330\020\021\220\021\330\020\021\220\021\340\014\022\220'\230\021\330\020\035\230Q\330\024\032\230!\330\024\033\2301\330\024\"\240$\240i\250q\260\016\270a\270q\330\024$\240D\250\t\260\021\260.\300\001\300\021\330\024!\240\021\360\006\000\t\031\230\001\230\034\240Q\330\010\017\210~\230Q\230a";
static const char __pyx_k_q_4_1_AQ_4z_Ba_A_ggnnooss_q_a_E[] = "\320\004(\250\007\250q\360.\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\360\006\000\t\014\2104\210z\230\023\230B\230a\330\014\022\220*\230A\320\035g\320gn\320no\320os\320s}\320}~\340\010\017\210q\340\010\031\230\021\230$\230a\360\006\000\t\r\210E\220\025\220a\220t\230:\240Q\330\014\030\230\004\230J\240a\240q\330\014\017\210y\230\001\330\020\030\230\002\230\"\230E\240\022\2401\340\020\030\230\001\230\031\240!\330\014\021\220\023\220F\230!\330\020\026\320\026'\240q\250\004\250A\330(+\2503\250a\250t\2603\260a\260t\2701\270A\330\020\024\220G\2301\230A\230S\240\001\240\023\240D\250\005\250U\260!\2601\330\020\"\240!\2401\360\006\000\t\022\320\021%\240Q\240d\320*<\270A\270[\310\001\310\032\320ST\340\010\014\210E\220\025\220a\220q\330\014\020\220\007\220q\230\001\230\026\230q\240\002\240!\2403\240d\250%\250u\260A\260Q\340\010\035\230Q\230h\240a\360\006\000\t\020\210s\220!\2201\330\010\021\220\021\220!\2204\220q\230\002\230!\2302\230S\240\002\240#\240S\250\002\250\"\250B\250c\260\022\2604\260q\270\002\270!\2702\270S\300\002\300#\300S\310\002\310#\310T\320QV\320V[\320[\\\320\\c\320cg\320gl\320lq\320qr\320rs\340\010\013\2101\330\014\017\210t\220?\240!\2401\330\020\025\220Q\220a\340\020\025\220Q\220a\340\010\017\210v\220Q\220a";
static const char __pyx_k_q_A_E_WN_Zq_E_q_Rs_Q_2_A_r_1_WA[] = "\320\004'\240q\330\010\013\210?\230\"\230A\330\014\r\340\010\024\220E\230\021\230#\230W\240N\260#\260Z\270q\300\001\330\010\020\220\001\330\010\014\210E\220\021\330\014\020\220\017\230q\240\005\240R\240s\250#\250Q\330\014\021\220\027\230\001\320\0312\260\"\260A\330\014\017\210r\220\022\2201\330\020\025\220W\230A\320\0356\260b\270\001\340\010\014\210I\220Q\340\010\014\210L\230\001\330\010\026\220f\320\034,\250A\250^\2701\270A\330\010\014\210H\220A\330\014\023\2204\220u\230A\320\0353\2602\260R\260u\270B\270e\300:\310Q\330\014\020\220\010\230\001\330\020\032\230$\230g\240Q\330\020\023\2207\230!\2303\230c\240\021\330\024\030\230\t\240\027\250\001\250\027\260\006\260a\340\010\014\210J\220c\230\021\230$\230a\330\010\016\210i\220q\230\006\230i\240s\250#\250Q\250d\260,\270a";
static const char __pyx_k_q_vS_r_e1A_4q_0DJa_a_Jc_6a_iq_a[] = "\320\004\027\220q\330\010\013\320\013'\240v\250S\260\001\330\014\027\220r\230\025\230e\2401\240A\330$%\330\014#\2404\240q\250\001\330\014(\250\010\3200D\300J\310a\330\014 \240\006\240a\330\010\014\210J\220c\230\021\320\0326\260a\330\010\016\210i\220q\230\006\230a";
static const char __pyx_k_r_AQk_XX_81_Zq_j_at1AXU_1HAV6_1[] = "\200\001\360r\001\000\005\t\210\010\320\020 \240\001\240\021\330\004\014\210A\210Q\210k\230\024\230X\240X\250^\2708\3001\330\r(\250\010\260\001\330\r!\240\031\250+\260Z\270q\330\r\026\220j\240\t\250\021\330\r!\240\025\240a\240t\2501\250A\250X\260U\270!\330\r\022\220!\2201\220H\230A\230V\2406\250\022\2501\330\r\022\220!\2201\220H\230A\230V\2401\330\r*\250!\330\r\016\340\004\010\210\010\220\001\330\010\014\210H\220A\220Q\330\010\016\210a\210w\220a\330\010\013\2103\210a\210u\220B\220a\330\014\022\220!\330\010\r\210Q\210c\220\025\220a\220y\240\001\340\004\010\210\010\220\001\330\010\014\210M\230\021\230!\330\010\r\210Q\210c\220\021\220)\2301";
static const char __pyx_k_surfaces_but_you_asked_for_surf[] = " surfaces, but you asked for surface number ";
static const char __pyx_k_t_QfA_iq_b_HJb_9_1A_uBb_b_1_j_v[] = "\200\001\330\004\007\200t\210:\220Q\220f\230A\330\010\016\210i\220q\230\001\330\004\020\220\001\330\004\007\200\177\220b\230\001\330\010\014\210H\220J\230b\240\010\250\001\320)9\270\021\330\014\020\220\003\2201\220A\330\014\017\210u\220B\220b\230\002\230$\230b\240\003\2401\330\020\026\220j\240\001\240\021\330\014\017\210v\220X\230Q\330\020\031\230\027\240\002\240!\340\020\031\230\027\240\001\240\021\240!\340\010\014\210J\220a\330\014\020\220\003\2201\220F\230&\240\004\240F\250%\250r\260\021\330\014\017\210u\220B\220b\230\002\230$\230b\240\003\2401\330\020\026\220j\240\001\240\021\330\014\017\210v\220X\230Q\330\020\031\230\027\240\002\240!\340\020\031\230\027\240\001\240\021\240!\340\004\013\2101";
static const char __pyx_k_tetrahedra_shapes_were_inserted[] = "tetrahedra shapes were inserted";
static const char __pyx_k_undecorated_triangulation_isosi[] = "_undecorated_triangulation_isosig";
static const char __pyx_k_unsimplified_filled_triangulati[] = "_unsimplified_filled_triangulation.<locals>.genexpr";
static const char __pyx_k_A23562378_J_1_4_q_AQ_31A45454545[] = "\200A\33023\33056\33023\33078\330<=\360J\001\000\t1\260\001\330\010\013\2104\320\017 \240\007\240q\330\014\022\220*\230A\230Q\330\010\032\320\0323\2601\260A\33045\33045\33045\33045\330\010\014\320\014 \240\001\240\021\330\010\013\2101\330\014\020\320\020(\250\001";
static const char __pyx_k_A6_4_1_AQ_Qd_AQ_7_Q_aq_a_E_a_8_w[] = "\200A\3606\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\021\320\021%\240Q\240d\320*<\270A\270Q\330\010\013\2107\220#\220Q\330\014\022\220,\230a\230q\340\010\016\210a\330\010\014\210E\220\025\220a\320\0278\270\001\270\021\330\014\017\210w\220b\320\030)\250\021\330\020\033\2303\230a\320\037;\2701\270J\300a\330\020\032\230#\230Q\320\0369\270\021\270*\300A\330\020\026\320\0269\270\021\270*\300A\330\020\026\220a\340\010\034\230A\230Q\330\010\017\210~\230Q\230a";
static const char __pyx_k_A8_AT_4A_4A_0_gV6_Cs_t1_e3at_a_q[] = "\200A\3608\000\t\035\230A\230T\320!4\260A\360\n\000\t\033\230$\320\0364\260A\330\010\030\230\004\320\0340\260\001\360\006\000\t\017\210g\220V\2306\240\023\240C\240s\250!\330\010\020\220\001\330\010\017\210t\2201\330\010\016\210e\2203\220a\220t\320\033.\250a\330\014\027\220q\330\014\035\230Q\330\014#\2401\330\014\033\2301\330\014!\240\021\330\014 \240\001\330\014\023\2204\220q\330\014\r\340\020\027\220x\230t\2402\240Q\240f\250C\250z\270\021\330\020\026\220g\230U\240#\240Z\250q\330\020\031\230\024\230R\230q\240\001\330\020\030\230\007\230q\240\005\240Q\330!\"\340\020\036\230g\240Q\330\024#\2401\240I\250Q\330\020\034\230G\2401\330\024!\240\021\240)\2501\330\020!\240\027\250\001\330\024\025\220U\230%\230s\240+\250Q\340\020\033\2304\230y\250\001\250\021\330\020\"\240'\250\021\330\024!\240\021\240(\250!\340\020\037\230q\330\020\023\2204\220t\320\033/\250q\260\001\330\024#\2408\2504\250s\260)\2701\340\020$\240G\2501\330\024#\2401\240I\250X\260R\260q\270\001\360\006\000\021\030\220t\2302\230Q\230d\240!\2401\330\020\023\2205\230\003\2304\230q\330\024\025\340\014\021\220\027\230\001\330\021\036\230a\330\021$\240A\330\021\"\240!\330\021*\250!\330\021(\250\001\330\021\036\230d\240)\2501\250K\260q\270\006\270d\300!\330\021\036\230a\330\025\031\230\031\240!\240;\250a\250v\260T\270\036\300q\310\001\330\025\031\230\025\230e\2401\240B\240a\330\021\036\230k\250\021\250$\250h\260a\330\021'\240q\330\014\023\2204\220q\330\010\017\210q";
static const char __pyx_k_AFG_2Rr_Bb_AQ_4_1_AQ_1_4q_r_2S_1[] = "\200A\330FG\360\020\000\t)\250\001\360\006\000\t\014\2102\210R\210r\220\023\220B\220b\230\001\330\014\022\220*\230A\230Q\340\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\013\2101\330\014\020\320\020\"\240!\2404\240q\330\014\017\210r\220\022\2202\220S\230\003\2301\230A\330\020\026\220j\240\001\240\021\330\014\"\240'\250\026\250q\260\001\260\021\260!\2601\260A\330\014\020\220\003\2205\230\t\240\021\240!\330\020#\2401\240E\250\021\340\010\035\230Q\230d\240!\340\0104\260A\330\014\020\320\020\"\240!\2408\2503\250a\340\010\014\210A\210Q\340\010\017\320\017;\2701\270A";
static const char __pyx_k_A_0_4_1_4A9_B_29_x_4_1_AQ_4wgQ_q[] = "\200A\330)0\260\001\3304;\2701\330-4\260A\3309@\300\001\330;B\300!\33029\270\031\300!\360x\007\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\020\220\001\330\020\021\330\020\021\330\020\021\330\020\021\330\020\021\330\010\t\330\014\023\2204\220w\230g\240Q\320&?\270q\330\017\020\360\006\000\t\014\2101\330\014\025\320\025%\320%6\260a\330\020\026\220a\330\020'\240q\330\020 \240\001\330\020,\250A\330\020.\250a\330\020%\240Q\340\014\025\220T\320\031;\2701\330\020%\240Q\330\010\017\210t\2207\230%\230q\240\010\320(A\300\021";
static const char __pyx_k_A_1_4A_31_2_4_1_AQ_q_q_4wgQ_A_t7[] = "\200A\340$+\2501\330-4\260A\330,3\2601\330+2\260!\330\021\022\360>\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\020\320\020'\240q\330\020/\250q\330\010\t\330\014\023\2204\220w\230g\240Q\320&<\270A\330\017\020\360\006\000\t\020\210t\2207\230%\230q\320 0\260\001\260\027\270\001\330 6\260a";
static const char __pyx_k_A_1_A_U_66Gq_A_5_A_t1_q_81_a_E_j[] = "\200A\360\n\000\t\014\2101\330\014\027\220}\240A\330\020\025\220U\230&\320 6\3206G\300q\330\020\034\230A\330\0255\260_\300A\330\025'\240t\2501\330\025\"\240!\330\014\017\210q\330\020\033\2308\2401\330\020\030\230\006\230a\330\020\024\220E\230\021\230!\330\020\021\340\010\016\210j\230\001\230\021";
static const char __pyx_k_A_2T_Q_Qd_a_82Q_t7_s_A_l_A_7_Q_6[] = "\200A\330\010\021\220\032\2302\230T\240\027\250\005\250Q\330\010\022\220#\220Q\220d\230'\240\025\240a\330\010\013\2108\2202\220Q\330\014\017\210t\2207\230%\230s\240\"\240A\330\020\032\230!\340\020\032\230!\330\014\026\220l\240\"\240A\340\010\013\2107\220#\220Q\330\014\023\320\0236\260a\330\020\024\220A\330\020\021\330\020\024\220A\330\020!\240\021\240$\240a\330\020\024\220A\340\014\023\320\023.\250a\330\020\024\220A\330\020\021\330\020\024\220A\330\020!\240\021\240$\240a";
static const char __pyx_k_A_3avRr_WCt1A_6a_z_a_q_t5_4q_4uA[] = "\200A\330\010\013\2103\210a\210v\220R\220r\230\024\230W\240C\240t\2501\250A\330\014\023\320\0236\260a\330\020\030\230\013\240<\250z\270\021\340\014\023\320\023.\250a\330\020\030\230\013\240<\250q\330\010\017\210t\2205\230\001\230\021\230&\240\002\240!\2404\240q\250\003\2504\250u\260A";
static const char __pyx_k_A_4_3a_AQ_1_t_6a_e3at_a_A_G1F_iq[] = "\200A\360\"\000\t\014\2104\320\017#\2403\240a\330\014\022\220*\230A\230Q\330\010\023\2201\330\010\017\210t\320\023&\320&6\260a\330\010\016\210e\2203\220a\220t\320\033.\250a\330\014\020\220\004\220A\330\014\024\220G\2301\230F\240!\330\020\021\220\021\220$\220i\230q\240\013\2501\250F\260!\2601\260B\260a\260r\270\021\270!\330\022\026\220e\2305\240\001\240\024\240T\250\025\250e\2601\260A\330\014\023\2204\220q\330\010\017\210q";
static const char __pyx_k_A_4_3a_AQ_t_6a_e3at_a_T_wc_j_D_B[] = "\200A\360\"\000\t\014\2104\320\017#\2403\240a\330\014\022\220*\230A\230Q\340\010\020\220\001\340\010\017\210t\320\023&\320&6\260a\330\010\016\210e\2203\220a\220t\320\033.\250a\330\014\025\220T\230\021\340\014\017\210w\220c\230\021\330\020\026\220j\240\001\240\021\360\006\000\r\022\220\027\230\001\330\020 \240\001\330\024\034\230D\320 B\300!\340\014\023\2204\220q\340\010\017\210q";
static const char __pyx_k_A_4q_1_Cq_a_fAQ_e1_5Qa_QfAS_1_Cu[] = "\200A\360\010\000\t\014\2104\210q\330\014\022\320\022\"\240!\2401\340\010\014\210C\210q\220\004\320\024&\240a\330\010\021\220\021\220$\220f\230A\230Q\330\022\026\220e\2301\320\0345\260Q\260a\330\022\025\220Q\220f\230A\230S\240\003\2401\330\010\014\210C\210u\220I\230Q\230a\330\014\r\210Y\220a\220q\230\005\230S\240\002\240\"\240E\250\021\330\010\017\210q";
static const char __pyx_k_A_4t_AQ_AT_7q_1Cq_r_A_2S_1_4Ba_c[] = "\200A\360\020\000\t\014\2104\210t\220>\240\021\330\014\022\220*\230A\230Q\340\010$\240A\240T\250\021\330%&\320&7\260q\270\003\2701\270C\270q\300\001\340\010\017\210r\220\023\220A\340\010\013\2102\210S\220\001\330\014\023\2201\330\014\023\320\0234\260B\260a\330\r\016\210c\220\021\330\014\023\220=\320 5\260Q\330\014\025\220S\230\001\330\025\030\230\001\330\025\030\320\030,\250A\250Q\340\010\017\210q";
static const char __pyx_k_A_5_4z_q_vV2Q_1A_a_T_c_N_Q_1_RvQ[] = "\200A\360\006\000\t\014\2105\220\003\2204\220z\240\021\240!\330\014\020\320\020'\240q\250\001\250\030\260\021\260!\330\014\030\230\001\230\024\320\035/\250v\260V\2702\270Q\330\014\025\220^\2401\240A\330\014\022\220,\230a\340\014\025\220T\230\035\240c\250\021\330\020\024\220N\240#\240Q\330\020\033\2301\320\034-\250R\250v\260Q\260a\330\010\017\210t\2209\230A\230Q";
static const char __pyx_k_A_8_1_q_gS_0_G1_Ya_6_r_Ya_6_r_Ya[] = "\200A\330\010 \240\001\240\024\320%8\270\001\330\010\023\2201\330\010\021\220\026\220q\330\010\016\210g\220S\230\001\230\024\320\0350\260\001\330\014\024\220G\2301\330\021\025\220Y\230a\230{\250!\2506\260\026\260r\270\021\270!\330\021\025\220Y\230a\230{\250!\2506\260\026\260r\270\021\270!\330\021\025\220Y\230a\230{\250!\2506\260\026\260r\270\021\270!\330\014\025\220V\2301\330\010\017\210q";
static const char __pyx_k_A_8_1_q_gS_0_G1_t9A_vRq_9A_vRq_9[] = "\200A\330\010 \240\001\240\024\320%8\270\001\330\010\023\2201\330\010\021\220\026\220q\330\010\016\210g\220S\230\001\230\024\320\0350\260\001\330\014\024\220G\2301\330\021\037\230t\2409\250A\250[\270\001\270\026\270v\300R\300q\310\001\330\037#\2409\250A\250[\270\001\270\026\270v\300R\300q\310\001\330\037#\2409\250A\250[\270\001\270\026\270v\300R\300q\310\001\330\021\032\230$\230a\230v\240Q\330\021\"\240&\250\010\260\001\340\014\025\220V\2301\330\010\017\210q";
static const char __pyx_k_A_AT_4A_4A_t1_e3at_a_oQit2Qa__AY[] = "\200A\360\026\000\t\035\230A\230T\320!4\260A\330\010\032\230!\340\010\032\230$\320\0364\260A\340\010\017\210t\2201\330\010\016\210e\2203\220a\220t\320\033.\250a\340\014\021\220\027\230\001\330\021&\240o\260Q\260i\270t\3002\300Q\300a\330\021%\240_\260A\260Y\270d\300\"\300A\300Q\330\021\037\230t\2408\2501\340\014\023\2204\220q\340\010\017\210q";
static const char __pyx_k_A_Cq_E_aq_U_3a_1D_1_1D_2Rr_Bd_Bb[] = "\200A\360\014\000\t\r\210C\210q\220\001\340\010\014\210E\220\025\220a\220q\330\014\020\220\005\220U\230!\2303\230a\330\020\030\230\003\2301\230D\320 1\260\021\260!\2601\260D\270\001\270\021\270!\340\020\023\2202\220R\220r\230\023\230B\230d\240\"\240B\240b\250\003\2502\250T\260\022\2603\260b\270\002\270!\330\024\027\220v\230S\240\001\330\030\037\230q\330\025\026\330\024\033\2301\340\010\017\210q";
static const char __pyx_k_A_IQ_2T_e1D_s_G4q_q_e5_WCt_AS_4q[] = "\200A\360\010\000\t\r\210I\220Q\330\010\022\220!\2202\220T\230\025\230e\2401\240D\250\007\250s\260\"\260G\2704\270q\330\010\017\210q\220\002\220$\220e\2305\240\001\240\024\240W\250C\250t\260=\300\004\300A\300S\310\001\330\010\013\2104\210q\330\014\033\2301\230A\230R\230t\2405\250\001\340\014\033\2301\230A\230T\240\031\250$\250b\260\003\2604\260s\270$\270e\3001\330\034 \240\005\240Q\330\010\017\210v\220Q\220a";
static const char __pyx_k_A_Kq_T_Kq_d_E_aq_Q_Qe3at_1_7_Q_v[] = "\200A\360 \000\t\r\210K\220q\330\014\025\220T\230\037\250\001\330\014\r\340\010\014\210K\220q\330\014\030\230\001\330\014\r\340\010\016\210d\320\022\"\240/\260\021\330\010\014\210E\220\025\220a\220q\330\014\022\220#\220Q\330\010\021\220\034\230Q\230e\2403\240a\240t\320+;\2701\340\010\013\2107\220#\220Q\330\014\020\220\007\220v\230Q\230j\250\001\330\014\020\320\020.\250a\340\010\017\210q";
static const char __pyx_k_A_Qc_4z_81D_9G3d_e1BfA_1_s_T_9_A[] = "\200A\360\006\000\t\014\210:\220Q\220c\230\021\330\014\023\2204\220z\240\021\240!\2408\2501\250D\260\001\330\010\013\2109\220G\2303\230d\320\">\270e\3001\300B\300f\310A\330\010\032\320\0321\260\021\330\014\020\220\007\220s\230!\230:\240T\320)9\270\023\270A\270Q\330\010\013\320\013\033\2303\230a\330\014\021\220\021\220)\2301\330\014\022\220,\230a\230q\330\010\021\220\035\230a\230u\240A\330\010\016\320\016\"\240!\2401\330\010\016\210j\230\002\230#\230Q\230d\240#\240Q\240a\330\010\017\210v\320\025/\250q";
static const char __pyx_k_A_Qc_Zr_l_iq_j_1Ba_1D_Cq_a_1_3ax[] = "\200A\330\010\013\210:\220Q\220c\230\021\330\014\021\220\024\220Z\230r\240\021\330\014\016\210l\230$\230i\240q\250\001\330\014\016\210j\230\003\2301\230B\230a\330\014\022\220)\2301\230D\240\t\250\023\250C\250q\260\002\260,\270a\330\014\023\2201\340\014\023\2203\220a\220x\230r\240\024\240Y\250a\250q\330\014\025\220X\230Q\230a\330\014\022\220)\2301\230A\330\014\023\2201";
static const char __pyx_k_A_Qd_4AQ_G9D_ar_U_q_AQd_1BgQb_uA[] = "\200A\360\006\000\t\036\230Q\230d\320\"4\260A\260Q\330\010\021\220\021\330\010\014\210G\2209\230D\240\001\330\014\030\230\001\230\024\320\035.\250a\250r\260\037\300\001\300\021\330\031\035\230U\240%\240q\250\001\330\014\024\220A\220Q\220d\320\032+\2501\250B\250g\260Q\260b\270\001\270\021\330\026\032\230%\230u\240A\240T\250\024\250U\260%\260q\270\001\340\014\022\220'\230\022\230;\240a\330\010\037\230q\240\001\330\010\017\210q";
static const char __pyx_k_A_Qd_4AQ_a_E_at_4_aq_uE_waq_E_at[] = "\200A\360\006\000\t\036\230Q\230d\320\"4\260A\260Q\340\010\036\230a\330\010\014\210E\220\025\220a\220t\230?\250!\330\014\022\220!\2204\320\027(\250\001\250\022\250;\260a\260q\330\023\027\220u\230E\240\021\240!\330\014\037\230w\240a\240q\340\010\030\230\001\330\010\014\210E\220\025\220a\220t\230?\250!\330\014\020\220\005\220U\230!\2301\330\020\024\220E\230\025\230a\230q\330\024\037\230t\320#4\260A\260R\260v\270Q\270b\300\001\300\021\330\024\032\230!\2308\2401\240B\240a\240s\250$\250e\2605\270\001\270\023\270D\300\005\300U\310!\3101\330\024!\240\027\250\001\250\021\340\010\037\230q\240\001\330\010\020\320\020%\240Q";
static const char __pyx_k_A_a_4_1_AQ_4_9_Cr_AT_3a_r_1_1E_q[] = "\200A\360\024\000\t\031\230\001\330\010\016\210a\330\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\016\320\016\"\240!\2404\320'9\270\023\270C\270r\300\021\330\014\020\320\020$\240A\240T\320);\2703\270a\330\014\017\210r\220\022\2201\330\020\023\2201\220E\230\021\330\014\021\220\021\330\010\017\210q";
static const char __pyx_k_A_a_E_at_q_A_1A_AQ_AQ_Qd_4q_wa_k[] = "\200A\360\026\000\t\017\210a\330\010\014\210E\220\025\220a\220t\230?\250!\330\014'\240q\250\004\250A\330(+\2501\250A\330()\250\033\260A\260Q\330()\250\033\260A\260Q\330()\250\024\250Q\250d\260!\2604\260q\270\001\330()\250\037\270\001\270\021\330()\250\037\270\001\270\021\330()\250\027\260\001\260\027\270\001\270\027\300\001\300\021\330\014\017\210w\220a\330\021\031\230\021\330\021 \240\013\250;\260k\300\021\330\021\037\230\177\250a\330\037.\250a\330\021\035\230U\240!\2402\240U\250#\250R\250r\260\023\260B\260b\270\004\270E\300\025\300a\300q\330\035\"\240!\2402\240U\250#\250R\250r\260\023\260B\260b\270\004\270E\300\025\300a\300q\330\035\"\240!\2402\240U\250#\250R\250r\260\023\260B\260b\270\004\270E\300\025\300a\300q\330\035\"\240!\2402\240U\250#\250R\250r\260\023\260B\260b\270\004\270E\300\025\300a\300q\330\021\035\230T\240\031\250!\250>\270\021\270!\330\035!\240\031\250!\250>\270\021\270!\330\035!\240\031\250!\250>\270\021\270!\330\035!\240\031\250!\250>\270\021\270!\330\021#\2401\340\010\017\210q";
static const char __pyx_k_A_c_1_1_1_d_a_d_Q_O1D_Jaq__A_4uA[] = "\200A\360\024\000\t\014\210;\220c\230\021\330\014\033\2301\340\014\033\2301\340\010\017\320\017#\2401\330\014\020\320\020\"\240(\250!\340\010\021\220\021\330\010\016\210d\220!\330\010\026\220a\330\010\016\210d\220#\220Q\330\014\024\220O\2401\240D\250\001\330$%\330$(\250\001\330\014\020\220\004\220J\230a\230q\330\014\r\320\r!\240\021\240!\330\014\r\210_\230A\330\020\033\2304\230u\240A\330\020\033\230;\240a\240s\250!\330\020\033\2301\340\014\r\210Y\220a\220t\2301\230H\240B\240d\250\"\250D\260\001\260\027\270\002\270#\270R\270v\300Q\330\027\030\330\014\022\220'\230\021\230!\330\014\033\2301\330\014\022\220#\220Q\340\010 \240\001\240\021\330\010\017\210q";
static const char __pyx_k_A_e1_5Q7_a_0_F_QoQ_Q_4wgQ_1_t7_q[] = "\200A\330()\330).\250e\2601\330.5\260Q\3307>\270a\330)0\260\n\270!\360F\001\000\t\021\320\020 \240\005\240Q\240o\260Q\330\020-\250Q\330\010\t\330\014\023\2204\220w\230g\240Q\320&;\2701\330\017\020\360\006\000\t\020\210t\2207\230%\230q\240\017\250q\260\007\260q\330 5\260Q";
static const char __pyx_k_A_j_4_1_AQ_S_c_S_1M_Cq_Qa_AQ_q_1[] = "\200A\360\036\000\t\033\230$\230j\250\001\330\010\013\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\330\010\r\210S\220\001\220\035\230c\240\024\240S\250\003\2501\250M\270\023\270C\270q\300\005\300Q\300a\330\014\022\220*\230A\230Q\330\010\022\220'\230\026\230q\240\003\2401\240A\330\010\014\210E\220\025\220a\220q\330\014\023\2201\220E\230\033\240A\240Q\330\010\025\220Q\220d\320\032,\250A\330\010\014\210A\210Q";
static const char __pyx_k_A_non_existent_shape_data_type_w[] = "A non-existent shape data type was specified.";
static const char __pyx_k_A_qt_4_1_AQ_gQ_A_D_G6_3a_A__4E_j[] = "\200A\330)?\270q\360t\001\000\t\014\2104\320\017 \240\003\2401\330\014\022\220*\230A\230Q\340\010\013\210;\220g\230Q\330\014\031\230\033\240A\330\020\034\230D\240\n\250!\330\020\021\340\010\014\210G\2206\230\021\230(\240!\340\010\013\320\013\033\2303\230a\360\006\000\r\025\220A\220_\320$4\260E\270\021\270$\270j\310\001\330\014\023\2201\330\014\020\220\005\220Q\330\020\025\220Q\220a\220t\230:\240Q\240b\250\001\250\031\260%\260r\270\026\270q\330\020\024\320\024*\250!\2502\250S\260\001\260\025\260b\270\005\270Q\330\020\024\220G\2301\230A\230Q\230b\240\003\2401\240B\240a\330\014\017\210q\330\020\027\220q\340\r\035\230S\240\001\360\006\000\r\025\220A\220_\320$4\260E\270\021\270$\270j\310\001\330\014\023\2201\330\014\020\220\005\220Q\330\020\024\220D\230\n\240!\2402\240Q\240h\250e\2602\260V\2701\330\020\024\320\024*\250!\2502\250S\260\005\260Q\260b\270\005\270Q\330\020\024\220G\2301\230A\230Q\230b\240\003\2401\240B\240a\330\014\017\210q\330\020\027\220q\340\r\035\230S\240\001\330\014\017\210{\230'\240\021\330\020\026\220j\240\001\240\021\340\014\017\210q\330\020\033\230?\250&\260\001\260\024\260Z\270s\300!\33012\330\020.\250a\250t\3203E\300Q\330\020\027\220q\330\020\024\220E\230\025\230a\230t\240:\250Q\330\024\030\230\007\230q\240\002\240\"\240H\250A\250R\250q\260\002\260!\2604\260q\270\010\300\001\300\022\3001\300B\300a\300q\330\"$\240A\240X\250Q\250b\260\001\260\022\2601\260D\270\010\300\001\300\022\3001\300B\300a\300q\330\020\024\220A\220Q\330\020\027\220q\340\020&\240a\240t\2501\360\006\000\r\024\220=\320 6\260a\330\020\026\320\026'\240{\260!";
static const char __pyx_k_A_s_1AQb_Rq_2Rr_Baq_Bb_2Qar_3d_u[] = "\200A\330\010\017\210s\220!\2201\220A\220Q\220b\230\002\230#\230R\230q\240\001\240\022\2402\240R\240r\250\023\250B\250a\250q\260\002\260\"\260B\260b\270\003\2702\270Q\270a\270r\300\022\3003\300d\310%\310u\320TU\320UX\320XY\320Y\\\320\\_\320_`";
static const char __pyx_k_A_t5_D_Qat2Rr_T_d_Q_4uAT_b_Q_s_1[] = "\200A\360 \000\t\020\210t\2205\230\001\230\024\230[\250\001\330\010\024\220D\230\005\230Q\230a\230t\2402\240R\240r\250\024\250T\260\025\260d\270+\300Q\330\010\023\2204\220u\230A\230T\240\031\250!\250=\270\001\330\010\026\220b\230\005\230Q\330\014\r\320\r\037\230s\240!\2401\240A\330\r\022\220#\220V\2309\240A\240T\250\033\260A\340\010\020\220\001\340\023\031\230\033\240M\260\021";
static const char __pyx_k_A_t_Q_whd_a_E_at_Q_Cs_at1A_1Cq_S[] = "\200A\330\010\021\220\024\220\\\240\021\330\010\017\210t\220:\230Q\330\010\017\210w\220h\230d\240$\240a\330\010\014\210E\220\025\220a\220t\230:\240Q\330\014\021\220\033\230C\230s\240&\250\001\250\021\330\014\020\220\005\320\025&\240a\240t\2501\250A\330\014\023\2201\220C\220q\230\005\230S\240\001\240\025\240c\250\021\250!\330\014\021\220\027\230\001\230\022\2306\240\021\240!\330\014\021\220\027\230\001\230\022\2306\240\021\240!\330\014\021\220\027\230\001\230\022\2306\240\021\240!\330\010\020\320\020%\240T\320)9\270\030\300\021\330\010\017\210t\2205\230\001\230\021\230$\230e\2401\240B\240f\250A\330\032\036\230e\2401\240G\2507\260(\270\"\270A\270Q";
static const char __pyx_k_AbelianGroup_elementary_divisors[] = "AbelianGroup.elementary_divisors";
static const char __pyx_k_Acceptable_cusp_types_are_all_or[] = "Acceptable cusp types are ['all', 'orientable', 'nonorientable'].";
static const char __pyx_k_All_Dehn_filling_coefficients_mu[] = "All Dehn filling coefficients must be integers";
static const char __pyx_k_An_empty_triangulation_was_gener[] = "An empty triangulation was generated.";
static const char __pyx_k_Braids_must_have_at_least_2_stra[] = "Braids must have at least 2 strands.";
static const char __pyx_k_Browser_not_imported_Tk_CyOpenGL[] = "Browser not imported; Tk, CyOpenGL or pypng is probably missing.";
static const char __pyx_k_CCuspNeighborhood___reduce_cytho[] = "CCuspNeighborhood.__reduce_cython__";
static const char __pyx_k_CCuspNeighborhood___setstate_cyt[] = "CCuspNeighborhood.__setstate_cython__";
static const char __pyx_k_CCuspNeighborhood_get_displaceme[] = "CCuspNeighborhood.get_displacement";
static const char __pyx_k_CCuspNeighborhood_original_index[] = "CCuspNeighborhood.original_index";
static const char __pyx_k_CCuspNeighborhood_set_displaceme[] = "CCuspNeighborhood.set_displacement";
static const char __pyx_k_CCuspNeighborhood_stopping_displ[] = "CCuspNeighborhood.stopping_displacement";
static const char __pyx_k_CDirichletDomain__vertex_data_li[] = "CDirichletDomain._vertex_data_list";
static const char __pyx_k_CDirichletDomain__vertex_to_inde[] = "CDirichletDomain._vertex_to_index_dict";
static const char __pyx_k_CDirichletDomain_export_stl_line[] = "CDirichletDomain.export_stl (line 666)";
static const char __pyx_k_CDirichletDomain_length_spectrum[] = "CDirichletDomain.length_spectrum_dicts";
static const char __pyx_k_CDirichletDomain_manifold_line_5[] = "CDirichletDomain.manifold (line 509)";
static const char __pyx_k_CDirichletDomain_num_finite_vert[] = "CDirichletDomain.num_finite_vertices";
static const char __pyx_k_CDirichletDomain_num_ideal_verti[] = "CDirichletDomain.num_ideal_vertices";
static const char __pyx_k_CDirichletDomain_pairing_matrice[] = "CDirichletDomain.pairing_matrices";
static const char __pyx_k_CDirichletDomain_pairing_words_l[] = "CDirichletDomain.pairing_words (line 593)";
static const char __pyx_k_CDirichletDomain_triangulation_l[] = "CDirichletDomain.triangulation (line 524)";
static const char __pyx_k_CFundamentalGroup___reduce_cytho[] = "CFundamentalGroup.__reduce_cython__";
static const char __pyx_k_CFundamentalGroup___setstate_cyt[] = "CFundamentalGroup.__setstate_cython__";
static const char __pyx_k_CFundamentalGroup_character_vari[] = "CFundamentalGroup.character_variety_vars_and_polys";
static const char __pyx_k_CFundamentalGroup_gap_string_lin[] = "CFundamentalGroup.gap_string (line 376)";
static const char __pyx_k_CFundamentalGroup_generators_lin[] = "CFundamentalGroup.generators (line 239)";
static const char __pyx_k_CFundamentalGroup_longitude_line[] = "CFundamentalGroup.longitude (line 331)";
static const char __pyx_k_CFundamentalGroup_num_generators[] = "CFundamentalGroup.num_generators";
static const char __pyx_k_CFundamentalGroup_num_original_g[] = "CFundamentalGroup.num_original_generators";
static const char __pyx_k_CFundamentalGroup_original_gener[] = "CFundamentalGroup.original_generators";
static const char __pyx_k_CFundamentalGroup_peripheral_cur[] = "CFundamentalGroup.peripheral_curves";
static const char __pyx_k_CHolonomyGroup___setstate_cython[] = "CHolonomyGroup.__setstate_cython__";
static const char __pyx_k_Can_t_get_the_list_of_isometries[] = "Can't get the list of isometries for closed manifolds";
static const char __pyx_k_Christy_census_of_s_component_li[] = "Christy census of %s-component link complements in S^3";
static const char __pyx_k_Could_not_allocate_a_crossing_ta[] = "Could not allocate a crossing table.";
static const char __pyx_k_Could_not_certify_shape_interval[] = "Could not certify shape intervals, either there are degenerate shapes or the precision must be increased.";
static const char __pyx_k_Could_not_create_the_triangulati[] = "Could not create the triangulation.";
static const char __pyx_k_Elementary_divisors_must_be_give[] = "Elementary divisors must be given as a sequence.";
static const char __pyx_k_Equations_are_available_in_log_a[] = "Equations are available in 'log' and 'rect' forms only.";
static const char __pyx_k_Failed_to_allocate_memory_for_cu[] = "Failed to allocate memory for cusps";
static const char __pyx_k_Failed_to_allocate_memory_for_te[] = "Failed to allocate memory for tets.";
static const char __pyx_k_High_precision_shapes_must_be_co[] = "High precision shapes must be computed in the fixed alignment";
static const char __pyx_k_If_there_is_more_than_one_cusp_y[] = "If there is more than one cusp you must specify which one you\nare filling, e.g. M.dehn_fill((2,3),1)";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))";
static const char __pyx_k_IsToPermGroupHomomorphismByImage[] = "IsToPermGroupHomomorphismByImages";
static const char __pyx_k_Knots_in_S_3_which_appear_in_the[] = "Knots in S^3 which appear in the SnapPea Census";
static const char __pyx_k_LengthSpectrumFormatStringWithWo[] = "LengthSpectrumFormatStringWithWord";
static const char __pyx_k_Manifold__canonical_cells_are_te[] = "Manifold._canonical_cells_are_tetrahedra";
static const char __pyx_k_Manifold__canonical_retriangulat[] = "Manifold._canonical_retriangulation";
static const char __pyx_k_Manifold__choose_generators_info[] = "Manifold._choose_generators_info";
static const char __pyx_k_Manifold__cusp_cross_section_inf[] = "Manifold._cusp_cross_section_info";
static const char __pyx_k_Manifold__is_isometric_to_line_1[] = "Manifold._is_isometric_to (line 1552)";
static const char __pyx_k_Manifold__polish_hyperbolic_stru[] = "Manifold._polish_hyperbolic_structures";
static const char __pyx_k_Manifold_dirichlet_domain_line_3[] = "Manifold.dirichlet_domain (line 336)";
static const char __pyx_k_Manifold_filled_triangulation_li[] = "Manifold.filled_triangulation (line 402)";
static const char __pyx_k_Manifold_init_hyperbolic_structu[] = "Manifold.init_hyperbolic_structure";
static const char __pyx_k_Manifold_is_two_bridge_line_1647[] = "Manifold.is_two_bridge (line 1647)";
static const char __pyx_k_Manifold_length_spectrum_line_14[] = "Manifold.length_spectrum (line 1469)";
static const char __pyx_k_Manifold_must_be_pickled_with__t[] = "Manifold must be pickled with _to_string.";
static const char __pyx_k_Manifold_set_peripheral_curves_l[] = "Manifold.set_peripheral_curves (line 1289)";
static const char __pyx_k_Manifold_solution_type_line_1063[] = "Manifold.solution_type (line 1063)";
static const char __pyx_k_Manifold_splitting_surfaces_line[] = "Manifold.splitting_surfaces (line 1724)";
static const char __pyx_k_Manifold_symmetric_triangulation[] = "Manifold.symmetric_triangulation";
static const char __pyx_k_Manifold_without_hyperbolic_stru[] = "Manifold.without_hyperbolic_structure";
static const char __pyx_k_NeumannZagierTypeEquations___ini[] = "NeumannZagierTypeEquations.__init__";
static const char __pyx_k_NeumannZagierTypeEquations___rep[] = "NeumannZagierTypeEquations.__repr__";
static const char __pyx_k_NonalternatingKnotExteriors___in[] = "NonalternatingKnotExteriors.__init__";
static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.";
static const char __pyx_k_Number_of_opacities_does_not_mat[] = "Number of opacities does not match.";
static const char __pyx_k_Number_of_permutations_is_not_th[] = "Number of permutations is not the same as the number of generators";
static const char __pyx_k_ObsNonorientableClosedCensus___g[] = "ObsNonorientableClosedCensus.__getitem__";
static const char __pyx_k_ObsNonorientableClosedCensus___i[] = "ObsNonorientableClosedCensus.__init__";
static const char __pyx_k_ObsNonorientableCuspedCensus___i[] = "ObsNonorientableCuspedCensus.__init__";
static const char __pyx_k_ObsNonorientableCuspedCensus_loo[] = "ObsNonorientableCuspedCensus.lookup";
static const char __pyx_k_ObsOrientableClosedCensus___geti[] = "ObsOrientableClosedCensus.__getitem__";
static const char __pyx_k_ObsOrientableClosedCensus___init[] = "ObsOrientableClosedCensus.__init__";
static const char __pyx_k_Obstruction_class_has_wrong_leng[] = "Obstruction class has wrong length";
static const char __pyx_k_Please_specify_filled_or_complet[] = "Please specify 'filled' or 'complete'.";
static const char __pyx_k_PresentationMatrix___reduce_cyth[] = "PresentationMatrix.__reduce_cython__";
static const char __pyx_k_PresentationMatrix___setstate_cy[] = "PresentationMatrix.__setstate_cython__";
static const char __pyx_k_PresentationMatrix_simplified_ma[] = "PresentationMatrix.simplified_matrix";
static const char __pyx_k_Result_is_symplectic_up_to_facto[] = "Result is symplectic (up to factors of 2)";
static const char __pyx_k_SnapPea_failed_to_compute_any_pa[] = "SnapPea failed to compute any part of the symmetry group.";
static const char __pyx_k_SnapPea_failed_to_find_the_canon[] = "SnapPea failed to find the canonical triangulation.";
static const char __pyx_k_SnapPea_failed_to_read_the_censu[] = "SnapPea failed to read the census manifold.";
static const char __pyx_k_SnapPea_kernel_failed_when_compu[] = "SnapPea kernel failed when computing normal surfaces";
static const char __pyx_k_SnapPea_kernel_failed_when_split[] = "SnapPea kernel failed when splitting open along the given surface.";
static const char __pyx_k_SnapPy_has_no_data_on_links_with[] = "SnapPy has no data on links with %s components.";
static const char __pyx_k_Supported_cover_types_are_all_an[] = "Supported cover_types are 'all' and 'cyclic'.";
static const char __pyx_k_SymmetryGroup_abelian_descriptio[] = "SymmetryGroup.abelian_description";
static const char __pyx_k_SymmetryGroup_abelianization_lin[] = "SymmetryGroup.abelianization (line 236)";
static const char __pyx_k_SymmetryGroup_commutator_subgrou[] = "SymmetryGroup.commutator_subgroup";
static const char __pyx_k_SymmetryGroup_direct_product_des[] = "SymmetryGroup.direct_product_description";
static const char __pyx_k_SymmetryGroup_is_abelian_line_72[] = "SymmetryGroup.is_abelian (line 72)";
static const char __pyx_k_SymmetryGroup_is_amphicheiral_li[] = "SymmetryGroup.is_amphicheiral (line 197)";
static const char __pyx_k_SymmetryGroup_is_dihedral_line_1[] = "SymmetryGroup.is_dihedral (line 105)";
static const char __pyx_k_SymmetryGroup_is_full_group_line[] = "SymmetryGroup.is_full_group (line 30)";
static const char __pyx_k_SymmetryGroup_is_invertible_knot[] = "SymmetryGroup.is_invertible_knot";
static const char __pyx_k_SymmetryGroup_isometries_line_29[] = "SymmetryGroup.isometries (line 295)";
static const char __pyx_k_SymmetryGroup_polyhedral_descrip[] = "SymmetryGroup.polyhedral_description";
static const char __pyx_k_The_Chern_Simons_invariant_isn_t[] = "The Chern-Simons invariant isn't currently known.";
static const char __pyx_k_The_Dehn_filling_coefficients_mu[] = "The Dehn filling coefficients must be relatively prime integers.";
static const char __pyx_k_The_Dirichlet_Domain_was_compute[] = "The Dirichlet Domain was computed without include_words = True.";
static const char __pyx_k_The_Dirichlet_Domain_was_not_com[] = "The Dirichlet Domain was not computed.";
static const char __pyx_k_The_Dirichlet_construction_faile[] = "The Dirichlet construction failed.";
static const char __pyx_k_The_Dirichlet_domain_could_not_b[] = "The Dirichlet domain could not be triangulated; perhaps this is an orbifold group?";
static const char __pyx_k_The_Ford_domain_construction_fai[] = "The Ford domain construction failed.";
static const char __pyx_k_The_HoroballViewer_class_was_not[] = "The HoroballViewer class was not imported.";
static const char __pyx_k_The_Manifold_is_not_orientable_s[] = "The Manifold is not orientable, so its orientation can't be reversed.";
static const char __pyx_k_The_MorwenLinks_class_has_been_r[] = "The MorwenLinks class has been replaced by HTLinkExteriors. Please refer to the documentation for HTLinkExteriors.";
static const char __pyx_k_The_Morwen_8_tetrahedra_manifold[] = "The Morwen 8 tetrahedra manifold %s was not found.";
static const char __pyx_k_The_PolyhedronViewer_class_was_n[] = "The PolyhedronViewer class was not imported.";
static const char __pyx_k_The_SnapPea_kernel_couldn_t_comp[] = "The SnapPea kernel couldn't compute the homology presentation matrix";
static const char __pyx_k_The_Triangulation_is_already_ori[] = "The Triangulation is already orientable.";
static const char __pyx_k_The_curve_is_not_isotopic_to_a_g[] = "The curve is not isotopic to a geodesic.";
static const char __pyx_k_The_cusp_neighborhood_constructi[] = "The cusp neighborhood construction failed.";
static const char __pyx_k_The_data_given_do_not_have_the_r[] = "The data given do not have the right determinants.";
static const char __pyx_k_The_data_provided_are_invalid_fo[] = "The data provided are invalid for Klein bottle cusps.";
static const char __pyx_k_The_elementary_divisors_must_for[] = "The elementary divisors must form a divisibility chain\n";
static const char __pyx_k_The_empty_triangulation_has_no_n[] = "The empty triangulation has no name.";
static const char __pyx_k_The_full_symmetry_group_is_not_k[] = "The full symmetry group is not known.";
static const char __pyx_k_The_full_symmetry_group_not_know[] = "The full symmetry group not known.";
static const char __pyx_k_The_generator_data_does_not_star[] = "The generator data does not start with \"% Generators\"";
static const char __pyx_k_The_horoball_construction_failed[] = "The horoball construction failed.";
static const char __pyx_k_The_link_complement_s_was_not_fo[] = "The link complement %s was not found.";
static const char __pyx_k_The_method_must_be_fold_or_layer[] = "The method must be 'fold' or 'layered' or 'layered_and_marked'";
static const char __pyx_k_The_number_of_fillings_specified[] = "The number of fillings specified exceeds the number of cusps.";
static const char __pyx_k_The_peripheral_data_s_is_not_acc[] = "The peripheral data %s is not acceptable.";
static const char __pyx_k_The_specified_cusp_s_does_not_ex[] = "The specified cusp (%s) does not exist.";
static const char __pyx_k_The_specified_edge_index_s_is_in[] = "The specified edge index (%s) is invalid.";
static const char __pyx_k_The_specified_face_index_s_is_in[] = "The specified face index (%s) is invalid.";
static const char __pyx_k_The_specified_indices_to_be_fill[] = "The specified indices to be filled are beyond the actual number of cusps.";
static const char __pyx_k_The_specified_tetrahedron_s_does[] = "The specified tetrahedron (%s) does not exist.";
static const char __pyx_k_The_symmetry_group_has_only_d_el[] = "The symmetry group has only %d elements.";
static const char __pyx_k_The_symmetry_group_is_not_a_nont[] = "The symmetry group is not a nontrivial, nonabelian direct product.";
static const char __pyx_k_The_symmetry_group_is_not_abelia[] = "The symmetry group is not abelian.";
static const char __pyx_k_The_symmetry_group_is_not_polyhe[] = "The symmetry group is not polyhedral.";
static const char __pyx_k_The_triangulation_construction_f[] = "The triangulation construction failed.";
static const char __pyx_k_The_word_contains_a_non_generato[] = "The word contains a non-generator.";
static const char __pyx_k_This_census_does_not_support_man[] = "This census does not support manifold lookup";
static const char __pyx_k_To_permanently_fill_a_cusp_the_D[] = "To permanently fill a cusp, the Dehn filling coefficients must be relatively prime integers.";
static const char __pyx_k_Triangulation___reduce___line_88[] = "Triangulation.__reduce__ (line 888)";
static const char __pyx_k_Triangulation__from_bytes_line_7[] = "Triangulation._from_bytes (line 761)";
static const char __pyx_k_Triangulation__from_tetrahedra_g[] = "Triangulation._from_tetrahedra_gluing_data";
static const char __pyx_k_Triangulation__get_from_link_dat[] = "Triangulation._get_from_link_data";
static const char __pyx_k_Triangulation__get_tetrahedra_gl[] = "Triangulation._get_tetrahedra_gluing_data";
static const char __pyx_k_Triangulation__isomorphisms_to_l[] = "Triangulation._isomorphisms_to (line 995)";
static const char __pyx_k_Triangulation__marked_tetrahedra[] = "Triangulation._marked_tetrahedra";
static const char __pyx_k_Triangulation__num_fake_cusps_li[] = "Triangulation._num_fake_cusps (line 406)";
static const char __pyx_k_Triangulation__polish_hyperbolic[] = "Triangulation._polish_hyperbolic_structures";
static const char __pyx_k_Triangulation__presentation_matr[] = "Triangulation._presentation_matrix";
static const char __pyx_k_Triangulation__ptolemy_equations[] = "Triangulation._ptolemy_equations_identified_face_classes";
static const char __pyx_k_Triangulation__reindex_cusps_lin[] = "Triangulation._reindex_cusps (line 932)";
static const char __pyx_k_Triangulation__remove_finite_ver[] = "Triangulation._remove_finite_vertices";
static const char __pyx_k_Triangulation__to_bytes_line_723[] = "Triangulation._to_bytes (line 723)";
static const char __pyx_k_Triangulation__to_string_line_67[] = "Triangulation._to_string (line 677)";
static const char __pyx_k_Triangulation__undecorated_trian[] = "Triangulation._undecorated_triangulation_isosig";
static const char __pyx_k_Triangulation__unsimplified_fill[] = "Triangulation._unsimplified_filled_triangulation";
static const char __pyx_k_Triangulation_contains_cusps_onl[] = "Triangulation contains {} cusps, only accepts triangulations with 1 cusp";
static const char __pyx_k_Triangulation_cusp_info_line_123[] = "Triangulation.cusp_info (line 1230)";
static const char __pyx_k_Triangulation_dehn_fill_line_116[] = "Triangulation.dehn_fill (line 1160)";
static const char __pyx_k_Triangulation_edge_valences_line[] = "Triangulation.edge_valences (line 1436)";
static const char __pyx_k_Triangulation_filled_triangulati[] = "Triangulation.filled_triangulation";
static const char __pyx_k_Triangulation_gluing_equations_l[] = "Triangulation.gluing_equations (line 2108)";
static const char __pyx_k_Triangulation_gluing_equations_p[] = "Triangulation.gluing_equations_pgl";
static const char __pyx_k_Triangulation_has_finite_vertice[] = "Triangulation.has_finite_vertices";
static const char __pyx_k_Triangulation_homology_line_2311[] = "Triangulation.homology (line 2311)";
static const char __pyx_k_Triangulation_is_orientable_line[] = "Triangulation.is_orientable (line 451)";
static const char __pyx_k_Triangulation_num_cusps_line_387[] = "Triangulation.num_cusps (line 387)";
static const char __pyx_k_Triangulation_num_tetrahedra_lin[] = "Triangulation.num_tetrahedra (line 1148)";
static const char __pyx_k_Triangulation_ptolemy_generalize[] = "Triangulation.ptolemy_generalized_obstruction_classes";
static const char __pyx_k_Triangulation_ptolemy_obstructio[] = "Triangulation.ptolemy_obstruction_classes";
static const char __pyx_k_Triangulation_ptolemy_variety_li[] = "Triangulation.ptolemy_variety (line 1923)";
static const char __pyx_k_Triangulation_randomize_line_483[] = "Triangulation.randomize (line 483)";
static const char __pyx_k_Triangulation_reverse_orientatio[] = "Triangulation.reverse_orientation";
static const char __pyx_k_Triangulation_set_name_line_1093[] = "Triangulation.set_name (line 1093)";
static const char __pyx_k_Triangulation_set_peripheral_cur[] = "Triangulation.set_peripheral_curves";
static const char __pyx_k_Triangulation_symplectic_basis_l[] = "Triangulation.symplectic_basis (line 3258)";
static const char __pyx_k_Triangulation_triangulation_isos[] = "Triangulation.triangulation_isosig";
static const char __pyx_k_Triangulation_with_hyperbolic_st[] = "Triangulation.with_hyperbolic_structure";
static const char __pyx_k_Verified_and_arbitrary_precision[] = "Verified and arbitrary precision computation of cusp_info only implemented for cusp shapes. Pass 'shape' as first argument to cusp_info().";
static const char __pyx_k_Warning_Result_is_not_symplectic[] = "Warning: Result is not symplectic";
static const char __pyx_k_Words_must_be_represented_as_Pyt[] = "Words must be represented as Python strings.";
static const char __pyx_k_You_have_specified_a_Hoste_Thist[] = "You have specified a Hoste-Thistlethwaite knot with an \ninappropriate index or number of crossings.";
static const char __pyx_k_You_must_apply_fillings_to_all_o[] = "You must apply 'fillings' to all of the cusps.";
static const char __pyx_k_You_must_apply_shortest_to_all_o[] = "You must apply 'shortest' to all of the cusps.";
static const char __pyx_k_You_provided_filling_data_for_to[] = "You provided filling data for too many cusps.  There are only %s.";
static const char __pyx_k_You_provided_more_peripheral_dat[] = "You provided more peripheral data than there are cusps.";
static const char __pyx_k_You_tried_to_create_an_empty_Sym[] = "You tried to create an *empty* SymmetryGroup.";
static const char __pyx_k_all_tetrahedra_positively_orient[] = "all tetrahedra positively oriented";
static const char __pyx_k_character_variety_vars_and_polys[] = "character_variety_vars_and_polys";
static const char __pyx_k_contains_negatively_oriented_tet[] = "contains negatively oriented tetrahedra";
static const char __pyx_k_cython_core_cusp_neighborhoods_p[] = "cython/core/cusp_neighborhoods.pyx";
static const char __pyx_k_cython_core_fundamental_group_py[] = "cython/core/fundamental_group.pyx";
static const char __pyx_k_get_generalized_ptolemy_obstruct[] = "get_generalized_ptolemy_obstruction_classes";
static const char __pyx_k_get_triangulation_tester_line_11[] = "get_triangulation_tester (line 117)";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_ptolemy_equations_boundary_map_2[] = "_ptolemy_equations_boundary_map_2";
static const char __pyx_k_ptolemy_equations_boundary_map_3[] = "_ptolemy_equations_boundary_map_1";
static const char __pyx_k_sage_groups_perm_gps_permgroup_e[] = "sage.groups.perm_gps.permgroup_element";
static const char __pyx_k_the_gap_method_for_covers_requir[] = "the \"gap\" method for covers requires Sage";
static const char __pyx_k_the_magma_method_for_covers_requ[] = "the \"magma\" method for covers requires Sage";
static const char __pyx_k_A_FundamentalGroup_represents_a_2[] = "\n    A FundamentalGroup represents a presentation of the fundamental\n    group of a SnapPea Triangulation.  Group elements are described as\n    words in the generators a,b,..., where the inverse of a is denoted\n    A.  Words are represented by python strings (and the concatenation\n    operator is named '+', according to Python conventions).\n\n    Instantiate via ``T.fundamental_group()``, where T is a triangulation:\n\n    >>> T = Triangulation('m125')\n    >>> T.fundamental_group()\n    Generators:\n       a,b\n    Relators:\n       aabaBBAABAbb\n    >>> type(T.fundamental_group()) #doctest: +SKIP\n    <class 'SnapPy.FundamentalGroup'>\n\n    A HolonomyGroup is a FundamentalGroup with added structure\n    consisting of a holonomy representation into O(3,1), and an\n    arbitrarily chosen lift of the holonomy representation to SL(2,C).\n    The holonomy is determined by the shapes of the tetrahedra, so a\n    HolonomyGroup is associated to a Manifold, while a Triangulation\n    only has a FundamentalGroup:\n\n    Instantiate via ``M.fundamental_group()``, where M is a Manifold:\n\n    >>> M = Manifold('m125')\n    >>> G = M.fundamental_group()\n    >>> G\n    Generators:\n       a,b\n    Relators:\n       aabaBBAABAbb\n    >>> type(G) #doctest: +SKIP\n    <class 'SnapPy.HolonomyGroup'>\n\n    In the class HolonomyGroup, methods are provided to evaluate the\n    representations on a group element. Other methods are shared\n    with the FundamentalGroup class.\n\n    >>> G.O31('a') # doctest: +NUMERIC12\n    [    2.50000000000000   -0.500000000000000    -2.12132034355964   -0.707106781186547]\n    [   0.500000000000002   -0.500000000000001   -0.707106781186549    0.707106781186547]\n    [  -0.707106781186548   -0.707106781186547     1.00000000000000                    0]\n    [    2.12132034355964   -0.707106781186548    -2.00000000000000    -1.00000000000000]\n    >>> G.SL2C('aaB') # doctest: +NUMERIC12\n    [-1.00000000000000 + 4.00000000000000*I 2.12132034355""964 - 0.707106781186545*I]\n    [2.12132034355964 - 0.707106781186549*I -1.00000000000000 - 1.00000000000000*I]\n    >>> G.complex_length('ab') # doctest: +NUMERIC12\n    1.06127506190504 - 2.23703575928741*I\n    ";
static const char __pyx_k_Base_class_for_Iterators_Sequen_2[] = "\n    Base class for Iterators/Sequences for knots from the\n    Hoste-Thistlethwaite tables.\n    ";
static const char __pyx_k_CFundamentalGroup_generators_in_2[] = "CFundamentalGroup.generators_in_originals (line 177)";
static const char __pyx_k_Return_whether_the_symmetry_gro_2[] = "\n        Return whether the symmetry group is dihedral.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_dihedral()\n        True\n        ";
static const char __pyx_k_Returns_True_if_and_only_if_the_2[] = "\n        Returns True if and only if the canonical\n        cell decomposition is a triangulation.\n\n        >>> Manifold('K4a1')._canonical_cells_are_tetrahedra()\n        True\n        >>> Manifold('L6a4')._canonical_cells_are_tetrahedra()\n        False\n        ";
static const char __pyx_k_Returns_a_word_representing_a_c_2[] = "\n        Returns a word representing a conjugate of the current\n        longitude for the given cusp.  Guaranteed to commute with the\n        meridian for the same cusp.  Note: for Klein bottle cusps,\n        the longitude must be defined carefully.\n\n        >>> G = Manifold('m004').fundamental_group()\n        >>> G.longitude(0)\n        'aBAbABab'\n        >>> G.longitude()   # shortcut for the above.\n        'aBAbABab'\n        ";
static const char __pyx_k_Returns_an_info_object_containi_2[] = "\n        Returns an info object containing information about the given\n        cusp.   Usage:\n\n        >>> M = Manifold('v3227(0,0)(1,2)(3,2)')\n        >>> M.cusp_info(1)\n        Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0)\n\n        To get more detailed information about the cusp, we do\n\n        >>> c = M.cusp_info(0)\n        >>> c.shape # doctest: +NUMERIC6\n        0.11044502 + 0.94677098*I\n        >>> c.modulus# doctest: +NUMERIC6\n        -0.12155872 + 1.04204128*I\n        >>> sorted(c.keys())\n        ['filling', 'holonomies', 'holonomy_accuracy', 'index', 'is_complete', 'modulus', 'shape', 'shape_accuracy', 'topology']\n\n        Here 'shape' is the shape of the cusp, i.e.\n        (longitude/meridian)\n        and 'modulus' is its shape in the geometrically preferred\n        basis, i.e.\n        ( (second shortest translation)/(shortest translation)).\n        For cusps that are filled, one instead cares about the\n        holonomies:\n\n        >>> M.cusp_info(-1)['holonomies'] # doctest: +NUMERIC6\n        (-0.59883089 + 1.09812548*I, 0.89824633 + 1.49440443*I)\n\n        The complex numbers returned for the shape and for the two\n        holonomies have an extra attribute, accuracy, which is\n        SnapPea's *estimate* of their accuracy.\n\n        You can also get information about multiple cusps at once:\n\n        >>> M.cusp_info() # doctest: +NUMERIC6\n        [Cusp 0 : complete torus cusp of shape 0.11044502 + 0.94677098*I,\n         Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0),\n         Cusp 2 : torus cusp with Dehn filling coefficients (M, L) = (3.0, 2.0)]\n        >>> M.cusp_info('is_complete')\n        [True, False, False]\n\n        The cusp shapes can be verified::\n\n            sage: M = Manifold('m292')\n            sage: M.cusp_info('shape', verified = True, bits_prec = 60) # doctest: +NUMERIC12\n            [-0.1766049820997? + 1.2028208192855?*I,\n             -0.17660498""20997? + 1.2028208192855?*I]\n\n        ";
static const char __pyx_k_Returns_the_obstruction_classes_2[] = "\n        Returns the obstruction classes needed to compute\n        PGL(N,C)-representations for any N, i.e., it returns a list with\n        a representative cocycle for each element in\n        H^2(M, boundary M; Z/N) / (Z/N)^* where (Z/N)^* are the units in Z/N.\n        The first element in the list always corresponds to the trivial\n        obstruction class.\n        The generalized ptolemy obstruction classes are thus a generalization\n        of the ptolemy obstruction classes that allow to find all\n        boundary-unipotent\n        PGL(N,C)-representations including those that do not lift to\n        boundary-unipotent SL(N,C)-representations for N odd or\n        SL(N,C)/{+1,-1}-representations for N even.\n\n        For example, 4_1 has three obstruction classes up to equivalence:\n\n        >>> M = Manifold(\"4_1\")\n        >>> c = M.ptolemy_generalized_obstruction_classes(4)\n        >>> len(c)\n        3\n\n        For 4_1, we only get three obstruction classes even though we have\n        H^2(M, boundary M; Z/4) = Z/4 because the two obstruction classes\n        1 in Z/4 and -1 in Z/4 are related by a unit and thus give\n        isomorphic Ptolemy varieties.\n\n        The primary use of an obstruction class sigma is to construct the\n        Ptolemy variety of sigma. This variety computes boundary-unipotent\n        PGL(N,C)-representations whose obstruction class to a\n        boundary-unipotent lift to SL(N,C) is sigma.\n\n        For example for 4_1, there are 2 obstruction classes for N = 3:\n\n        >>> M = Manifold(\"4_1\")\n        >>> c = M.ptolemy_generalized_obstruction_classes(3)\n        >>> len(c)\n        2\n\n        The Ptolemy variety parametrizing boundary-unipotent\n        SL(3,C)-representations of 4_1 is obtained by\n\n        >>> p = M.ptolemy_variety(N = 3, obstruction_class = c[0])\n\n        and the Ptolemy variety parametrizing boundary-unipotent\n        PSL(3,C)-representations of 4_1 that do not lift to\n        b""oundary-unipotent SL(3,C)-representations is obtained by\n\n        >>> p = M.ptolemy_variety(N = 3, obstruction_class = c[1])\n\n        The cocycle representing the non-trivial obstruction class looks as\n        follows:\n\n        >>> c[1]\n        PtolemyGeneralizedObstructionClass([2, 0, 0, 1])\n\n        This means that the cocycle takes the value -1 in Z/3 on the first face\n        class and 1 on the fourth face class but zero on every other of the\n        four face classes.\n        ";
static const char __pyx_k_Set_the_Dehn_filling_coefficien_2[] = "\n        Set the Dehn filling coefficients of the cusps.  This can be\n        specified in the following ways, where the cusps are numbered\n        by 0,1,...,(num_cusps - 1).\n\n        - Fill cusp 2:\n\n          >>> M = Manifold('8^4_1')\n          >>> M.dehn_fill((2,3), 2)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(0,0)\n\n        - Fill the last cusp:\n\n          >>> M.dehn_fill((1,5), -1)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(1,5)\n\n        - Fill the first two cusps:\n\n          >>> M.dehn_fill( [ (3,0), (1, -4) ])\n          >>> M\n          8^4_1(3,0)(1,-4)(2,3)(1,5)\n\n        - When there is only one cusp, there's a shortcut\n\n          >>> N = Manifold('m004')\n          >>> N.dehn_fill( (-3,4) )\n          >>> N\n          m004(-3,4)\n\n        Does not return a new Manifold.\n        ";
static const char __pyx_k_SymmetryGroup_is_direct_product_2[] = "SymmetryGroup.is_direct_product (line 156)";
static const char __pyx_k_SymmetryGroup_multiply_elements_2[] = "SymmetryGroup.multiply_elements (line 276)";
static const char __pyx_k_The_data_provided_does_not_give_2[] = "The data provided does not give a basis.";
static const char __pyx_k_Triangulation_fundamental_group_2[] = "Triangulation.fundamental_group (line 2346)";
static const char __pyx_k_Triangulation_orientation_cover_2[] = "Triangulation.orientation_cover (line 422)";
static const char __pyx_k_WARNING_Users_should_not_use_th_2[] = "\n        WARNING: Users should not use this function directly.  To\n        create a Triangulation or Manifold or ManifoldHP from an isosig,\n        simply do:\n\n        >>> M = Manifold('empty')\n        >>> M._from_isosig('jLAwLMQbcbdghgiiixxnxhhxkwv')\n        >>> N = Manifold('o9_10894')\n        >>> M == N\n        True\n\n        Fill an empty Triangulation from an isosig generated by\n        triangulation_isosig.\n        ";
static const char __pyx_k_WARNING_Users_should_not_use_th_3[] = "\n        WARNING: Users should not use this function directly.  To create a\n        Manifold or ManifoldHP from a string containing the contents\n        of a triangulation file, simply do:\n\n        >>> M = Manifold('7_4')\n        >>> seed = M._to_string()\n        >>> N = Manifold(seed)\n        >>> N.volume() # doctest: +NUMERIC6\n        5.13794120\n        ";
static const char __pyx_k_unsimplified_filled_triangulati_2[] = "_unsimplified_filled_triangulation";
static const char __pyx_k_CDirichletDomain_length_spectrum_2[] = "CDirichletDomain.length_spectrum_dicts (line 236)";
static const char __pyx_k_CDirichletDomain_pairing_matrice_2[] = "CDirichletDomain.pairing_matrices (line 564)";
static const char __pyx_k_CFundamentalGroup_character_vari_2[] = "CFundamentalGroup.character_variety_vars_and_polys (line 420)";
static const char __pyx_k_CFundamentalGroup_original_gener_2[] = "CFundamentalGroup.original_generators (line 152)";
static const char __pyx_k_CFundamentalGroup_peripheral_cur_2[] = "CFundamentalGroup.peripheral_curves (line 357)";
static const char __pyx_k_Manifold__canonical_cells_are_te_2[] = "Manifold._canonical_cells_are_tetrahedra (line 249)";
static const char __pyx_k_Manifold__canonical_retriangulat_2[] = "Manifold._canonical_retriangulation (line 170)";
static const char __pyx_k_Manifold_symmetric_triangulation_2[] = "Manifold.symmetric_triangulation (line 528)";
static const char __pyx_k_Manifold_without_hyperbolic_stru_2[] = "Manifold.without_hyperbolic_structure (line 863)";
static const char __pyx_k_SnapPea_kernel_failed_when_compu_2[] = "SnapPea kernel failed when computing normal surfaces.";
static const char __pyx_k_SymmetryGroup_abelian_descriptio_2[] = "SymmetryGroup.abelian_description (line 84)";
static const char __pyx_k_SymmetryGroup_commutator_subgrou_2[] = "SymmetryGroup.commutator_subgroup (line 218)";
static const char __pyx_k_SymmetryGroup_direct_product_des_2[] = "SymmetryGroup.direct_product_description (line 169)";
static const char __pyx_k_SymmetryGroup_is_invertible_knot_2[] = "SymmetryGroup.is_invertible_knot (line 207)";
static const char __pyx_k_Triangulation__from_tetrahedra_g_2[] = "Triangulation._from_tetrahedra_gluing_data (line 791)";
static const char __pyx_k_Triangulation__ptolemy_equations_2[] = "Triangulation._ptolemy_equations_identified_coordinates";
static const char __pyx_k_Triangulation__ptolemy_equations_3[] = "Triangulation._ptolemy_equations_action_by_decoration_change";
static const char __pyx_k_Triangulation__ptolemy_equations_4[] = "Triangulation._ptolemy_equations_boundary_map_3";
static const char __pyx_k_Triangulation__ptolemy_equations_5[] = "Triangulation._ptolemy_equations_boundary_map_2";
static const char __pyx_k_Triangulation__ptolemy_equations_6[] = "Triangulation._ptolemy_equations_boundary_map_1";
static const char __pyx_k_Triangulation__remove_finite_ver_2[] = "Triangulation._remove_finite_vertices (line 314)";
static const char __pyx_k_Triangulation__unsimplified_fill_2[] = "Triangulation._unsimplified_filled_triangulation (line 1353)";
static const char __pyx_k_Triangulation_filled_triangulati_2[] = "Triangulation.filled_triangulation (line 1303)";
static const char __pyx_k_Triangulation_gluing_equations_p_2[] = "Triangulation.gluing_equations_pgl (line 1457)";
static const char __pyx_k_Triangulation_has_finite_vertice_2[] = "Triangulation.has_finite_vertices (line 2911)";
static const char __pyx_k_Triangulation_ptolemy_generalize_2[] = "Triangulation.ptolemy_generalized_obstruction_classes (line 1858)";
static const char __pyx_k_Triangulation_ptolemy_obstructio_2[] = "Triangulation.ptolemy_obstruction_classes (line 1796)";
static const char __pyx_k_Triangulation_reverse_orientatio_2[] = "Triangulation.reverse_orientation (line 1286)";
static const char __pyx_k_Triangulation_triangulation_isos_2[] = "Triangulation.triangulation_isosig (line 2938)";
static const char __pyx_k_Triangulation_with_hyperbolic_st_2[] = "Triangulation.with_hyperbolic_structure (line 614)";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_8SnapPyHP_is_GapElement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_elt); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_2is_MagmaElement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_elt); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_4valid_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i, PyObject *__pyx_v_n, PyObject *__pyx_v_format_str); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_5MsgIO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_6to_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8bytearray_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_10to_byte_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12set_test_flag(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_value); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14SnapPea_interrupt(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16cy_eval(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18smith_form(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_M); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_20check_SnapPea_memory(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_22set_rand_seed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_22MatrixWithExplanations___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mat, PyObject *__pyx_v_explain_rows, PyObject *__pyx_v_explain_columns); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_22MatrixWithExplanations_8__repr___format_explain_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_22MatrixWithExplanations_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__type_str); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_26NeumannZagierTypeEquations___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mat, PyObject *__pyx_v_explain_rows, PyObject *__pyx_v_explain_columns); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_26NeumannZagierTypeEquations_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_4Info_2_immutable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_4Info_4keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8CuspInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13DualCurveInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14_StrLongestLen_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_24_StrLongestLen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18LengthSpectrumInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_9ShapeInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17NormalSurfaceInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14LengthSpectrum___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14ListOnePerLine___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_26format_two_by_two(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Isometry___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cusp_images, PyObject *__pyx_v_cusp_maps, PyObject *__pyx_v_extends_to_link); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Isometry_2cusp_images(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Isometry_4cusp_maps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Isometry_6extends_to_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Isometry_8num_cusps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Isometry_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_28_plink_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_LE); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_30Manifold_from_Triangulation(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_T, PyObject *__pyx_v_recompute, PyObject *__pyx_v_manifold_class); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_32Triangulation_from_Manifold(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M); /* proto */
static int __pyx_pf_8SnapPyHP_13Triangulation___cinit__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_2_get_from_link_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_4_remove_finite_vertices(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_6cover_info(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_8plink(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_10link(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_12num_cusps(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_cusp_type); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_14_num_fake_cusps(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_16orientation_cover(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_18is_orientable(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_20copy(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_22randomize(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_blowup_multiple, PyObject *__pyx_v_passes_at_fours); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_24simplify(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_passes_at_fours); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_26_two_to_three(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_tet_num, PyObject *__pyx_v_face_index); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_28_three_to_two(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_tet_num, PyObject *__pyx_v_edge_index); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_30with_hyperbolic_structure(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_32_polish_hyperbolic_structures(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_34_empty_save(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_36save(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_file_name); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_38_to_string(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_40_from_string(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_42_to_bytes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_44_from_bytes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_bytestring, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_46_from_pickle(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_bytestring, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_48_from_tetrahedra_gluing_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_tetrahedra_data, PyObject *__pyx_v_num_or_cusps, PyObject *__pyx_v_num_nonor_cusps, PyObject *__pyx_v_cusp_indices, PyObject *__pyx_v_peripheral_curves, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_50_from_isosig(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_isosig, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_52__reduce__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_54pickle(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_56_reindex_cusps(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_permutation); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_58_get_cusp_indices_and_peripheral_curve_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_60_get_tetrahedra_gluing_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_62_isomorphisms_to(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_64isomorphisms_to(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other); /* proto */
static void __pyx_pf_8SnapPyHP_13Triangulation_66__dealloc__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_68__richcmp__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_70__repr__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_72name(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_74set_name(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_new_name); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_76DT_code(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_flips); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_78_set_DTcode(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_code, PyObject *__pyx_v_lazy); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_80_set_PDcode(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_code); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_82num_tetrahedra(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_84dehn_fill(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_filling_data, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_86cusp_info(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_data_spec); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_88reverse_orientation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_90filled_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_cusps_to_fill); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_34_unsimplified_filled_triangulation_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_92_unsimplified_filled_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_method); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_94_marked_tetrahedra(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_clear_marks); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_96edge_valences(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_98gluing_equations_pgl(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_equation_type); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_100_ptolemy_equations_identified_face_classes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_102_ptolemy_equations_identified_coordinates(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_obstruction_class); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_104_ptolemy_equations_action_by_decoration_change(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, int __pyx_v_N); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_106_ptolemy_equations_boundary_map_3(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_108_ptolemy_equations_boundary_map_2(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_110_ptolemy_equations_boundary_map_1(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_112ptolemy_obstruction_classes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_114ptolemy_generalized_obstruction_classes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_116ptolemy_variety(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_obstruction_class, PyObject *__pyx_v_simplify, PyObject *__pyx_v_eliminate_fixed_ptolemys); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_118gluing_equations(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_form); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_120_presentation_matrix(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_pf_8SnapPyHP_13Triangulation_122homology(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_124fundamental_group(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_simplify_presentation, PyObject *__pyx_v_fillings_may_affect_generators, PyObject *__pyx_v_minimize_number_of_generators, PyObject *__pyx_v_try_hard_to_shorten_relators); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_5cover_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_126cover(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_permutation_rep); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_128covers(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_17_covers_low_index_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_subgroup); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_130_covers_low_index(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_num_threads); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_132_covers_gap(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_134_covers_magma(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_136_covers_snappea(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_cover_type); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_138set_peripheral_curves(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_peripheral_data, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_return_matrices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_140has_finite_vertices(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_142triangulation_isosig(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_decorated, PyObject *__pyx_v_ignore_cusp_ordering, PyObject *__pyx_v_ignore_curves, PyObject *__pyx_v_ignore_curve_orientations, PyObject *__pyx_v_ignore_filling_orientations, PyObject *__pyx_v_ignore_orientation); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_144_undecorated_triangulation_isosig(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_ignore_orientation); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_146_symplectic_form(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_u, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_148_is_symplectic(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_M); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_150symplectic_basis(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_verify); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_6_cache___get__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_2LE___get__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self); /* proto */
static int __pyx_pf_8SnapPyHP_8Manifold___init__(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_spec); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_2_number_(PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_4use_field_conversion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_6init_hyperbolic_structure(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_force_recompute); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_8canonize(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_10_canonical_retriangulation(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_opacities, PyObject *__pyx_v_top_level_tries); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_12_canonical_cells_are_tetrahedra(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_14_from_string(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_initialize_structure); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_16_from_bytes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_bytestring, PyObject *__pyx_v_initialize_structure); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_18_from_isosig(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_isosig, PyObject *__pyx_v_initialize_structure); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_20copy(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_22cusp_neighborhood(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_24dirichlet_domain(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_vertex_epsilon, PyObject *__pyx_v_displacement, PyObject *__pyx_v_centroid_at_origin, PyObject *__pyx_v_maximize_injectivity_radius, PyObject *__pyx_v_include_words); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_26browse(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_28filled_triangulation(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_cusps_to_fill); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_30fundamental_group(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_simplify_presentation, PyObject *__pyx_v_fillings_may_affect_generators, PyObject *__pyx_v_minimize_number_of_generators, PyObject *__pyx_v_try_hard_to_shorten_relators); /* proto */
static struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_pf_8SnapPyHP_8Manifold_32symmetry_group(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_of_link); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_34symmetric_triangulation(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_36cover(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_permutation_rep); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_38covers(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_40_complex_volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_42volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_accuracy, PyObject *__pyx_v_verified, PyObject *__pyx_v_bits_prec); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_44chern_simons(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_accuracy); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_46without_hyperbolic_structure(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_48_polish_hyperbolic_structures(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_50tetrahedra_shapes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_part, PyObject *__pyx_v_fixed_alignment, PyObject *__pyx_v_bits_prec, PyObject *__pyx_v_dec_prec, PyObject *__pyx_v_intervals); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_52_get_tetrahedra_shapes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_which_solution); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_54set_tetrahedra_shapes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_filled_shapes, PyObject *__pyx_v_complete_shapes, PyObject *__pyx_v_fillings); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_56solution_type(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_enum); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_58set_target_holonomy(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_recompute); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_60cusp_info(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_data_spec, PyObject *__pyx_v_verified, PyObject *__pyx_v_bits_prec); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_62dehn_fill(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_filling_data, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_64set_peripheral_curves(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_peripheral_data, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_return_matrices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_66dual_curves(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_max_segments); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_68length_spectrum(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_full_rigor, PyObject *__pyx_v_grouped, PyObject *__pyx_v_include_words); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_70drill(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_which_curve, PyObject *__pyx_v_max_segments); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_72_is_isometric_to(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_other, PyObject *__pyx_v_return_isometries); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_74is_isometric_to(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_other, PyObject *__pyx_v_return_isometries); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_76is_two_bridge(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_78_choose_generators(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_compute_corners, PyObject *__pyx_v_centroid_at_origin); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_80_choose_generators_info(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_82splitting_surfaces(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_84split(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_which_surface); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_86_identify(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_extends_to_link); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_88_cusp_cross_section_info(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_8Manifold_90_precision(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self); /* proto */
static int __pyx_pf_8SnapPyHP_12AbelianGroup___init__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_presentation, PyObject *__pyx_v_elementary_divisors); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_2__repr__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_8SnapPyHP_12AbelianGroup_4__len__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_6__getitem__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_8__reduce__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_10__richcmp__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self, struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_other, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_12__call__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_14elementary_divisors(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_16rank(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_18betti_number(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_20order(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_12coefficients___get__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static int __pyx_pf_8SnapPyHP_12AbelianGroup_12coefficients_2__set__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8SnapPyHP_12AbelianGroup_12coefficients_4__del__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self); /* proto */
static int __pyx_pf_8SnapPyHP_18PresentationMatrix___init__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_2get_data(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self); /* proto */
static int __pyx_pf_8SnapPyHP_18PresentationMatrix_4__setitem__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_6__getitem__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_8__repr__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_10add_rows(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_12row_op(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j, PyObject *__pyx_v_m); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_14explode(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_16simplify(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_18simplified_matrix(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_20__reduce_cython__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_22__setstate_cython__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_34inverse_list_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_36reduce_list_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_38_letter_seperator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_verbose_form); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_40word_as_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word, int __pyx_v_num_generators); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12list_as_word_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_42list_as_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_int_list, int __pyx_v_num_generators, PyObject *__pyx_v_verbose_form); /* proto */
static int __pyx_pf_8SnapPyHP_17CFundamentalGroup___cinit__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_triangulation, PyObject *__pyx_v_simplify_presentation, PyObject *__pyx_v_fillings_may_affect_generators, PyObject *__pyx_v_minimize_number_of_generators, PyObject *__pyx_v_try_hard_to_shorten_relators); /* proto */
static void __pyx_pf_8SnapPyHP_17CFundamentalGroup_2__dealloc__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_4__repr__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_6num_generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_8num_relators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_10num_original_generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_12original_generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_14generators_in_originals(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_raw_form, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_16_word_moves(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_18generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_20relators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_22meridian(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, int __pyx_v_which_cusp, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_24longitude(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, int __pyx_v_which_cusp, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_26peripheral_curves(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_28magma_string(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_30gap_string(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_32_gap_init_(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_34_magma_init_(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_magma); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_36sage(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_38character_variety_vars_and_polys(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_ideal); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_9num_cusps___get__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_40__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_42__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup__matrix(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word, PyObject *__pyx_v_group); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_2SL2C(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_4O31(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_6complex_length(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13HolonomyGroup__number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */
static int __pyx_pf_8SnapPyHP_13SymmetryGroup___cinit__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self, PyObject *__pyx_v_is_full_group, PyObject *__pyx_v_owns_c_symmetry_group); /* proto */
static void __pyx_pf_8SnapPyHP_13SymmetryGroup_2__dealloc__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_4is_full_group(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_6__repr__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_8order(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_10is_abelian(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_12abelian_description(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_14is_dihedral(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_16is_polyhedral(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_18polyhedral_description(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_20is_S5(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_22is_direct_product(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_24direct_product_description(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_26is_amphicheiral(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_28is_invertible_knot(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_30commutator_subgroup(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_32abelianization(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_34center(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_36multiply_elements(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_38isometries(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_14_is_full_group___get__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_22_owns_c_symmetry_group___get__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_40__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_42__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain__number_(PyObject *__pyx_v_n); /* proto */
static int __pyx_pf_8SnapPyHP_16CDirichletDomain_2__cinit__(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_manifold, PyObject *__pyx_v_vertex_epsilon, PyObject *__pyx_v_displacement, PyObject *__pyx_v_centroid_at_origin, PyObject *__pyx_v_maximize_injectivity_radius, PyObject *__pyx_v_include_words, PyObject *__pyx_v_generator_file, PyObject *__pyx_v_generator_bytes, PyObject *__pyx_v_O31_generators, PyObject *__pyx_v_manifold_name); /* proto */
static void __pyx_pf_8SnapPyHP_16CDirichletDomain_4__dealloc__(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_6__repr__(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_8num_vertices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_10num_finite_vertices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_12num_ideal_vertices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_14num_edges(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_16num_faces(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_18in_radius(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_20out_radius(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_22spine_radius(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_24length_spectrum_dicts(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_cutoff_length, PyObject *__pyx_v_full_rigor, PyObject *__pyx_v_multiplicities, PyObject *__pyx_v_user_radius, PyObject *__pyx_v_grouped); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_26vertex_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_details); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_28_vertex_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_30_vertex_data_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_32_vertex_to_index_dict(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_34_edge_to_index_dict(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_9face_list_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_36face_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_38edge_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_40view(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_42manifold(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_44triangulation(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_46volume(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_48pairing_matrices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_50pairing_words(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_10_to_string_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_52_to_string(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_54__reduce_ex__(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_56save(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_58export_stl(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_model, PyObject *__pyx_v_cutout, PyObject *__pyx_v_num_subdivisions, PyObject *__pyx_v_shrink_factor, PyObject *__pyx_v_cutoff_radius, CYTHON_UNUSED PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_44_unpickle_dirichlet_domain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood__number_(PyObject *__pyx_v_n); /* proto */
static int __pyx_pf_8SnapPyHP_17CCuspNeighborhood_2__cinit__(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_manifold); /* proto */
static void __pyx_pf_8SnapPyHP_17CCuspNeighborhood_4__dealloc__(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_6__repr__(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_8manifold(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_10original_index(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_12check_index(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_14num_cusps(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_16topology(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_18get_displacement(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_20set_displacement(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_new_displacement, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_22stopping_displacement(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_24stopper(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_26reach(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_28max_reach(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_30get_tie(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_32set_tie(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_new_tie); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_34volume(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_36translations(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_38horoballs(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_full_list, PyObject *__pyx_v_high_precision); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_40Ford_domain(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_high_precision); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_42triangulation(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_high_precision); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_44view(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_cutoff); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_46bundle_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_desc); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_48splitting_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_desc); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_50get_triangulation_tester(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_52extract_HT_knot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_record, PyObject *__pyx_v_crossings, PyObject *__pyx_v_alternation); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_54get_HT_knot_DT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_crossings, PyObject *__pyx_v_alternation, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_56get_HT_knot_by_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_alternation, PyObject *__pyx_v_index, PyObject *__pyx_v_manifold_class); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_6Census___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_6Census_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_6Census_4__contains__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_6Census_6next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_6Census_8__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_6Census_10__getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12CuspedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12CuspedCensus_2lookup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_12CuspedCensus_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableCuspedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableCuspedCensus_2lookup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_25ObsOrientableClosedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_25ObsOrientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableClosedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_66__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13KnotExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_13KnotExteriors_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_68__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_27NonalternatingKnotExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_70__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14ObsCensusKnots___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14ObsCensusKnots_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14ObsCensusKnots_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16ObsLinkExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_components, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16ObsLinkExteriors_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_16ObsLinkExteriors_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_j); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_11MorwenLinks___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_num_components, CYTHON_UNUSED PyObject *__pyx_v_num_crossings); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_58left_pad_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_str, PyObject *__pyx_v_length, PyObject *__pyx_v_pad); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14ObsMorwenLinks___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_num_components, PyObject *__pyx_v_num_crossings); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_14ObsMorwenLinks_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8SnapPyHP_60__pyx_unpickle_PresentationMatrix(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_8SnapPyHP_Triangulation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP_Manifold(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP_AbelianGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP_PresentationMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP_CFundamentalGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP_SymmetryGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP_CDirichletDomain(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP_CCuspNeighborhood(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_defaults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_4_list_as_word(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_6_face_list(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

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
  PyObject *__pyx_type_8SnapPyHP_Triangulation;
  PyObject *__pyx_type_8SnapPyHP_Manifold;
  PyObject *__pyx_type_8SnapPyHP_AbelianGroup;
  PyObject *__pyx_type_8SnapPyHP_PresentationMatrix;
  PyObject *__pyx_type_8SnapPyHP_CFundamentalGroup;
  PyObject *__pyx_type_8SnapPyHP_CHolonomyGroup;
  PyObject *__pyx_type_8SnapPyHP_SymmetryGroup;
  PyObject *__pyx_type_8SnapPyHP_CDirichletDomain;
  PyObject *__pyx_type_8SnapPyHP_CCuspNeighborhood;
  PyObject *__pyx_type_8SnapPyHP___pyx_defaults;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct__genexpr;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr;
  PyObject *__pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr;
  PyTypeObject *__pyx_ptype_8SnapPyHP_Triangulation;
  PyTypeObject *__pyx_ptype_8SnapPyHP_Manifold;
  PyTypeObject *__pyx_ptype_8SnapPyHP_AbelianGroup;
  PyTypeObject *__pyx_ptype_8SnapPyHP_PresentationMatrix;
  PyTypeObject *__pyx_ptype_8SnapPyHP_CFundamentalGroup;
  PyTypeObject *__pyx_ptype_8SnapPyHP_CHolonomyGroup;
  PyTypeObject *__pyx_ptype_8SnapPyHP_SymmetryGroup;
  PyTypeObject *__pyx_ptype_8SnapPyHP_CDirichletDomain;
  PyTypeObject *__pyx_ptype_8SnapPyHP_CCuspNeighborhood;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_defaults;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr;
  PyTypeObject *__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyBytes_Type__split;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type__update;
  __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type__ljust;
  __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type__lower;
  PyObject *__pyx_k__29;
  PyObject *__pyx_k__31;
  PyObject *__pyx_k__38;
  PyObject *__pyx_slice[6];
  PyObject *__pyx_tuple[79];
  PyObject *__pyx_codeobj_tab[311];
  PyObject *__pyx_string_tab[2034];
  PyObject *__pyx_float_0_0;
  PyObject *__pyx_float_0_1;
  PyObject *__pyx_float_0_2;
  PyObject *__pyx_float_0_9;
  PyObject *__pyx_float_1_0;
  PyObject *__pyx_float_1eneg_9;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_3;
  PyObject *__pyx_int_4;
  PyObject *__pyx_int_5;
  PyObject *__pyx_int_6;
  PyObject *__pyx_int_7;
  PyObject *__pyx_int_8;
  PyObject *__pyx_int_9;
  PyObject *__pyx_int_10;
  PyObject *__pyx_int_11;
  PyObject *__pyx_int_12;
  PyObject *__pyx_int_13;
  PyObject *__pyx_int_14;
  PyObject *__pyx_int_15;
  PyObject *__pyx_int_16;
  PyObject *__pyx_int_17;
  PyObject *__pyx_int_18;
  PyObject *__pyx_int_19;
  PyObject *__pyx_int_20;
  PyObject *__pyx_int_21;
  PyObject *__pyx_int_22;
  PyObject *__pyx_int_23;
  PyObject *__pyx_int_24;
  PyObject *__pyx_int_25;
  PyObject *__pyx_int_26;
  PyObject *__pyx_int_27;
  PyObject *__pyx_int_28;
  PyObject *__pyx_int_29;
  PyObject *__pyx_int_30;
  PyObject *__pyx_int_31;
  PyObject *__pyx_int_32;
  PyObject *__pyx_int_33;
  PyObject *__pyx_int_34;
  PyObject *__pyx_int_35;
  PyObject *__pyx_int_36;
  PyObject *__pyx_int_37;
  PyObject *__pyx_int_38;
  PyObject *__pyx_int_39;
  PyObject *__pyx_int_40;
  PyObject *__pyx_int_41;
  PyObject *__pyx_int_42;
  PyObject *__pyx_int_43;
  PyObject *__pyx_int_44;
  PyObject *__pyx_int_45;
  PyObject *__pyx_int_46;
  PyObject *__pyx_int_47;
  PyObject *__pyx_int_48;
  PyObject *__pyx_int_49;
  PyObject *__pyx_int_50;
  PyObject *__pyx_int_51;
  PyObject *__pyx_int_52;
  PyObject *__pyx_int_53;
  PyObject *__pyx_int_54;
  PyObject *__pyx_int_55;
  PyObject *__pyx_int_56;
  PyObject *__pyx_int_57;
  PyObject *__pyx_int_58;
  PyObject *__pyx_int_59;
  PyObject *__pyx_int_60;
  PyObject *__pyx_int_61;
  PyObject *__pyx_int_62;
  PyObject *__pyx_int_63;
  PyObject *__pyx_int_64;
  PyObject *__pyx_int_65;
  PyObject *__pyx_int_66;
  PyObject *__pyx_int_67;
  PyObject *__pyx_int_68;
  PyObject *__pyx_int_69;
  PyObject *__pyx_int_70;
  PyObject *__pyx_int_71;
  PyObject *__pyx_int_72;
  PyObject *__pyx_int_73;
  PyObject *__pyx_int_74;
  PyObject *__pyx_int_75;
  PyObject *__pyx_int_76;
  PyObject *__pyx_int_77;
  PyObject *__pyx_int_78;
  PyObject *__pyx_int_79;
  PyObject *__pyx_int_80;
  PyObject *__pyx_int_81;
  PyObject *__pyx_int_82;
  PyObject *__pyx_int_83;
  PyObject *__pyx_int_84;
  PyObject *__pyx_int_85;
  PyObject *__pyx_int_86;
  PyObject *__pyx_int_87;
  PyObject *__pyx_int_88;
  PyObject *__pyx_int_89;
  PyObject *__pyx_int_90;
  PyObject *__pyx_int_91;
  PyObject *__pyx_int_92;
  PyObject *__pyx_int_93;
  PyObject *__pyx_int_94;
  PyObject *__pyx_int_95;
  PyObject *__pyx_int_96;
  PyObject *__pyx_int_97;
  PyObject *__pyx_int_98;
  PyObject *__pyx_int_99;
  PyObject *__pyx_int_100;
  PyObject *__pyx_int_101;
  PyObject *__pyx_int_102;
  PyObject *__pyx_int_103;
  PyObject *__pyx_int_104;
  PyObject *__pyx_int_105;
  PyObject *__pyx_int_106;
  PyObject *__pyx_int_107;
  PyObject *__pyx_int_108;
  PyObject *__pyx_int_109;
  PyObject *__pyx_int_110;
  PyObject *__pyx_int_111;
  PyObject *__pyx_int_112;
  PyObject *__pyx_int_113;
  PyObject *__pyx_int_114;
  PyObject *__pyx_int_115;
  PyObject *__pyx_int_116;
  PyObject *__pyx_int_117;
  PyObject *__pyx_int_118;
  PyObject *__pyx_int_119;
  PyObject *__pyx_int_120;
  PyObject *__pyx_int_121;
  PyObject *__pyx_int_122;
  PyObject *__pyx_int_123;
  PyObject *__pyx_int_124;
  PyObject *__pyx_int_125;
  PyObject *__pyx_int_126;
  PyObject *__pyx_int_127;
  PyObject *__pyx_int_128;
  PyObject *__pyx_int_129;
  PyObject *__pyx_int_130;
  PyObject *__pyx_int_131;
  PyObject *__pyx_int_132;
  PyObject *__pyx_int_133;
  PyObject *__pyx_int_134;
  PyObject *__pyx_int_135;
  PyObject *__pyx_int_136;
  PyObject *__pyx_int_137;
  PyObject *__pyx_int_138;
  PyObject *__pyx_int_139;
  PyObject *__pyx_int_140;
  PyObject *__pyx_int_141;
  PyObject *__pyx_int_142;
  PyObject *__pyx_int_143;
  PyObject *__pyx_int_144;
  PyObject *__pyx_int_145;
  PyObject *__pyx_int_146;
  PyObject *__pyx_int_147;
  PyObject *__pyx_int_148;
  PyObject *__pyx_int_149;
  PyObject *__pyx_int_150;
  PyObject *__pyx_int_151;
  PyObject *__pyx_int_152;
  PyObject *__pyx_int_153;
  PyObject *__pyx_int_154;
  PyObject *__pyx_int_155;
  PyObject *__pyx_int_156;
  PyObject *__pyx_int_157;
  PyObject *__pyx_int_158;
  PyObject *__pyx_int_159;
  PyObject *__pyx_int_160;
  PyObject *__pyx_int_161;
  PyObject *__pyx_int_162;
  PyObject *__pyx_int_163;
  PyObject *__pyx_int_164;
  PyObject *__pyx_int_165;
  PyObject *__pyx_int_166;
  PyObject *__pyx_int_167;
  PyObject *__pyx_int_168;
  PyObject *__pyx_int_169;
  PyObject *__pyx_int_170;
  PyObject *__pyx_int_171;
  PyObject *__pyx_int_172;
  PyObject *__pyx_int_173;
  PyObject *__pyx_int_174;
  PyObject *__pyx_int_175;
  PyObject *__pyx_int_176;
  PyObject *__pyx_int_177;
  PyObject *__pyx_int_178;
  PyObject *__pyx_int_179;
  PyObject *__pyx_int_180;
  PyObject *__pyx_int_181;
  PyObject *__pyx_int_182;
  PyObject *__pyx_int_183;
  PyObject *__pyx_int_184;
  PyObject *__pyx_int_185;
  PyObject *__pyx_int_186;
  PyObject *__pyx_int_187;
  PyObject *__pyx_int_188;
  PyObject *__pyx_int_189;
  PyObject *__pyx_int_190;
  PyObject *__pyx_int_191;
  PyObject *__pyx_int_192;
  PyObject *__pyx_int_193;
  PyObject *__pyx_int_194;
  PyObject *__pyx_int_195;
  PyObject *__pyx_int_196;
  PyObject *__pyx_int_197;
  PyObject *__pyx_int_198;
  PyObject *__pyx_int_199;
  PyObject *__pyx_int_200;
  PyObject *__pyx_int_201;
  PyObject *__pyx_int_202;
  PyObject *__pyx_int_203;
  PyObject *__pyx_int_204;
  PyObject *__pyx_int_205;
  PyObject *__pyx_int_206;
  PyObject *__pyx_int_207;
  PyObject *__pyx_int_208;
  PyObject *__pyx_int_209;
  PyObject *__pyx_int_210;
  PyObject *__pyx_int_211;
  PyObject *__pyx_int_212;
  PyObject *__pyx_int_213;
  PyObject *__pyx_int_214;
  PyObject *__pyx_int_215;
  PyObject *__pyx_int_216;
  PyObject *__pyx_int_217;
  PyObject *__pyx_int_218;
  PyObject *__pyx_int_219;
  PyObject *__pyx_int_220;
  PyObject *__pyx_int_221;
  PyObject *__pyx_int_222;
  PyObject *__pyx_int_223;
  PyObject *__pyx_int_224;
  PyObject *__pyx_int_225;
  PyObject *__pyx_int_226;
  PyObject *__pyx_int_227;
  PyObject *__pyx_int_228;
  PyObject *__pyx_int_229;
  PyObject *__pyx_int_230;
  PyObject *__pyx_int_231;
  PyObject *__pyx_int_232;
  PyObject *__pyx_int_233;
  PyObject *__pyx_int_234;
  PyObject *__pyx_int_235;
  PyObject *__pyx_int_236;
  PyObject *__pyx_int_237;
  PyObject *__pyx_int_238;
  PyObject *__pyx_int_239;
  PyObject *__pyx_int_240;
  PyObject *__pyx_int_241;
  PyObject *__pyx_int_242;
  PyObject *__pyx_int_243;
  PyObject *__pyx_int_244;
  PyObject *__pyx_int_245;
  PyObject *__pyx_int_246;
  PyObject *__pyx_int_247;
  PyObject *__pyx_int_248;
  PyObject *__pyx_int_249;
  PyObject *__pyx_int_250;
  PyObject *__pyx_int_251;
  PyObject *__pyx_int_252;
  PyObject *__pyx_int_253;
  PyObject *__pyx_int_254;
  PyObject *__pyx_int_255;
  PyObject *__pyx_int_256;
  PyObject *__pyx_int_257;
  PyObject *__pyx_int_258;
  PyObject *__pyx_int_259;
  PyObject *__pyx_int_260;
  PyObject *__pyx_int_261;
  PyObject *__pyx_int_262;
  PyObject *__pyx_int_263;
  PyObject *__pyx_int_264;
  PyObject *__pyx_int_265;
  PyObject *__pyx_int_266;
  PyObject *__pyx_int_267;
  PyObject *__pyx_int_268;
  PyObject *__pyx_int_269;
  PyObject *__pyx_int_270;
  PyObject *__pyx_int_271;
  PyObject *__pyx_int_272;
  PyObject *__pyx_int_273;
  PyObject *__pyx_int_274;
  PyObject *__pyx_int_275;
  PyObject *__pyx_int_276;
  PyObject *__pyx_int_277;
  PyObject *__pyx_int_278;
  PyObject *__pyx_int_279;
  PyObject *__pyx_int_280;
  PyObject *__pyx_int_281;
  PyObject *__pyx_int_282;
  PyObject *__pyx_int_283;
  PyObject *__pyx_int_284;
  PyObject *__pyx_int_285;
  PyObject *__pyx_int_286;
  PyObject *__pyx_int_287;
  PyObject *__pyx_int_288;
  PyObject *__pyx_int_289;
  PyObject *__pyx_int_290;
  PyObject *__pyx_int_291;
  PyObject *__pyx_int_292;
  PyObject *__pyx_int_293;
  PyObject *__pyx_int_294;
  PyObject *__pyx_int_295;
  PyObject *__pyx_int_296;
  PyObject *__pyx_int_297;
  PyObject *__pyx_int_298;
  PyObject *__pyx_int_299;
  PyObject *__pyx_int_300;
  PyObject *__pyx_int_301;
  PyObject *__pyx_int_302;
  PyObject *__pyx_int_303;
  PyObject *__pyx_int_304;
  PyObject *__pyx_int_305;
  PyObject *__pyx_int_306;
  PyObject *__pyx_int_307;
  PyObject *__pyx_int_308;
  PyObject *__pyx_int_309;
  PyObject *__pyx_int_310;
  PyObject *__pyx_int_311;
  PyObject *__pyx_int_312;
  PyObject *__pyx_int_313;
  PyObject *__pyx_int_314;
  PyObject *__pyx_int_315;
  PyObject *__pyx_int_316;
  PyObject *__pyx_int_317;
  PyObject *__pyx_int_318;
  PyObject *__pyx_int_319;
  PyObject *__pyx_int_320;
  PyObject *__pyx_int_321;
  PyObject *__pyx_int_322;
  PyObject *__pyx_int_323;
  PyObject *__pyx_int_324;
  PyObject *__pyx_int_325;
  PyObject *__pyx_int_326;
  PyObject *__pyx_int_327;
  PyObject *__pyx_int_328;
  PyObject *__pyx_int_329;
  PyObject *__pyx_int_330;
  PyObject *__pyx_int_331;
  PyObject *__pyx_int_332;
  PyObject *__pyx_int_333;
  PyObject *__pyx_int_334;
  PyObject *__pyx_int_335;
  PyObject *__pyx_int_336;
  PyObject *__pyx_int_337;
  PyObject *__pyx_int_338;
  PyObject *__pyx_int_339;
  PyObject *__pyx_int_340;
  PyObject *__pyx_int_341;
  PyObject *__pyx_int_342;
  PyObject *__pyx_int_343;
  PyObject *__pyx_int_344;
  PyObject *__pyx_int_345;
  PyObject *__pyx_int_346;
  PyObject *__pyx_int_347;
  PyObject *__pyx_int_348;
  PyObject *__pyx_int_349;
  PyObject *__pyx_int_350;
  PyObject *__pyx_int_351;
  PyObject *__pyx_int_352;
  PyObject *__pyx_int_353;
  PyObject *__pyx_int_354;
  PyObject *__pyx_int_355;
  PyObject *__pyx_int_356;
  PyObject *__pyx_int_357;
  PyObject *__pyx_int_358;
  PyObject *__pyx_int_359;
  PyObject *__pyx_int_360;
  PyObject *__pyx_int_361;
  PyObject *__pyx_int_362;
  PyObject *__pyx_int_363;
  PyObject *__pyx_int_364;
  PyObject *__pyx_int_365;
  PyObject *__pyx_int_366;
  PyObject *__pyx_int_367;
  PyObject *__pyx_int_368;
  PyObject *__pyx_int_369;
  PyObject *__pyx_int_370;
  PyObject *__pyx_int_371;
  PyObject *__pyx_int_372;
  PyObject *__pyx_int_373;
  PyObject *__pyx_int_374;
  PyObject *__pyx_int_375;
  PyObject *__pyx_int_376;
  PyObject *__pyx_int_377;
  PyObject *__pyx_int_378;
  PyObject *__pyx_int_379;
  PyObject *__pyx_int_380;
  PyObject *__pyx_int_381;
  PyObject *__pyx_int_382;
  PyObject *__pyx_int_383;
  PyObject *__pyx_int_384;
  PyObject *__pyx_int_385;
  PyObject *__pyx_int_386;
  PyObject *__pyx_int_387;
  PyObject *__pyx_int_388;
  PyObject *__pyx_int_389;
  PyObject *__pyx_int_390;
  PyObject *__pyx_int_391;
  PyObject *__pyx_int_392;
  PyObject *__pyx_int_393;
  PyObject *__pyx_int_394;
  PyObject *__pyx_int_395;
  PyObject *__pyx_int_396;
  PyObject *__pyx_int_397;
  PyObject *__pyx_int_398;
  PyObject *__pyx_int_399;
  PyObject *__pyx_int_400;
  PyObject *__pyx_int_401;
  PyObject *__pyx_int_402;
  PyObject *__pyx_int_403;
  PyObject *__pyx_int_404;
  PyObject *__pyx_int_405;
  PyObject *__pyx_int_406;
  PyObject *__pyx_int_407;
  PyObject *__pyx_int_408;
  PyObject *__pyx_int_409;
  PyObject *__pyx_int_410;
  PyObject *__pyx_int_411;
  PyObject *__pyx_int_412;
  PyObject *__pyx_int_413;
  PyObject *__pyx_int_414;
  PyObject *__pyx_int_552;
  PyObject *__pyx_int_887;
  PyObject *__pyx_int_888;
  PyObject *__pyx_int_962;
  PyObject *__pyx_int_1260;
  PyObject *__pyx_int_1288;
  PyObject *__pyx_int_3552;
  PyObject *__pyx_int_4878;
  PyObject *__pyx_int_5110;
  PyObject *__pyx_int_10000;
  PyObject *__pyx_int_11031;
  PyObject *__pyx_int_12846;
  PyObject *__pyx_int_17661;
  PyObject *__pyx_int_19536;
  PyObject *__pyx_int_27436;
  PyObject *__pyx_int_32768;
  PyObject *__pyx_int_85263;
  PyObject *__pyx_int_168030;
  PyObject *__pyx_int_379799;
  PyObject *__pyx_int_1008906;
  PyObject *__pyx_int_60959262;
  PyObject *__pyx_int_64961464;
  PyObject *__pyx_int_94173347;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_int_neg_3;
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

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


#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr *__pyx_freelist_8SnapPyHP___pyx_scope_struct__genexpr[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct__genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *__pyx_freelist_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr *__pyx_freelist_8SnapPyHP___pyx_scope_struct_2_genexpr[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_2_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *__pyx_freelist_8SnapPyHP___pyx_scope_struct_3_genexpr[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_3_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *__pyx_freelist_8SnapPyHP___pyx_scope_struct_4_list_as_word[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_4_list_as_word;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *__pyx_freelist_8SnapPyHP___pyx_scope_struct_5_genexpr[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_5_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *__pyx_freelist_8SnapPyHP___pyx_scope_struct_6_face_list[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_6_face_list;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *__pyx_freelist_8SnapPyHP___pyx_scope_struct_7_genexpr[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_7_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *__pyx_freelist_8SnapPyHP___pyx_scope_struct_8_genexpr[8];
int __pyx_freecount_8SnapPyHP___pyx_scope_struct_8_genexpr;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* IterNextPlain.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
#endif

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

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

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_b_ __pyx_string_tab[0]
#define __pyx_kp_u_ __pyx_string_tab[1]
#define __pyx_kp_u_0 __pyx_string_tab[2]
#define __pyx_kp_u_0_0 __pyx_string_tab[3]
#define __pyx_kp_u_0_9_0_9 __pyx_string_tab[4]
#define __pyx_kp_u_1 __pyx_string_tab[5]
#define __pyx_kp_u_12n123 __pyx_string_tab[6]
#define __pyx_kp_u_16_14f_I __pyx_string_tab[7]
#define __pyx_kp_u_16n1235 __pyx_string_tab[8]
#define __pyx_kp_u_17_14f __pyx_string_tab[9]
#define __pyx_kp_u_2_3_move __pyx_string_tab[10]
#define __pyx_kp_u_2d __pyx_string_tab[11]
#define __pyx_kp_u_3_2_move __pyx_string_tab[12]
#define __pyx_kp_u_3d __pyx_string_tab[13]
#define __pyx_kp_u_4s_40s __pyx_string_tab[14]
#define __pyx_kp_u_5_2_1_3_4_1_2 __pyx_string_tab[15]
#define __pyx_kp_u_6_1 __pyx_string_tab[16]
#define __pyx_kp_u_6s_s __pyx_string_tab[17]
#define __pyx_kp_u_8_3_3 __pyx_string_tab[18]
#define __pyx_kp_u_A __pyx_string_tab[19]
#define __pyx_n_u_A_3 __pyx_string_tab[20]
#define __pyx_kp_u_A_CuspNeighborhood_object_repre __pyx_string_tab[21]
#define __pyx_kp_u_A_DirichletDomain_object_repres __pyx_string_tab[22]
#define __pyx_kp_u_A_FundamentalGroup_represents_a __pyx_string_tab[23]
#define __pyx_kp_u_A_FundamentalGroup_represents_a_2 __pyx_string_tab[24]
#define __pyx_kp_u_A_non_existent_shape_data_type_w __pyx_string_tab[25]
#define __pyx_kp_u_A_s_is_specified_by_a_string_or __pyx_string_tab[26]
#define __pyx_n_u_AbelianGroup __pyx_string_tab[27]
#define __pyx_n_u_AbelianGroup___reduce __pyx_string_tab[28]
#define __pyx_kp_u_AbelianGroup___reduce___line_82 __pyx_string_tab[29]
#define __pyx_n_u_AbelianGroup_betti_number __pyx_string_tab[30]
#define __pyx_n_u_AbelianGroup_elementary_divisors __pyx_string_tab[31]
#define __pyx_n_u_AbelianGroup_order __pyx_string_tab[32]
#define __pyx_n_u_AbelianGroup_rank __pyx_string_tab[33]
#define __pyx_kp_u_Acceptable_cusp_types_are_all_or __pyx_string_tab[34]
#define __pyx_kp_u_Add_a_possibly_degenerate_hyper __pyx_string_tab[35]
#define __pyx_kp_u_All_Dehn_filling_coefficients_mu __pyx_string_tab[36]
#define __pyx_kp_u_All_cusps_must_be_fillable __pyx_string_tab[37]
#define __pyx_kp_u_All_files __pyx_string_tab[38]
#define __pyx_kp_u_All_text_files __pyx_string_tab[39]
#define __pyx_n_u_Alphabet __pyx_string_tab[40]
#define __pyx_n_u_AlternatingKnotExteriors __pyx_string_tab[41]
#define __pyx_n_u_Alternating_numbers __pyx_string_tab[42]
#define __pyx_n_u_Alternating_offsets __pyx_string_tab[43]
#define __pyx_n_u_Alternating_table __pyx_string_tab[44]
#define __pyx_kp_u_An_empty_triangulation_was_gener __pyx_string_tab[45]
#define __pyx_n_u_AssertionError __pyx_string_tab[46]
#define __pyx_n_u_AttributeError __pyx_string_tab[47]
#define __pyx_n_u_B __pyx_string_tab[48]
#define __pyx_kp_u_Base_class_for_Iterators_Sequen __pyx_string_tab[49]
#define __pyx_kp_u_Base_class_for_Iterators_Sequen_2 __pyx_string_tab[50]
#define __pyx_kp_u_Base_class_for_manifold_Iterato __pyx_string_tab[51]
#define __pyx_kp_u_Bb_raid_0_9 __pyx_string_tab[52]
#define __pyx_kp_u_Braid __pyx_string_tab[53]
#define __pyx_kp_u_Braid_1_2_1_2 __pyx_string_tab[54]
#define __pyx_kp_u_Braids_must_have_at_least_2_stra __pyx_string_tab[55]
#define __pyx_kp_u_Brings_up_a_link_editor_window __pyx_string_tab[56]
#define __pyx_n_u_Browser __pyx_string_tab[57]
#define __pyx_kp_u_Browser_not_imported_Tk_CyOpenGL __pyx_string_tab[58]
#define __pyx_kp_u_Bundle_S__1_1_a0_B1 __pyx_string_tab[59]
#define __pyx_kp_u_Bundle_S__d_d __pyx_string_tab[60]
#define __pyx_kp_u_Byte_encoding_requires_complete __pyx_string_tab[61]
#define __pyx_n_u_C __pyx_string_tab[62]
#define __pyx_n_u_CCuspNeighborhood __pyx_string_tab[63]
#define __pyx_n_u_CCuspNeighborhood_Ford_domain __pyx_string_tab[64]
#define __pyx_n_u_CCuspNeighborhood___reduce_cytho __pyx_string_tab[65]
#define __pyx_n_u_CCuspNeighborhood___setstate_cyt __pyx_string_tab[66]
#define __pyx_n_u_CCuspNeighborhood__number __pyx_string_tab[67]
#define __pyx_n_u_CCuspNeighborhood_check_index __pyx_string_tab[68]
#define __pyx_n_u_CCuspNeighborhood_get_displaceme __pyx_string_tab[69]
#define __pyx_n_u_CCuspNeighborhood_get_tie __pyx_string_tab[70]
#define __pyx_n_u_CCuspNeighborhood_horoballs __pyx_string_tab[71]
#define __pyx_n_u_CCuspNeighborhood_manifold __pyx_string_tab[72]
#define __pyx_n_u_CCuspNeighborhood_max_reach __pyx_string_tab[73]
#define __pyx_n_u_CCuspNeighborhood_num_cusps __pyx_string_tab[74]
#define __pyx_n_u_CCuspNeighborhood_original_index __pyx_string_tab[75]
#define __pyx_n_u_CCuspNeighborhood_reach __pyx_string_tab[76]
#define __pyx_n_u_CCuspNeighborhood_set_displaceme __pyx_string_tab[77]
#define __pyx_n_u_CCuspNeighborhood_set_tie __pyx_string_tab[78]
#define __pyx_n_u_CCuspNeighborhood_stopper __pyx_string_tab[79]
#define __pyx_n_u_CCuspNeighborhood_stopping_displ __pyx_string_tab[80]
#define __pyx_n_u_CCuspNeighborhood_topology __pyx_string_tab[81]
#define __pyx_n_u_CCuspNeighborhood_translations __pyx_string_tab[82]
#define __pyx_n_u_CCuspNeighborhood_triangulation __pyx_string_tab[83]
#define __pyx_n_u_CCuspNeighborhood_view __pyx_string_tab[84]
#define __pyx_kp_u_CCuspNeighborhood_view_line_289 __pyx_string_tab[85]
#define __pyx_n_u_CCuspNeighborhood_volume __pyx_string_tab[86]
#define __pyx_n_u_CDirichletDomain __pyx_string_tab[87]
#define __pyx_n_u_CDirichletDomain___reduce_ex __pyx_string_tab[88]
#define __pyx_n_u_CDirichletDomain__edge_to_index __pyx_string_tab[89]
#define __pyx_n_u_CDirichletDomain__number __pyx_string_tab[90]
#define __pyx_n_u_CDirichletDomain__to_string __pyx_string_tab[91]
#define __pyx_n_u_CDirichletDomain__vertex_data_li __pyx_string_tab[92]
#define __pyx_n_u_CDirichletDomain__vertex_list __pyx_string_tab[93]
#define __pyx_n_u_CDirichletDomain__vertex_to_inde __pyx_string_tab[94]
#define __pyx_n_u_CDirichletDomain_edge_list __pyx_string_tab[95]
#define __pyx_n_u_CDirichletDomain_export_stl __pyx_string_tab[96]
#define __pyx_kp_u_CDirichletDomain_export_stl_line __pyx_string_tab[97]
#define __pyx_n_u_CDirichletDomain_face_list __pyx_string_tab[98]
#define __pyx_n_u_CDirichletDomain_in_radius __pyx_string_tab[99]
#define __pyx_n_u_CDirichletDomain_length_spectrum __pyx_string_tab[100]
#define __pyx_kp_u_CDirichletDomain_length_spectrum_2 __pyx_string_tab[101]
#define __pyx_n_u_CDirichletDomain_manifold __pyx_string_tab[102]
#define __pyx_kp_u_CDirichletDomain_manifold_line_5 __pyx_string_tab[103]
#define __pyx_n_u_CDirichletDomain_num_edges __pyx_string_tab[104]
#define __pyx_n_u_CDirichletDomain_num_faces __pyx_string_tab[105]
#define __pyx_n_u_CDirichletDomain_num_finite_vert __pyx_string_tab[106]
#define __pyx_n_u_CDirichletDomain_num_ideal_verti __pyx_string_tab[107]
#define __pyx_n_u_CDirichletDomain_num_vertices __pyx_string_tab[108]
#define __pyx_n_u_CDirichletDomain_out_radius __pyx_string_tab[109]
#define __pyx_n_u_CDirichletDomain_pairing_matrice __pyx_string_tab[110]
#define __pyx_kp_u_CDirichletDomain_pairing_matrice_2 __pyx_string_tab[111]
#define __pyx_n_u_CDirichletDomain_pairing_words __pyx_string_tab[112]
#define __pyx_kp_u_CDirichletDomain_pairing_words_l __pyx_string_tab[113]
#define __pyx_n_u_CDirichletDomain_save __pyx_string_tab[114]
#define __pyx_kp_u_CDirichletDomain_save_line_643 __pyx_string_tab[115]
#define __pyx_n_u_CDirichletDomain_spine_radius __pyx_string_tab[116]
#define __pyx_n_u_CDirichletDomain_triangulation __pyx_string_tab[117]
#define __pyx_kp_u_CDirichletDomain_triangulation_l __pyx_string_tab[118]
#define __pyx_n_u_CDirichletDomain_vertex_list __pyx_string_tab[119]
#define __pyx_n_u_CDirichletDomain_view __pyx_string_tab[120]
#define __pyx_n_u_CDirichletDomain_volume __pyx_string_tab[121]
#define __pyx_n_u_CFundamentalGroup __pyx_string_tab[122]
#define __pyx_n_u_CFundamentalGroup___reduce_cytho __pyx_string_tab[123]
#define __pyx_n_u_CFundamentalGroup___setstate_cyt __pyx_string_tab[124]
#define __pyx_n_u_CFundamentalGroup__gap_init __pyx_string_tab[125]
#define __pyx_n_u_CFundamentalGroup__magma_init __pyx_string_tab[126]
#define __pyx_n_u_CFundamentalGroup__word_moves __pyx_string_tab[127]
#define __pyx_n_u_CFundamentalGroup_character_vari __pyx_string_tab[128]
#define __pyx_kp_u_CFundamentalGroup_character_vari_2 __pyx_string_tab[129]
#define __pyx_n_u_CFundamentalGroup_gap_string __pyx_string_tab[130]
#define __pyx_kp_u_CFundamentalGroup_gap_string_lin __pyx_string_tab[131]
#define __pyx_n_u_CFundamentalGroup_generators __pyx_string_tab[132]
#define __pyx_n_u_CFundamentalGroup_generators_in __pyx_string_tab[133]
#define __pyx_kp_u_CFundamentalGroup_generators_in_2 __pyx_string_tab[134]
#define __pyx_kp_u_CFundamentalGroup_generators_lin __pyx_string_tab[135]
#define __pyx_n_u_CFundamentalGroup_longitude __pyx_string_tab[136]
#define __pyx_kp_u_CFundamentalGroup_longitude_line __pyx_string_tab[137]
#define __pyx_n_u_CFundamentalGroup_magma_string __pyx_string_tab[138]
#define __pyx_n_u_CFundamentalGroup_meridian __pyx_string_tab[139]
#define __pyx_kp_u_CFundamentalGroup_meridian_line __pyx_string_tab[140]
#define __pyx_n_u_CFundamentalGroup_num_generators __pyx_string_tab[141]
#define __pyx_n_u_CFundamentalGroup_num_original_g __pyx_string_tab[142]
#define __pyx_n_u_CFundamentalGroup_num_relators __pyx_string_tab[143]
#define __pyx_n_u_CFundamentalGroup_original_gener __pyx_string_tab[144]
#define __pyx_kp_u_CFundamentalGroup_original_gener_2 __pyx_string_tab[145]
#define __pyx_n_u_CFundamentalGroup_peripheral_cur __pyx_string_tab[146]
#define __pyx_kp_u_CFundamentalGroup_peripheral_cur_2 __pyx_string_tab[147]
#define __pyx_n_u_CFundamentalGroup_relators __pyx_string_tab[148]
#define __pyx_n_u_CFundamentalGroup_sage __pyx_string_tab[149]
#define __pyx_n_u_CHolonomyGroup __pyx_string_tab[150]
#define __pyx_n_u_CHolonomyGroup_O31 __pyx_string_tab[151]
#define __pyx_n_u_CHolonomyGroup_SL2C __pyx_string_tab[152]
#define __pyx_n_u_CHolonomyGroup___reduce_cython __pyx_string_tab[153]
#define __pyx_n_u_CHolonomyGroup___setstate_cython __pyx_string_tab[154]
#define __pyx_n_u_CHolonomyGroup__matrix __pyx_string_tab[155]
#define __pyx_n_u_CHolonomyGroup_complex_length __pyx_string_tab[156]
#define __pyx_kp_u_CallFuncList_function_local_F __pyx_string_tab[157]
#define __pyx_kp_u_Can_t_compare_triangulations_of __pyx_string_tab[158]
#define __pyx_kp_u_Can_t_get_the_list_of_isometries __pyx_string_tab[159]
#define __pyx_kp_u_Cannot_convert_s_to_a_Real __pyx_string_tab[160]
#define __pyx_n_u_Census __pyx_string_tab[161]
#define __pyx_kp_u_CensusKnots_s __pyx_string_tab[162]
#define __pyx_kp_u_CensusKnots_tgz __pyx_string_tab[163]
#define __pyx_n_u_Census_Knots __pyx_string_tab[164]
#define __pyx_n_u_Census_Morwen8 __pyx_string_tab[165]
#define __pyx_n_u_Census___contains __pyx_string_tab[166]
#define __pyx_n_u_Census___getitem __pyx_string_tab[167]
#define __pyx_n_u_Census___init __pyx_string_tab[168]
#define __pyx_n_u_Census___iter __pyx_string_tab[169]
#define __pyx_n_u_Census___len __pyx_string_tab[170]
#define __pyx_n_u_Census_next __pyx_string_tab[171]
#define __pyx_n_u_CertifiedShapesEngine __pyx_string_tab[172]
#define __pyx_kp_u_Change_the_triangulation_to_an __pyx_string_tab[173]
#define __pyx_n_u_ChristyLinks __pyx_string_tab[174]
#define __pyx_kp_u_ChristyLinks_s __pyx_string_tab[175]
#define __pyx_kp_u_ChristyLinks_tgz __pyx_string_tab[176]
#define __pyx_kp_u_Christy_census_of_s_component_li __pyx_string_tab[177]
#define __pyx_n_u_Christy_links __pyx_string_tab[178]
#define __pyx_n_u_ClosedCensusData __pyx_string_tab[179]
#define __pyx_kp_u_ClosedNonorientableDistinct_txt __pyx_string_tab[180]
#define __pyx_kp_u_ClosedOrientableDistinct_txt __pyx_string_tab[181]
#define __pyx_kp_u_Communication_with_PLink_failed __pyx_string_tab[182]
#define __pyx_kp_u_Constructs_a_reasonable_selecti __pyx_string_tab[183]
#define __pyx_n_u_CosetAction __pyx_string_tab[184]
#define __pyx_kp_u_Could_not_allocate_a_crossing_ta __pyx_string_tab[185]
#define __pyx_kp_u_Could_not_certify_shape_interval __pyx_string_tab[186]
#define __pyx_kp_u_Could_not_create_the_triangulati __pyx_string_tab[187]
#define __pyx_kp_u_Cover_degree_should_be_at_least __pyx_string_tab[188]
#define __pyx_kp_u_Cover_specified_by_unrecognized __pyx_string_tab[189]
#define __pyx_kp_u_Create_a_3D_picture_of_the_horo __pyx_string_tab[190]
#define __pyx_kp_u_Cusp __pyx_string_tab[191]
#define __pyx_n_u_CuspInfo __pyx_string_tab[192]
#define __pyx_n_u_CuspInfo___repr __pyx_string_tab[193]
#define __pyx_n_u_CuspNeighborhood __pyx_string_tab[194]
#define __pyx_n_u_CuspTopology __pyx_string_tab[195]
#define __pyx_kp_u_Cusp_Neighborhood_with __pyx_string_tab[196]
#define __pyx_kp_u_Cusp_neighborhood __pyx_string_tab[197]
#define __pyx_n_u_CuspedCensus __pyx_string_tab[198]
#define __pyx_n_u_CuspedCensus___getitem __pyx_string_tab[199]
#define __pyx_n_u_CuspedCensus___init __pyx_string_tab[200]
#define __pyx_n_u_CuspedCensus_lookup __pyx_string_tab[201]
#define __pyx_n_u_D __pyx_string_tab[202]
#define __pyx_kp_u_DT __pyx_string_tab[203]
#define __pyx_kp_u_DT_0_9_01 __pyx_string_tab[204]
#define __pyx_kp_u_DT_2 __pyx_string_tab[205]
#define __pyx_n_u_DT_3 __pyx_string_tab[206]
#define __pyx_kp_u_DT_4_6_2 __pyx_string_tab[207]
#define __pyx_kp_u_DT_a_zA_Z_01 __pyx_string_tab[208]
#define __pyx_n_u_DT_code __pyx_string_tab[209]
#define __pyx_n_u_DT_codes __pyx_string_tab[210]
#define __pyx_kp_u_DT_s __pyx_string_tab[211]
#define __pyx_n_u_DTcodec __pyx_string_tab[212]
#define __pyx_kp_u_D_d __pyx_string_tab[213]
#define __pyx_n_u_DirichletDomain __pyx_string_tab[214]
#define __pyx_kp_u_Dirichlet_Domain_of __pyx_string_tab[215]
#define __pyx_kp_u_Does_not_extend_to_link __pyx_string_tab[216]
#define __pyx_kp_u_Drills_out_the_specified_dual_c __pyx_string_tab[217]
#define __pyx_n_u_DualCurveInfo __pyx_string_tab[218]
#define __pyx_n_u_DualCurveInfo___repr __pyx_string_tab[219]
#define __pyx_kp_u_E __pyx_string_tab[220]
#define __pyx_n_u_E_2 __pyx_string_tab[221]
#define __pyx_kp_u_Each_cusp_has_a_preferred_marki __pyx_string_tab[222]
#define __pyx_kp_u_Elementary_divisors_must_be_give __pyx_string_tab[223]
#define __pyx_kp_u_Elementary_divisors_must_be_non __pyx_string_tab[224]
#define __pyx_kp_u_Empty_Triangulation __pyx_string_tab[225]
#define __pyx_kp_u_Equations_are_available_in_log_a __pyx_string_tab[226]
#define __pyx_kp_u_Export_the_Dirichlet_domain_as __pyx_string_tab[227]
#define __pyx_kp_u_Extend_the_Neumann_Zagier_matri __pyx_string_tab[228]
#define __pyx_kp_u_Extends_to_link __pyx_string_tab[229]
#define __pyx_kp_u_F __pyx_string_tab[230]
#define __pyx_n_u_F_2 __pyx_string_tab[231]
#define __pyx_kp_u_F_FreeGroup __pyx_string_tab[232]
#define __pyx_n_u_FactorCosetAction __pyx_string_tab[233]
#define __pyx_kp_u_Failed_to_allocate_memory_for_cu __pyx_string_tab[234]
#define __pyx_kp_u_Failed_to_allocate_memory_for_te __pyx_string_tab[235]
#define __pyx_kp_u_Failed_to_construct_permutation __pyx_string_tab[236]
#define __pyx_kp_u_Fill_an_empty_manifold_from_a_b __pyx_string_tab[237]
#define __pyx_kp_u_Fill_an_empty_triangulation_fro __pyx_string_tab[238]
#define __pyx_kp_u_For_a_Triangulation_that_descri __pyx_string_tab[239]
#define __pyx_kp_u_For_a_non_orientable_Triangulat __pyx_string_tab[240]
#define __pyx_n_u_Ford_domain __pyx_string_tab[241]
#define __pyx_n_u_FormatHomForSnapPea __pyx_string_tab[242]
#define __pyx_kp_u_FormatHomForSnapPea_function_f __pyx_string_tab[243]
#define __pyx_n_u_FreeGroup __pyx_string_tab[244]
#define __pyx_n_u_FuncResult __pyx_string_tab[245]
#define __pyx_n_u_FundamentalGroup __pyx_string_tab[246]
#define __pyx_n_u_G __pyx_string_tab[247]
#define __pyx_n_u_GG __pyx_string_tab[248]
#define __pyx_n_u_GapElement __pyx_string_tab[249]
#define __pyx_kp_u_Generators __pyx_string_tab[250]
#define __pyx_n_u_GeneratorsOfGroup __pyx_string_tab[251]
#define __pyx_kp_b_Generators_2 __pyx_string_tab[252]
#define __pyx_kp_u_Generators_s __pyx_string_tab[253]
#define __pyx_kp_u_Give_the_triangulation_a_new_na __pyx_string_tab[254]
#define __pyx_kp_u_Gives_the_shapes_of_the_tetrahe __pyx_string_tab[255]
#define __pyx_kp_u_Got_the_empty_link_from_PLink_a __pyx_string_tab[256]
#define __pyx_kp_u_Group __pyx_string_tab[257]
#define __pyx_kp_u_Group_elements_which_pair_the_f __pyx_string_tab[258]
#define __pyx_n_u_GrpFP __pyx_string_tab[259]
#define __pyx_n_u_GrpPerm __pyx_string_tab[260]
#define __pyx_n_u_H __pyx_string_tab[261]
#define __pyx_n_u_HTLinkExteriors __pyx_string_tab[262]
#define __pyx_n_u_HTWKnots __pyx_string_tab[263]
#define __pyx_kp_u_High_precision_shapes_must_be_co __pyx_string_tab[264]
#define __pyx_n_u_HolonomyGroup __pyx_string_tab[265]
#define __pyx_n_u_HolonomyGroup__number __pyx_string_tab[266]
#define __pyx_n_u_HomGrp __pyx_string_tab[267]
#define __pyx_n_u_HoroballViewer __pyx_string_tab[268]
#define __pyx_n_u_I __pyx_string_tab[269]
#define __pyx_n_u_IOError __pyx_string_tab[270]
#define __pyx_kp_u_If_the_SymmetryGroup_is_a_nontr __pyx_string_tab[271]
#define __pyx_kp_u_If_the_manifold_is_the_compleme __pyx_string_tab[272]
#define __pyx_kp_u_If_the_symmetry_group_is_abelia __pyx_string_tab[273]
#define __pyx_kp_u_If_there_is_more_than_one_cusp_y __pyx_string_tab[274]
#define __pyx_kp_u_If_this_triangulation_is_a_subd __pyx_string_tab[275]
#define __pyx_n_u_Image __pyx_string_tab[276]
#define __pyx_kp_u_Immutable_dictionary_whose_data __pyx_string_tab[277]
#define __pyx_n_u_ImportError __pyx_string_tab[278]
#define __pyx_kp_u_In_the_default_mode_this_functi __pyx_string_tab[279]
#define __pyx_kp_u_Incompatible_checksums_0x_x_vs_0 __pyx_string_tab[280]
#define __pyx_n_u_Index __pyx_string_tab[281]
#define __pyx_n_u_IndexError __pyx_string_tab[282]
#define __pyx_kp_u_Index_is_out_of_range __pyx_string_tab[283]
#define __pyx_n_u_Info __pyx_string_tab[284]
#define __pyx_n_u_Info___init __pyx_string_tab[285]
#define __pyx_n_u_Info__immutable __pyx_string_tab[286]
#define __pyx_n_u_Info_keys __pyx_string_tab[287]
#define __pyx_kp_u_Info_objects_are_immutable __pyx_string_tab[288]
#define __pyx_n_u_Integer __pyx_string_tab[289]
#define __pyx_kp_u_Invalid_generator_status __pyx_string_tab[290]
#define __pyx_kp_u_Invalid_permutation_data __pyx_string_tab[291]
#define __pyx_kp_u_Invalid_pickle_byte_sequence __pyx_string_tab[292]
#define __pyx_n_u_IsCompositionMappingRep __pyx_string_tab[293]
#define __pyx_n_u_IsSubgroupFpGroup __pyx_string_tab[294]
#define __pyx_n_u_IsToPermGroupHomomorphismByImage __pyx_string_tab[295]
#define __pyx_n_u_Isometry __pyx_string_tab[296]
#define __pyx_n_u_Isometry___init __pyx_string_tab[297]
#define __pyx_n_u_Isometry___repr __pyx_string_tab[298]
#define __pyx_n_u_Isometry_cusp_images __pyx_string_tab[299]
#define __pyx_n_u_Isometry_cusp_maps __pyx_string_tab[300]
#define __pyx_n_u_Isometry_extends_to_link __pyx_string_tab[301]
#define __pyx_n_u_Isometry_num_cusps __pyx_string_tab[302]
#define __pyx_kp_u_Iterator_Sequence_for_Alternati __pyx_string_tab[303]
#define __pyx_kp_u_Iterator_Sequence_for_nonAltern __pyx_string_tab[304]
#define __pyx_n_u_K __pyx_string_tab[305]
#define __pyx_n_u_K7_1 __pyx_string_tab[306]
#define __pyx_n_u_KLPProjection __pyx_string_tab[307]
#define __pyx_n_u_KeyError __pyx_string_tab[308]
#define __pyx_n_u_Klein __pyx_string_tab[309]
#define __pyx_kp_u_Klein_bottle_cusp __pyx_string_tab[310]
#define __pyx_n_u_KnotExteriors __pyx_string_tab[311]
#define __pyx_n_u_KnotExteriors___getitem __pyx_string_tab[312]
#define __pyx_n_u_KnotExteriors___init __pyx_string_tab[313]
#define __pyx_kp_u_Knots_in_S_3_which_appear_in_the __pyx_string_tab[314]
#define __pyx_n_u_L __pyx_string_tab[315]
#define __pyx_n_u_L104001 __pyx_string_tab[316]
#define __pyx_n_u_L13n9331 __pyx_string_tab[317]
#define __pyx_kp_u_L13n9331_3_4_2_3_2_1 __pyx_string_tab[318]
#define __pyx_n_u_LE __pyx_string_tab[319]
#define __pyx_kp_u_L_d_2d_3d __pyx_string_tab[320]
#define __pyx_n_u_LengthSpectrum __pyx_string_tab[321]
#define __pyx_n_u_LengthSpectrumFormatString __pyx_string_tab[322]
#define __pyx_n_u_LengthSpectrumFormatStringBase __pyx_string_tab[323]
#define __pyx_n_u_LengthSpectrumFormatStringWithWo __pyx_string_tab[324]
#define __pyx_n_u_LengthSpectrumInfo __pyx_string_tab[325]
#define __pyx_n_u_LengthSpectrumInfo___repr __pyx_string_tab[326]
#define __pyx_n_u_LengthSpectrum___repr __pyx_string_tab[327]
#define __pyx_n_u_Link __pyx_string_tab[328]
#define __pyx_n_u_LinkEditor __pyx_string_tab[329]
#define __pyx_n_u_LinkExteriors __pyx_string_tab[330]
#define __pyx_n_u_LinkManager __pyx_string_tab[331]
#define __pyx_kp_u_Link_Projection __pyx_string_tab[332]
#define __pyx_n_u_ListOnePerLine __pyx_string_tab[333]
#define __pyx_n_u_ListOnePerLine___repr __pyx_string_tab[334]
#define __pyx_n_u_LowIndexSubgroups __pyx_string_tab[335]
#define __pyx_n_u_LowIndexSubgroupsFpGroup __pyx_string_tab[336]
#define __pyx_n_u_M __pyx_string_tab[337]
#define __pyx_n_u_M0 __pyx_string_tab[338]
#define __pyx_n_u_M1 __pyx_string_tab[339]
#define __pyx_n_u_MTLinks __pyx_string_tab[340]
#define __pyx_kp_u_M_ptolemy_variety_N_obstruction __pyx_string_tab[341]
#define __pyx_n_u_MagmaElement __pyx_string_tab[342]
#define __pyx_n_u_Manifold __pyx_string_tab[343]
#define __pyx_n_u_Manifold__canonical_cells_are_te __pyx_string_tab[344]
#define __pyx_kp_u_Manifold__canonical_cells_are_te_2 __pyx_string_tab[345]
#define __pyx_n_u_Manifold__canonical_retriangulat __pyx_string_tab[346]
#define __pyx_kp_u_Manifold__canonical_retriangulat_2 __pyx_string_tab[347]
#define __pyx_n_u_Manifold__choose_generators __pyx_string_tab[348]
#define __pyx_n_u_Manifold__choose_generators_info __pyx_string_tab[349]
#define __pyx_n_u_Manifold__complex_volume __pyx_string_tab[350]
#define __pyx_n_u_Manifold__cusp_cross_section_inf __pyx_string_tab[351]
#define __pyx_n_u_Manifold__from_bytes __pyx_string_tab[352]
#define __pyx_kp_u_Manifold__from_bytes_line_283 __pyx_string_tab[353]
#define __pyx_n_u_Manifold__from_isosig __pyx_string_tab[354]
#define __pyx_n_u_Manifold__from_string __pyx_string_tab[355]
#define __pyx_kp_u_Manifold__from_string_line_267 __pyx_string_tab[356]
#define __pyx_n_u_Manifold__get_tetrahedra_shapes __pyx_string_tab[357]
#define __pyx_n_u_Manifold__identify __pyx_string_tab[358]
#define __pyx_n_u_Manifold__is_isometric_to __pyx_string_tab[359]
#define __pyx_kp_u_Manifold__is_isometric_to_line_1 __pyx_string_tab[360]
#define __pyx_n_u_Manifold__number __pyx_string_tab[361]
#define __pyx_n_u_Manifold__polish_hyperbolic_stru __pyx_string_tab[362]
#define __pyx_n_u_Manifold__precision __pyx_string_tab[363]
#define __pyx_n_u_Manifold_browse __pyx_string_tab[364]
#define __pyx_kp_u_Manifold_browse_line_386 __pyx_string_tab[365]
#define __pyx_n_u_Manifold_canonize __pyx_string_tab[366]
#define __pyx_kp_u_Manifold_canonize_line_146 __pyx_string_tab[367]
#define __pyx_n_u_Manifold_chern_simons __pyx_string_tab[368]
#define __pyx_kp_u_Manifold_chern_simons_line_821 __pyx_string_tab[369]
#define __pyx_n_u_Manifold_copy __pyx_string_tab[370]
#define __pyx_kp_u_Manifold_copy_line_308 __pyx_string_tab[371]
#define __pyx_n_u_Manifold_cover __pyx_string_tab[372]
#define __pyx_kp_u_Manifold_cover_line_549 __pyx_string_tab[373]
#define __pyx_n_u_Manifold_covers __pyx_string_tab[374]
#define __pyx_kp_u_Manifold_covers_line_618 __pyx_string_tab[375]
#define __pyx_n_u_Manifold_cusp_info __pyx_string_tab[376]
#define __pyx_kp_u_Manifold_cusp_info_line_1128 __pyx_string_tab[377]
#define __pyx_n_u_Manifold_cusp_neighborhood __pyx_string_tab[378]
#define __pyx_kp_u_Manifold_cusp_neighborhood_line __pyx_string_tab[379]
#define __pyx_n_u_Manifold_dehn_fill __pyx_string_tab[380]
#define __pyx_kp_u_Manifold_dehn_fill __pyx_string_tab[381]
#define __pyx_kp_u_Manifold_dehn_fill_line_1251 __pyx_string_tab[382]
#define __pyx_n_u_Manifold_dirichlet_domain __pyx_string_tab[383]
#define __pyx_kp_u_Manifold_dirichlet_domain_line_3 __pyx_string_tab[384]
#define __pyx_n_u_Manifold_drill __pyx_string_tab[385]
#define __pyx_kp_u_Manifold_drill_line_1505 __pyx_string_tab[386]
#define __pyx_n_u_Manifold_dual_curves __pyx_string_tab[387]
#define __pyx_kp_u_Manifold_dual_curves_line_1403 __pyx_string_tab[388]
#define __pyx_n_u_Manifold_filled_triangulation __pyx_string_tab[389]
#define __pyx_kp_u_Manifold_filled_triangulation_li __pyx_string_tab[390]
#define __pyx_n_u_Manifold_from_Triangulation __pyx_string_tab[391]
#define __pyx_n_u_Manifold_fundamental_group __pyx_string_tab[392]
#define __pyx_kp_u_Manifold_fundamental_group_line __pyx_string_tab[393]
#define __pyx_n_u_Manifold_init_hyperbolic_structu __pyx_string_tab[394]
#define __pyx_n_u_Manifold_is_isometric_to __pyx_string_tab[395]
#define __pyx_n_u_Manifold_is_two_bridge __pyx_string_tab[396]
#define __pyx_kp_u_Manifold_is_two_bridge_line_1647 __pyx_string_tab[397]
#define __pyx_n_u_Manifold_length_spectrum __pyx_string_tab[398]
#define __pyx_kp_u_Manifold_length_spectrum_line_14 __pyx_string_tab[399]
#define __pyx_kp_u_Manifold_must_be_pickled_with__t __pyx_string_tab[400]
#define __pyx_n_u_Manifold_set_peripheral_curves __pyx_string_tab[401]
#define __pyx_kp_u_Manifold_set_peripheral_curves __pyx_string_tab[402]
#define __pyx_kp_u_Manifold_set_peripheral_curves_l __pyx_string_tab[403]
#define __pyx_n_u_Manifold_set_target_holonomy __pyx_string_tab[404]
#define __pyx_n_u_Manifold_set_tetrahedra_shapes __pyx_string_tab[405]
#define __pyx_kp_u_Manifold_set_tetrahedra_shapes __pyx_string_tab[406]
#define __pyx_n_u_Manifold_solution_type __pyx_string_tab[407]
#define __pyx_kp_u_Manifold_solution_type_line_1063 __pyx_string_tab[408]
#define __pyx_n_u_Manifold_split __pyx_string_tab[409]
#define __pyx_kp_u_Manifold_split_line_1768 __pyx_string_tab[410]
#define __pyx_n_u_Manifold_splitting_surfaces __pyx_string_tab[411]
#define __pyx_kp_u_Manifold_splitting_surfaces_line __pyx_string_tab[412]
#define __pyx_n_u_Manifold_symmetric_triangulation __pyx_string_tab[413]
#define __pyx_kp_u_Manifold_symmetric_triangulation_2 __pyx_string_tab[414]
#define __pyx_n_u_Manifold_symmetry_group __pyx_string_tab[415]
#define __pyx_n_u_Manifold_tetrahedra_shapes __pyx_string_tab[416]
#define __pyx_kp_u_Manifold_tetrahedra_shapes_line __pyx_string_tab[417]
#define __pyx_n_u_Manifold_use_field_conversion __pyx_string_tab[418]
#define __pyx_n_u_Manifold_volume __pyx_string_tab[419]
#define __pyx_kp_u_Manifold_volume_line_728 __pyx_string_tab[420]
#define __pyx_n_u_Manifold_without_hyperbolic_stru __pyx_string_tab[421]
#define __pyx_kp_u_Manifold_without_hyperbolic_stru_2 __pyx_string_tab[422]
#define __pyx_kp_u_Manifolds_must_be_non_empty __pyx_string_tab[423]
#define __pyx_n_u_MatrixParity __pyx_string_tab[424]
#define __pyx_n_u_MatrixWithExplanations __pyx_string_tab[425]
#define __pyx_n_u_MatrixWithExplanations___init __pyx_string_tab[426]
#define __pyx_n_u_MatrixWithExplanations___repr __pyx_string_tab[427]
#define __pyx_n_u_MatrixWithExplanations___repr_2 __pyx_string_tab[428]
#define __pyx_n_u_MorwenLinks __pyx_string_tab[429]
#define __pyx_n_u_MorwenLinks___init __pyx_string_tab[430]
#define __pyx_n_u_MsgIO __pyx_string_tab[431]
#define __pyx_n_u_MsgIO___init __pyx_string_tab[432]
#define __pyx_n_u_N __pyx_string_tab[433]
#define __pyx_kp_u_N_has_to_be_2_15 __pyx_string_tab[434]
#define __pyx_n_u_NeumannZagierTypeEquations __pyx_string_tab[435]
#define __pyx_n_u_NeumannZagierTypeEquations___ini __pyx_string_tab[436]
#define __pyx_n_u_NeumannZagierTypeEquations___rep __pyx_string_tab[437]
#define __pyx_kp_u_New_triangulation_received_from __pyx_string_tab[438]
#define __pyx_kp_u_No_associated_link_known __pyx_string_tab[439]
#define __pyx_kp_u_No_tetrahedra_data_provided __pyx_string_tab[440]
#define __pyx_kp_u_Non_orientable __pyx_string_tab[441]
#define __pyx_n_u_NonalternatingKnotExteriors __pyx_string_tab[442]
#define __pyx_n_u_NonalternatingKnotExteriors___in __pyx_string_tab[443]
#define __pyx_n_u_Nonalternating_numbers __pyx_string_tab[444]
#define __pyx_n_u_Nonalternating_offsets __pyx_string_tab[445]
#define __pyx_n_u_Nonalternating_table __pyx_string_tab[446]
#define __pyx_n_u_None __pyx_string_tab[447]
#define __pyx_kp_u_None __pyx_string_tab[448]
#define __pyx_n_u_Nonorientable_lengths __pyx_string_tab[449]
#define __pyx_n_u_NormalSurfaceInfo __pyx_string_tab[450]
#define __pyx_n_u_NormalSurfaceInfo___repr __pyx_string_tab[451]
#define __pyx_n_u_NotImplemented __pyx_string_tab[452]
#define __pyx_n_u_NotImplementedError __pyx_string_tab[453]
#define __pyx_kp_u_Not_a_valid_permutation __pyx_string_tab[454]
#define __pyx_kp_u_Not_within_Sage __pyx_string_tab[455]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[456]
#define __pyx_n_u_Num_Alternating __pyx_string_tab[457]
#define __pyx_n_u_Num_Nonalternating __pyx_string_tab[458]
#define __pyx_n_u_Number __pyx_string_tab[459]
#define __pyx_kp_u_Number_of_opacities_does_not_mat __pyx_string_tab[460]
#define __pyx_kp_u_Number_of_permutations_is_not_th __pyx_string_tab[461]
#define __pyx_n_u_O __pyx_string_tab[462]
#define __pyx_n_u_O31 __pyx_string_tab[463]
#define __pyx_n_u_O31_generators __pyx_string_tab[464]
#define __pyx_n_u_ObsCensusKnots __pyx_string_tab[465]
#define __pyx_n_u_ObsCensusKnots___getitem __pyx_string_tab[466]
#define __pyx_n_u_ObsCensusKnots___init __pyx_string_tab[467]
#define __pyx_n_u_ObsCensusKnots___repr __pyx_string_tab[468]
#define __pyx_n_u_ObsLinkExteriors __pyx_string_tab[469]
#define __pyx_n_u_ObsLinkExteriors___getitem __pyx_string_tab[470]
#define __pyx_n_u_ObsLinkExteriors___init __pyx_string_tab[471]
#define __pyx_n_u_ObsLinkExteriors___repr __pyx_string_tab[472]
#define __pyx_n_u_ObsMorwenLinks __pyx_string_tab[473]
#define __pyx_n_u_ObsMorwenLinks___getitem __pyx_string_tab[474]
#define __pyx_n_u_ObsMorwenLinks___init __pyx_string_tab[475]
#define __pyx_n_u_ObsNonorientableClosedCensus __pyx_string_tab[476]
#define __pyx_n_u_ObsNonorientableClosedCensus___g __pyx_string_tab[477]
#define __pyx_n_u_ObsNonorientableClosedCensus___i __pyx_string_tab[478]
#define __pyx_n_u_ObsNonorientableCuspedCensus __pyx_string_tab[479]
#define __pyx_n_u_ObsNonorientableCuspedCensus___i __pyx_string_tab[480]
#define __pyx_n_u_ObsNonorientableCuspedCensus_loo __pyx_string_tab[481]
#define __pyx_n_u_ObsOrientableClosedCensus __pyx_string_tab[482]
#define __pyx_n_u_ObsOrientableClosedCensus___geti __pyx_string_tab[483]
#define __pyx_n_u_ObsOrientableClosedCensus___init __pyx_string_tab[484]
#define __pyx_n_u_ObsOrientableCuspedCensus __pyx_string_tab[485]
#define __pyx_kp_u_Obsolete __pyx_string_tab[486]
#define __pyx_kp_u_Obsolete_2 __pyx_string_tab[487]
#define __pyx_kp_u_Obstruction_class_has_wrong_leng __pyx_string_tab[488]
#define __pyx_kp_u_Opens_browser_window_with_a_gra __pyx_string_tab[489]
#define __pyx_n_u_Orbifold1 __pyx_string_tab[490]
#define __pyx_n_u_Orientability __pyx_string_tab[491]
#define __pyx_n_u_Orientable __pyx_string_tab[492]
#define __pyx_n_u_Orientable_lengths __pyx_string_tab[493]
#define __pyx_kp_u_Out_of_memory __pyx_string_tab[494]
#define __pyx_n_u_PD_code __pyx_string_tab[495]
#define __pyx_kp_u_PLink_was_not_imported __pyx_string_tab[496]
#define __pyx_kp_u_P_crossings_0_9_P_alternation_a __pyx_string_tab[497]
#define __pyx_kp_u_P_crossings_0_9_P_components_0 __pyx_string_tab[498]
#define __pyx_kp_u_P_crossings_0_9___P_index_0_9_P __pyx_string_tab[499]
#define __pyx_kp_u_Perform_random_Pachner_moves_on __pyx_string_tab[500]
#define __pyx_n_u_PermutationGroup __pyx_string_tab[501]
#define __pyx_n_u_PermutationGroupElement __pyx_string_tab[502]
#define __pyx_n_u_PickleError __pyx_string_tab[503]
#define __pyx_kp_u_Please_specify_a_file_name __pyx_string_tab[504]
#define __pyx_kp_u_Please_specify_filled_or_complet __pyx_string_tab[505]
#define __pyx_n_u_PolyhedronViewer __pyx_string_tab[506]
#define __pyx_n_u_PreImage __pyx_string_tab[507]
#define __pyx_n_u_PresentationMatrix __pyx_string_tab[508]
#define __pyx_n_u_PresentationMatrix___reduce_cyth __pyx_string_tab[509]
#define __pyx_n_u_PresentationMatrix___setstate_cy __pyx_string_tab[510]
#define __pyx_n_u_PresentationMatrix_add_rows __pyx_string_tab[511]
#define __pyx_n_u_PresentationMatrix_explode __pyx_string_tab[512]
#define __pyx_n_u_PresentationMatrix_get_data __pyx_string_tab[513]
#define __pyx_n_u_PresentationMatrix_row_op __pyx_string_tab[514]
#define __pyx_n_u_PresentationMatrix_simplified_ma __pyx_string_tab[515]
#define __pyx_n_u_PresentationMatrix_simplify __pyx_string_tab[516]
#define __pyx_kp_u_Q __pyx_string_tab[517]
#define __pyx_n_u_Q_2 __pyx_string_tab[518]
#define __pyx_n_u_R __pyx_string_tab[519]
#define __pyx_n_u_RawNumber __pyx_string_tab[520]
#define __pyx_kp_u_Relators __pyx_string_tab[521]
#define __pyx_kp_u_Removing_any_finite_vertices_by __pyx_string_tab[522]
#define __pyx_kp_u_Represents_an_isometry_from_one __pyx_string_tab[523]
#define __pyx_kp_u_Result_is_symplectic_up_to_facto __pyx_string_tab[524]
#define __pyx_kp_u_Return_a_class_HolonomyGroup_re __pyx_string_tab[525]
#define __pyx_kp_u_Return_a_detailed_list_of_all_t __pyx_string_tab[526]
#define __pyx_kp_u_Return_a_list_of_info_objects_d __pyx_string_tab[527]
#define __pyx_kp_u_Return_a_new_Manifold_where_the __pyx_string_tab[528]
#define __pyx_kp_u_Return_a_new_manifold_where_the __pyx_string_tab[529]
#define __pyx_kp_u_Return_a_reasonably_short_byte __pyx_string_tab[530]
#define __pyx_kp_u_Return_a_string_containing_the __pyx_string_tab[531]
#define __pyx_kp_u_Return_the_Dowker_Thistlethwait __pyx_string_tab[532]
#define __pyx_kp_u_Return_the_abelianization_of_th __pyx_string_tab[533]
#define __pyx_kp_u_Return_the_center_of_the_symmet __pyx_string_tab[534]
#define __pyx_kp_u_Return_the_commutator_subgroup __pyx_string_tab[535]
#define __pyx_kp_u_Return_the_current_generators_i __pyx_string_tab[536]
#define __pyx_kp_u_Return_the_letters_representing __pyx_string_tab[537]
#define __pyx_kp_u_Return_the_name_of_the_triangul __pyx_string_tab[538]
#define __pyx_kp_u_Return_the_number_of_tetrahedra __pyx_string_tab[539]
#define __pyx_kp_u_Return_the_order_of_the_symmetr __pyx_string_tab[540]
#define __pyx_kp_u_Return_the_original_geometric_g __pyx_string_tab[541]
#define __pyx_kp_u_Return_the_total_number_of_cusp __pyx_string_tab[542]
#define __pyx_kp_u_Return_whether_a_one_cusped_has __pyx_string_tab[543]
#define __pyx_kp_u_Return_whether_the_SymmetryGrou __pyx_string_tab[544]
#define __pyx_kp_u_Return_whether_the_full_symmetr __pyx_string_tab[545]
#define __pyx_kp_u_Return_whether_the_manifold_has __pyx_string_tab[546]
#define __pyx_kp_u_Return_whether_the_symmetry_gro __pyx_string_tab[547]
#define __pyx_kp_u_Return_whether_the_symmetry_gro_2 __pyx_string_tab[548]
#define __pyx_kp_u_Return_whether_the_underlying_3 __pyx_string_tab[549]
#define __pyx_kp_u_Returns_True_if_M_and_N_are_iso __pyx_string_tab[550]
#define __pyx_kp_u_Returns_True_if_and_only_if_the __pyx_string_tab[551]
#define __pyx_kp_u_Returns_True_if_and_only_if_the_2 __pyx_string_tab[552]
#define __pyx_kp_u_Returns_a_Dehn_filling_descript __pyx_string_tab[553]
#define __pyx_kp_u_Returns_a_Manifold_computed_dir __pyx_string_tab[554]
#define __pyx_kp_u_Returns_a_NeumannZagierTypeEqua __pyx_string_tab[555]
#define __pyx_kp_u_Returns_a_Triangulation_compute __pyx_string_tab[556]
#define __pyx_kp_u_Returns_a_class_DirichletDomain __pyx_string_tab[557]
#define __pyx_kp_u_Returns_a_class_FundamentalGrou __pyx_string_tab[558]
#define __pyx_kp_u_Returns_a_class_Manifold_repres __pyx_string_tab[559]
#define __pyx_kp_u_Returns_a_class_Triangulation_r __pyx_string_tab[560]
#define __pyx_kp_u_Returns_a_complete_list_of_comb __pyx_string_tab[561]
#define __pyx_kp_u_Returns_a_copy_of_the_manifold __pyx_string_tab[562]
#define __pyx_kp_u_Returns_a_copy_of_the_triangula __pyx_string_tab[563]
#define __pyx_kp_u_Returns_a_dictionary_whose_keys __pyx_string_tab[564]
#define __pyx_kp_u_Returns_a_list_of_Triangulation __pyx_string_tab[565]
#define __pyx_kp_u_Returns_a_list_of_class_Manifol __pyx_string_tab[566]
#define __pyx_kp_u_Returns_a_list_of_geodesics_wit __pyx_string_tab[567]
#define __pyx_kp_u_Returns_a_list_of_meridian_long __pyx_string_tab[568]
#define __pyx_kp_u_Returns_a_list_of_the_O31Matric __pyx_string_tab[569]
#define __pyx_kp_u_Returns_a_list_of_variables_and __pyx_string_tab[570]
#define __pyx_kp_u_Returns_a_string_which_will_def __pyx_string_tab[571]
#define __pyx_kp_u_Returns_a_word_representing_a_c __pyx_string_tab[572]
#define __pyx_kp_u_Returns_a_word_representing_a_c_2 __pyx_string_tab[573]
#define __pyx_kp_u_Returns_an_class_AbelianGroup_r __pyx_string_tab[574]
#define __pyx_kp_u_Returns_an_info_object_containi __pyx_string_tab[575]
#define __pyx_kp_u_Returns_an_info_object_containi_2 __pyx_string_tab[576]
#define __pyx_kp_u_Returns_information_about_the_c __pyx_string_tab[577]
#define __pyx_kp_u_Returns_self_as_a_class_Triangu __pyx_string_tab[578]
#define __pyx_kp_u_Returns_the_Chern_Simons_invari __pyx_string_tab[579]
#define __pyx_kp_u_Returns_the_decorated_isomorphi __pyx_string_tab[580]
#define __pyx_kp_u_Returns_the_number_of_fake_cusp __pyx_string_tab[581]
#define __pyx_kp_u_Returns_the_obstruction_classes __pyx_string_tab[582]
#define __pyx_kp_u_Returns_the_obstruction_classes_2 __pyx_string_tab[583]
#define __pyx_kp_u_Returns_the_product_of_group_el __pyx_string_tab[584]
#define __pyx_kp_u_Returns_the_type_of_the_current __pyx_string_tab[585]
#define __pyx_kp_u_Returns_the_volume_of_the_curre __pyx_string_tab[586]
#define __pyx_kp_u_Reverses_the_orientation_of_the __pyx_string_tab[587]
#define __pyx_n_u_RuntimeError __pyx_string_tab[588]
#define __pyx_n_u_S5 __pyx_string_tab[589]
#define __pyx_n_u_SC __pyx_string_tab[590]
#define __pyx_n_u_SL2C __pyx_string_tab[591]
#define __pyx_n_u_SNAPPEA_MANIFOLD_DIRECTORY __pyx_string_tab[592]
#define __pyx_n_u_SageNotAvailable __pyx_string_tab[593]
#define __pyx_n_u_SageObject __pyx_string_tab[594]
#define __pyx_kp_u_Save_Triangulation __pyx_string_tab[595]
#define __pyx_kp_u_Save_the_Dirichlet_domain_as_a __pyx_string_tab[596]
#define __pyx_kp_u_Save_the_triangulation_as_a_Sna __pyx_string_tab[597]
#define __pyx_kp_u_Searches_for_connected_closed_n __pyx_string_tab[598]
#define __pyx_kp_u_Send_to_SnapPy __pyx_string_tab[599]
#define __pyx_kp_u_Set_the_Dehn_filling_coefficien __pyx_string_tab[600]
#define __pyx_kp_u_Set_the_Dehn_filling_coefficien_2 __pyx_string_tab[601]
#define __pyx_n_u_ShapeInfo __pyx_string_tab[602]
#define __pyx_n_u_ShapeInfo___repr __pyx_string_tab[603]
#define __pyx_n_u_ShortMatrixParity __pyx_string_tab[604]
#define __pyx_n_u_SnapPeaFatalError __pyx_string_tab[605]
#define __pyx_n_u_SnapPea_KLPProjection __pyx_string_tab[606]
#define __pyx_kp_u_SnapPea_crashed_in_function __pyx_string_tab[607]
#define __pyx_kp_u_SnapPea_failed_to_compute_any_pa __pyx_string_tab[608]
#define __pyx_kp_u_SnapPea_failed_to_find_the_canon __pyx_string_tab[609]
#define __pyx_kp_u_SnapPea_failed_to_read_the_censu __pyx_string_tab[610]
#define __pyx_n_u_SnapPea_interrupt __pyx_string_tab[611]
#define __pyx_kp_u_SnapPea_kernel_failed_when_compu __pyx_string_tab[612]
#define __pyx_kp_u_SnapPea_kernel_failed_when_compu_2 __pyx_string_tab[613]
#define __pyx_kp_u_SnapPea_kernel_failed_when_split __pyx_string_tab[614]
#define __pyx_kp_u_SnapPea_kernel_style_estimation __pyx_string_tab[615]
#define __pyx_kp_u_SnapPea_only_found __pyx_string_tab[616]
#define __pyx_n_u_SnapPyCache __pyx_string_tab[617]
#define __pyx_n_u_SnapPyHP __pyx_string_tab[618]
#define __pyx_kp_u_SnapPy_has_no_data_on_links_with __pyx_string_tab[619]
#define __pyx_n_u_SolutionType __pyx_string_tab[620]
#define __pyx_kp_u_Solution_type_is_s __pyx_string_tab[621]
#define __pyx_kp_u_Split_the_manifold_open_along_a __pyx_string_tab[622]
#define __pyx_kp_u_Splitting_S__1_0_b1_A0_a0_B1 __pyx_string_tab[623]
#define __pyx_kp_u_Splitting_S__d_d __pyx_string_tab[624]
#define __pyx_n_u_Stabilizer __pyx_string_tab[625]
#define __pyx_kp_u_Starting_the_link_editor_Select __pyx_string_tab[626]
#define __pyx_n_u_StopIteration __pyx_string_tab[627]
#define __pyx_n_u_StrLongestLen __pyx_string_tab[628]
#define __pyx_n_u_StrLongestLen_locals_genexpr __pyx_string_tab[629]
#define __pyx_kp_u_Supply_a_manifold_or_generators __pyx_string_tab[630]
#define __pyx_kp_u_Supported_cover_types_are_all_an __pyx_string_tab[631]
#define __pyx_kp_u_Supported_methods_are_low_index __pyx_string_tab[632]
#define __pyx_n_u_Surface __pyx_string_tab[633]
#define __pyx_n_u_SymmetryGroup __pyx_string_tab[634]
#define __pyx_n_u_SymmetryGroup___reduce_cython __pyx_string_tab[635]
#define __pyx_n_u_SymmetryGroup___setstate_cython __pyx_string_tab[636]
#define __pyx_n_u_SymmetryGroup_abelian_descriptio __pyx_string_tab[637]
#define __pyx_kp_u_SymmetryGroup_abelian_descriptio_2 __pyx_string_tab[638]
#define __pyx_n_u_SymmetryGroup_abelianization __pyx_string_tab[639]
#define __pyx_kp_u_SymmetryGroup_abelianization_lin __pyx_string_tab[640]
#define __pyx_n_u_SymmetryGroup_center __pyx_string_tab[641]
#define __pyx_kp_u_SymmetryGroup_center_line_256 __pyx_string_tab[642]
#define __pyx_n_u_SymmetryGroup_commutator_subgrou __pyx_string_tab[643]
#define __pyx_kp_u_SymmetryGroup_commutator_subgrou_2 __pyx_string_tab[644]
#define __pyx_n_u_SymmetryGroup_direct_product_des __pyx_string_tab[645]
#define __pyx_kp_u_SymmetryGroup_direct_product_des_2 __pyx_string_tab[646]
#define __pyx_n_u_SymmetryGroup_is_S5 __pyx_string_tab[647]
#define __pyx_n_u_SymmetryGroup_is_abelian __pyx_string_tab[648]
#define __pyx_kp_u_SymmetryGroup_is_abelian_line_72 __pyx_string_tab[649]
#define __pyx_n_u_SymmetryGroup_is_amphicheiral __pyx_string_tab[650]
#define __pyx_kp_u_SymmetryGroup_is_amphicheiral_li __pyx_string_tab[651]
#define __pyx_n_u_SymmetryGroup_is_dihedral __pyx_string_tab[652]
#define __pyx_kp_u_SymmetryGroup_is_dihedral_line_1 __pyx_string_tab[653]
#define __pyx_n_u_SymmetryGroup_is_direct_product __pyx_string_tab[654]
#define __pyx_kp_u_SymmetryGroup_is_direct_product_2 __pyx_string_tab[655]
#define __pyx_n_u_SymmetryGroup_is_full_group __pyx_string_tab[656]
#define __pyx_kp_u_SymmetryGroup_is_full_group_line __pyx_string_tab[657]
#define __pyx_n_u_SymmetryGroup_is_invertible_knot __pyx_string_tab[658]
#define __pyx_kp_u_SymmetryGroup_is_invertible_knot_2 __pyx_string_tab[659]
#define __pyx_n_u_SymmetryGroup_is_polyhedral __pyx_string_tab[660]
#define __pyx_n_u_SymmetryGroup_isometries __pyx_string_tab[661]
#define __pyx_kp_u_SymmetryGroup_isometries_line_29 __pyx_string_tab[662]
#define __pyx_n_u_SymmetryGroup_multiply_elements __pyx_string_tab[663]
#define __pyx_kp_u_SymmetryGroup_multiply_elements_2 __pyx_string_tab[664]
#define __pyx_n_u_SymmetryGroup_order __pyx_string_tab[665]
#define __pyx_kp_u_SymmetryGroup_order_line_62 __pyx_string_tab[666]
#define __pyx_n_u_SymmetryGroup_polyhedral_descrip __pyx_string_tab[667]
#define __pyx_n_u_T __pyx_string_tab[668]
#define __pyx_n_u_TEXT __pyx_string_tab[669]
#define __pyx_kp_u_Tetrahedra_data_appears_invalid __pyx_string_tab[670]
#define __pyx_kp_u_That_Magma_type_not_recognized __pyx_string_tab[671]
#define __pyx_kp_u_The_Chern_Simons_invariant_isn_t __pyx_string_tab[672]
#define __pyx_kp_u_The_Dehn_filling_coefficients_mu __pyx_string_tab[673]
#define __pyx_kp_u_The_Dirichlet_Domain_was_compute __pyx_string_tab[674]
#define __pyx_kp_u_The_Dirichlet_Domain_was_not_com __pyx_string_tab[675]
#define __pyx_kp_u_The_Dirichlet_construction_faile __pyx_string_tab[676]
#define __pyx_kp_u_The_Dirichlet_domain_could_not_b __pyx_string_tab[677]
#define __pyx_kp_u_The_Ford_domain_construction_fai __pyx_string_tab[678]
#define __pyx_kp_u_The_HoroballViewer_class_was_not __pyx_string_tab[679]
#define __pyx_kp_u_The_Manifold_is_not_orientable_s __pyx_string_tab[680]
#define __pyx_kp_u_The_MorwenLinks_class_has_been_r __pyx_string_tab[681]
#define __pyx_kp_u_The_Morwen_8_tetrahedra_manifold __pyx_string_tab[682]
#define __pyx_kp_u_The_PolyhedronViewer_class_was_n __pyx_string_tab[683]
#define __pyx_kp_u_The_SnapPea_kernel_couldn_t_comp __pyx_string_tab[684]
#define __pyx_kp_u_The_SnapPea_kernel_was_not_able __pyx_string_tab[685]
#define __pyx_kp_u_The_Triangulation_is_already_ori __pyx_string_tab[686]
#define __pyx_kp_u_The_Triangulation_is_empty __pyx_string_tab[687]
#define __pyx_kp_u_The_Triangulation_is_empty_2 __pyx_string_tab[688]
#define __pyx_kp_u_The_Triangulation_must_be_empty __pyx_string_tab[689]
#define __pyx_kp_u_The_amount_of_data_given_is_not __pyx_string_tab[690]
#define __pyx_kp_u_The_braid_word_is_invalid __pyx_string_tab[691]
#define __pyx_kp_u_The_census_knot_s_was_not_found __pyx_string_tab[692]
#define __pyx_kp_u_The_curve_is_not_isotopic_to_a_g __pyx_string_tab[693]
#define __pyx_kp_u_The_cusp_neighborhood_constructi __pyx_string_tab[694]
#define __pyx_kp_u_The_data_given_do_not_have_the_r __pyx_string_tab[695]
#define __pyx_kp_u_The_data_provided_are_invalid_fo __pyx_string_tab[696]
#define __pyx_kp_u_The_data_provided_does_not_give __pyx_string_tab[697]
#define __pyx_kp_u_The_data_provided_does_not_give_2 __pyx_string_tab[698]
#define __pyx_kp_u_The_drilling_curve_requested_is __pyx_string_tab[699]
#define __pyx_kp_u_The_elementary_divisors_must_for __pyx_string_tab[700]
#define __pyx_kp_u_The_empty_triangulation_has_no_n __pyx_string_tab[701]
#define __pyx_kp_u_The_full_symmetry_group_is_not_k __pyx_string_tab[702]
#define __pyx_kp_u_The_full_symmetry_group_not_know __pyx_string_tab[703]
#define __pyx_kp_u_The_generator_data_does_not_star __pyx_string_tab[704]
#define __pyx_kp_u_The_homomorphism_image_is_not_a __pyx_string_tab[705]
#define __pyx_kp_u_The_horoball_construction_failed __pyx_string_tab[706]
#define __pyx_kp_u_The_link_complement_s_was_not_fo __pyx_string_tab[707]
#define __pyx_kp_u_The_manifold_file __pyx_string_tab[708]
#define __pyx_kp_u_The_method_must_be_fold_or_layer __pyx_string_tab[709]
#define __pyx_kp_u_The_number_of_fillings_specified __pyx_string_tab[710]
#define __pyx_kp_u_The_peripheral_data __pyx_string_tab[711]
#define __pyx_kp_u_The_peripheral_data_s_is_not_acc __pyx_string_tab[712]
#define __pyx_kp_u_The_permutation_list_is_invalid __pyx_string_tab[713]
#define __pyx_kp_u_The_solution_type_is_s __pyx_string_tab[714]
#define __pyx_kp_u_The_specified_cusp_s_does_not_ex __pyx_string_tab[715]
#define __pyx_kp_u_The_specified_edge_index_s_is_in __pyx_string_tab[716]
#define __pyx_kp_u_The_specified_face_index_s_is_in __pyx_string_tab[717]
#define __pyx_kp_u_The_specified_indices_to_be_fill __pyx_string_tab[718]
#define __pyx_kp_u_The_specified_tetrahedron_s_does __pyx_string_tab[719]
#define __pyx_kp_u_The_symmetry_group_has_only_d_el __pyx_string_tab[720]
#define __pyx_kp_u_The_symmetry_group_is_not_a_nont __pyx_string_tab[721]
#define __pyx_kp_u_The_symmetry_group_is_not_abelia __pyx_string_tab[722]
#define __pyx_kp_u_The_symmetry_group_is_not_polyhe __pyx_string_tab[723]
#define __pyx_kp_u_The_triangulation_construction_f __pyx_string_tab[724]
#define __pyx_kp_u_The_word_contains_a_non_generato __pyx_string_tab[725]
#define __pyx_kp_u_There_are_only_201_census_knots __pyx_string_tab[726]
#define __pyx_kp_u_This_census_does_not_support_man __pyx_string_tab[727]
#define __pyx_kp_u_To_permanently_fill_a_cusp_the_D __pyx_string_tab[728]
#define __pyx_kp_b_Triangulation __pyx_string_tab[729]
#define __pyx_kp_u_Triangulation __pyx_string_tab[730]
#define __pyx_n_u_Triangulation_2 __pyx_string_tab[731]
#define __pyx_n_u_Triangulation_DT_code __pyx_string_tab[732]
#define __pyx_kp_u_Triangulation_DT_code_line_1108 __pyx_string_tab[733]
#define __pyx_n_u_Triangulation___reduce __pyx_string_tab[734]
#define __pyx_kp_u_Triangulation___reduce___line_88 __pyx_string_tab[735]
#define __pyx_n_u_Triangulation__covers_gap __pyx_string_tab[736]
#define __pyx_n_u_Triangulation__covers_low_index __pyx_string_tab[737]
#define __pyx_n_u_Triangulation__covers_magma __pyx_string_tab[738]
#define __pyx_n_u_Triangulation__covers_snappea __pyx_string_tab[739]
#define __pyx_n_u_Triangulation__empty_save __pyx_string_tab[740]
#define __pyx_n_u_Triangulation__from_bytes __pyx_string_tab[741]
#define __pyx_kp_u_Triangulation__from_bytes_line_7 __pyx_string_tab[742]
#define __pyx_n_u_Triangulation__from_isosig __pyx_string_tab[743]
#define __pyx_kp_u_Triangulation__from_isosig_line __pyx_string_tab[744]
#define __pyx_n_u_Triangulation__from_pickle __pyx_string_tab[745]
#define __pyx_n_u_Triangulation__from_string __pyx_string_tab[746]
#define __pyx_kp_u_Triangulation__from_string_line __pyx_string_tab[747]
#define __pyx_n_u_Triangulation__from_tetrahedra_g __pyx_string_tab[748]
#define __pyx_kp_u_Triangulation__from_tetrahedra_g_2 __pyx_string_tab[749]
#define __pyx_n_u_Triangulation__get_cusp_indices __pyx_string_tab[750]
#define __pyx_n_u_Triangulation__get_from_link_dat __pyx_string_tab[751]
#define __pyx_n_u_Triangulation__get_tetrahedra_gl __pyx_string_tab[752]
#define __pyx_n_u_Triangulation__is_symplectic __pyx_string_tab[753]
#define __pyx_n_u_Triangulation__isomorphisms_to __pyx_string_tab[754]
#define __pyx_kp_u_Triangulation__isomorphisms_to_l __pyx_string_tab[755]
#define __pyx_n_u_Triangulation__marked_tetrahedra __pyx_string_tab[756]
#define __pyx_n_u_Triangulation__num_fake_cusps __pyx_string_tab[757]
#define __pyx_kp_u_Triangulation__num_fake_cusps_li __pyx_string_tab[758]
#define __pyx_n_u_Triangulation__polish_hyperbolic __pyx_string_tab[759]
#define __pyx_n_u_Triangulation__presentation_matr __pyx_string_tab[760]
#define __pyx_n_u_Triangulation__ptolemy_equations __pyx_string_tab[761]
#define __pyx_n_u_Triangulation__ptolemy_equations_2 __pyx_string_tab[762]
#define __pyx_n_u_Triangulation__ptolemy_equations_3 __pyx_string_tab[763]
#define __pyx_n_u_Triangulation__ptolemy_equations_4 __pyx_string_tab[764]
#define __pyx_n_u_Triangulation__ptolemy_equations_5 __pyx_string_tab[765]
#define __pyx_n_u_Triangulation__ptolemy_equations_6 __pyx_string_tab[766]
#define __pyx_n_u_Triangulation__reindex_cusps __pyx_string_tab[767]
#define __pyx_kp_u_Triangulation__reindex_cusps_lin __pyx_string_tab[768]
#define __pyx_n_u_Triangulation__remove_finite_ver __pyx_string_tab[769]
#define __pyx_kp_u_Triangulation__remove_finite_ver_2 __pyx_string_tab[770]
#define __pyx_n_u_Triangulation__set_DTcode __pyx_string_tab[771]
#define __pyx_n_u_Triangulation__set_PDcode __pyx_string_tab[772]
#define __pyx_n_u_Triangulation__symplectic_form __pyx_string_tab[773]
#define __pyx_n_u_Triangulation__three_to_two __pyx_string_tab[774]
#define __pyx_n_u_Triangulation__to_bytes __pyx_string_tab[775]
#define __pyx_kp_u_Triangulation__to_bytes_line_723 __pyx_string_tab[776]
#define __pyx_n_u_Triangulation__to_string __pyx_string_tab[777]
#define __pyx_kp_u_Triangulation__to_string_line_67 __pyx_string_tab[778]
#define __pyx_n_u_Triangulation__two_to_three __pyx_string_tab[779]
#define __pyx_n_u_Triangulation__undecorated_trian __pyx_string_tab[780]
#define __pyx_n_u_Triangulation__unsimplified_fill __pyx_string_tab[781]
#define __pyx_kp_u_Triangulation__unsimplified_fill_2 __pyx_string_tab[782]
#define __pyx_kp_u_Triangulation_and_text_files __pyx_string_tab[783]
#define __pyx_kp_u_Triangulation_contains_cusps_onl __pyx_string_tab[784]
#define __pyx_n_u_Triangulation_copy __pyx_string_tab[785]
#define __pyx_kp_u_Triangulation_copy_line_466 __pyx_string_tab[786]
#define __pyx_n_u_Triangulation_cover __pyx_string_tab[787]
#define __pyx_n_u_Triangulation_cover_info __pyx_string_tab[788]
#define __pyx_kp_u_Triangulation_cover_line_2395 __pyx_string_tab[789]
#define __pyx_n_u_Triangulation_covers __pyx_string_tab[790]
#define __pyx_kp_u_Triangulation_covers_line_2497 __pyx_string_tab[791]
#define __pyx_n_u_Triangulation_cusp_info __pyx_string_tab[792]
#define __pyx_kp_u_Triangulation_cusp_info_line_123 __pyx_string_tab[793]
#define __pyx_n_u_Triangulation_dehn_fill __pyx_string_tab[794]
#define __pyx_kp_u_Triangulation_dehn_fill_line_116 __pyx_string_tab[795]
#define __pyx_n_u_Triangulation_edge_valences __pyx_string_tab[796]
#define __pyx_kp_u_Triangulation_edge_valences_line __pyx_string_tab[797]
#define __pyx_n_u_Triangulation_filled_triangulati __pyx_string_tab[798]
#define __pyx_kp_u_Triangulation_filled_triangulati_2 __pyx_string_tab[799]
#define __pyx_n_u_Triangulation_from_Manifold __pyx_string_tab[800]
#define __pyx_n_u_Triangulation_fundamental_group __pyx_string_tab[801]
#define __pyx_kp_u_Triangulation_fundamental_group_2 __pyx_string_tab[802]
#define __pyx_n_u_Triangulation_gluing_equations __pyx_string_tab[803]
#define __pyx_kp_u_Triangulation_gluing_equations_l __pyx_string_tab[804]
#define __pyx_n_u_Triangulation_gluing_equations_p __pyx_string_tab[805]
#define __pyx_kp_u_Triangulation_gluing_equations_p_2 __pyx_string_tab[806]
#define __pyx_n_u_Triangulation_has_finite_vertice __pyx_string_tab[807]
#define __pyx_kp_u_Triangulation_has_finite_vertice_2 __pyx_string_tab[808]
#define __pyx_n_u_Triangulation_homology __pyx_string_tab[809]
#define __pyx_kp_u_Triangulation_homology_line_2311 __pyx_string_tab[810]
#define __pyx_n_u_Triangulation_is_orientable __pyx_string_tab[811]
#define __pyx_kp_u_Triangulation_is_orientable_line __pyx_string_tab[812]
#define __pyx_n_u_Triangulation_isomorphisms_to __pyx_string_tab[813]
#define __pyx_n_u_Triangulation_link __pyx_string_tab[814]
#define __pyx_n_u_Triangulation_name __pyx_string_tab[815]
#define __pyx_kp_u_Triangulation_name_line_1081 __pyx_string_tab[816]
#define __pyx_n_u_Triangulation_num_cusps __pyx_string_tab[817]
#define __pyx_kp_u_Triangulation_num_cusps_line_387 __pyx_string_tab[818]
#define __pyx_n_u_Triangulation_num_tetrahedra __pyx_string_tab[819]
#define __pyx_kp_u_Triangulation_num_tetrahedra_lin __pyx_string_tab[820]
#define __pyx_kp_u_Triangulation_or_Manifold __pyx_string_tab[821]
#define __pyx_n_u_Triangulation_orientation_cover __pyx_string_tab[822]
#define __pyx_kp_u_Triangulation_orientation_cover_2 __pyx_string_tab[823]
#define __pyx_n_u_Triangulation_pickle __pyx_string_tab[824]
#define __pyx_n_u_Triangulation_plink __pyx_string_tab[825]
#define __pyx_kp_u_Triangulation_plink_line_343 __pyx_string_tab[826]
#define __pyx_n_u_Triangulation_ptolemy_generalize __pyx_string_tab[827]
#define __pyx_kp_u_Triangulation_ptolemy_generalize_2 __pyx_string_tab[828]
#define __pyx_n_u_Triangulation_ptolemy_obstructio __pyx_string_tab[829]
#define __pyx_kp_u_Triangulation_ptolemy_obstructio_2 __pyx_string_tab[830]
#define __pyx_n_u_Triangulation_ptolemy_variety __pyx_string_tab[831]
#define __pyx_kp_u_Triangulation_ptolemy_variety_li __pyx_string_tab[832]
#define __pyx_n_u_Triangulation_randomize __pyx_string_tab[833]
#define __pyx_kp_u_Triangulation_randomize_line_483 __pyx_string_tab[834]
#define __pyx_n_u_Triangulation_reverse_orientatio __pyx_string_tab[835]
#define __pyx_kp_u_Triangulation_reverse_orientatio_2 __pyx_string_tab[836]
#define __pyx_n_u_Triangulation_save __pyx_string_tab[837]
#define __pyx_kp_u_Triangulation_save_line_653 __pyx_string_tab[838]
#define __pyx_n_u_Triangulation_set_name __pyx_string_tab[839]
#define __pyx_kp_u_Triangulation_set_name_line_1093 __pyx_string_tab[840]
#define __pyx_n_u_Triangulation_set_peripheral_cur __pyx_string_tab[841]
#define __pyx_n_u_Triangulation_simplify __pyx_string_tab[842]
#define __pyx_kp_u_Triangulation_simplify_line_497 __pyx_string_tab[843]
#define __pyx_n_u_Triangulation_symplectic_basis __pyx_string_tab[844]
#define __pyx_kp_u_Triangulation_symplectic_basis_l __pyx_string_tab[845]
#define __pyx_n_u_Triangulation_triangulation_isos __pyx_string_tab[846]
#define __pyx_kp_u_Triangulation_triangulation_isos_2 __pyx_string_tab[847]
#define __pyx_n_u_Triangulation_with_hyperbolic_st __pyx_string_tab[848]
#define __pyx_kp_u_Triangulation_with_hyperbolic_st_2 __pyx_string_tab[849]
#define __pyx_kp_u_Try_to_simplify_the_triangulati __pyx_string_tab[850]
#define __pyx_n_u_Type __pyx_string_tab[851]
#define __pyx_n_u_TypeError __pyx_string_tab[852]
#define __pyx_n_u_UI_callback __pyx_string_tab[853]
#define __pyx_kp_u_Used_by_pickle_dumps_from_pickl __pyx_string_tab[854]
#define __pyx_kp_u_Used_by_the_pickle_module_to_pi __pyx_string_tab[855]
#define __pyx_n_u_ValueError __pyx_string_tab[856]
#define __pyx_kp_u_Verified_and_arbitrary_precision __pyx_string_tab[857]
#define __pyx_n_u_ViewerWindow __pyx_string_tab[858]
#define __pyx_kp_u_WARNING_Users_should_not_use_th __pyx_string_tab[859]
#define __pyx_kp_u_WARNING_Users_should_not_use_th_2 __pyx_string_tab[860]
#define __pyx_kp_u_WARNING_Users_should_not_use_th_3 __pyx_string_tab[861]
#define __pyx_kp_u_Warning_Result_is_not_symplectic __pyx_string_tab[862]
#define __pyx_kp_u_Words_must_be_represented_as_Pyt __pyx_string_tab[863]
#define __pyx_kp_u_Wrong_equation_type __pyx_string_tab[864]
#define __pyx_n_u_X __pyx_string_tab[865]
#define __pyx_n_u_Xbackward_neighbor __pyx_string_tab[866]
#define __pyx_n_u_Xbackward_strand __pyx_string_tab[867]
#define __pyx_n_u_Xcomponent __pyx_string_tab[868]
#define __pyx_n_u_Xforward_neighbor __pyx_string_tab[869]
#define __pyx_n_u_Xforward_strand __pyx_string_tab[870]
#define __pyx_n_u_Y __pyx_string_tab[871]
#define __pyx_n_u_Ybackward_neighbor __pyx_string_tab[872]
#define __pyx_n_u_Ybackward_strand __pyx_string_tab[873]
#define __pyx_n_u_Ycomponent __pyx_string_tab[874]
#define __pyx_n_u_Yforward_neighbor __pyx_string_tab[875]
#define __pyx_n_u_Yforward_strand __pyx_string_tab[876]
#define __pyx_kp_u_You_have_specified_a_Hoste_Thist __pyx_string_tab[877]
#define __pyx_kp_u_You_must_apply_fillings_to_all_o __pyx_string_tab[878]
#define __pyx_kp_u_You_must_apply_shortest_to_all_o __pyx_string_tab[879]
#define __pyx_kp_u_You_provided_filling_data_for_to __pyx_string_tab[880]
#define __pyx_kp_u_You_provided_more_peripheral_dat __pyx_string_tab[881]
#define __pyx_kp_u_You_tried_to_create_an_empty_Sym __pyx_string_tab[882]
#define __pyx_n_u_Z __pyx_string_tab[883]
#define __pyx_kp_u_Z_d __pyx_string_tab[884]
#define __pyx_n_u__10 __pyx_string_tab[885]
#define __pyx_kp_b__10 __pyx_string_tab[886]
#define __pyx_kp_u__10 __pyx_string_tab[887]
#define __pyx_kp_u__11 __pyx_string_tab[888]
#define __pyx_kp_u__12 __pyx_string_tab[889]
#define __pyx_kp_u__13 __pyx_string_tab[890]
#define __pyx_kp_u__14 __pyx_string_tab[891]
#define __pyx_kp_u__15 __pyx_string_tab[892]
#define __pyx_kp_u__16 __pyx_string_tab[893]
#define __pyx_kp_u__17 __pyx_string_tab[894]
#define __pyx_kp_u__18 __pyx_string_tab[895]
#define __pyx_kp_u__19 __pyx_string_tab[896]
#define __pyx_kp_u__2 __pyx_string_tab[897]
#define __pyx_kp_u__20 __pyx_string_tab[898]
#define __pyx_n_u__21 __pyx_string_tab[899]
#define __pyx_kp_u__22 __pyx_string_tab[900]
#define __pyx_kp_u__23 __pyx_string_tab[901]
#define __pyx_kp_u__24 __pyx_string_tab[902]
#define __pyx_kp_u__25 __pyx_string_tab[903]
#define __pyx_kp_u__26 __pyx_string_tab[904]
#define __pyx_kp_u__27 __pyx_string_tab[905]
#define __pyx_kp_u__28 __pyx_string_tab[906]
#define __pyx_kp_u__3 __pyx_string_tab[907]
#define __pyx_kp_u__30 __pyx_string_tab[908]
#define __pyx_kp_u__32 __pyx_string_tab[909]
#define __pyx_kp_u__33 __pyx_string_tab[910]
#define __pyx_kp_u__34 __pyx_string_tab[911]
#define __pyx_kp_u__35 __pyx_string_tab[912]
#define __pyx_kp_u__36 __pyx_string_tab[913]
#define __pyx_kp_u__37 __pyx_string_tab[914]
#define __pyx_kp_b__39 __pyx_string_tab[915]
#define __pyx_kp_u__4 __pyx_string_tab[916]
#define __pyx_kp_u__40 __pyx_string_tab[917]
#define __pyx_kp_u__41 __pyx_string_tab[918]
#define __pyx_kp_u__5 __pyx_string_tab[919]
#define __pyx_kp_u__6 __pyx_string_tab[920]
#define __pyx_kp_u__7 __pyx_string_tab[921]
#define __pyx_kp_u__8 __pyx_string_tab[922]
#define __pyx_kp_u__9 __pyx_string_tab[923]
#define __pyx_kp_u_a __pyx_string_tab[924]
#define __pyx_n_u_a_2 __pyx_string_tab[925]
#define __pyx_n_u_a_il __pyx_string_tab[926]
#define __pyx_kp_u_a_zA_Z0_9 __pyx_string_tab[927]
#define __pyx_kp_u_abcABC__d_abcABC__d __pyx_string_tab[928]
#define __pyx_kp_u_abcdefghijklmnopqrstuvwxyzZYXWV __pyx_string_tab[929]
#define __pyx_n_u_abelian_description __pyx_string_tab[930]
#define __pyx_n_u_abelianization __pyx_string_tab[931]
#define __pyx_n_u_absImag __pyx_string_tab[932]
#define __pyx_n_u_abspath __pyx_string_tab[933]
#define __pyx_n_u_acc_log_im __pyx_string_tab[934]
#define __pyx_n_u_acc_log_re __pyx_string_tab[935]
#define __pyx_n_u_acc_rec_im __pyx_string_tab[936]
#define __pyx_n_u_acc_rec_re __pyx_string_tab[937]
#define __pyx_n_u_accuracies __pyx_string_tab[938]
#define __pyx_n_u_accuracy __pyx_string_tab[939]
#define __pyx_n_u_add __pyx_string_tab[940]
#define __pyx_kp_u_add_note __pyx_string_tab[941]
#define __pyx_n_u_add_rows __pyx_string_tab[942]
#define __pyx_n_u_algorithm __pyx_string_tab[943]
#define __pyx_n_u_all __pyx_string_tab[944]
#define __pyx_n_u_all_tables __pyx_string_tab[945]
#define __pyx_kp_u_all_tetrahedra_positively_orient __pyx_string_tab[946]
#define __pyx_n_u_alpha __pyx_string_tab[947]
#define __pyx_kp_u_alternating_gz __pyx_string_tab[948]
#define __pyx_n_u_alternation __pyx_string_tab[949]
#define __pyx_n_u_ans __pyx_string_tab[950]
#define __pyx_n_u_append __pyx_string_tab[951]
#define __pyx_n_u_are_isometric __pyx_string_tab[952]
#define __pyx_n_u_args __pyx_string_tab[953]
#define __pyx_n_u_as_ideal __pyx_string_tab[954]
#define __pyx_n_u_as_int_list __pyx_string_tab[955]
#define __pyx_n_u_as_string __pyx_string_tab[956]
#define __pyx_n_u_ascii __pyx_string_tab[957]
#define __pyx_n_u_ascii_lowercase __pyx_string_tab[958]
#define __pyx_n_u_asksaveasfile __pyx_string_tab[959]
#define __pyx_n_u_assignments __pyx_string_tab[960]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[961]
#define __pyx_kp_u_at_least __pyx_string_tab[962]
#define __pyx_n_u_atexit __pyx_string_tab[963]
#define __pyx_kp_u_b __pyx_string_tab[964]
#define __pyx_n_u_b_2 __pyx_string_tab[965]
#define __pyx_kp_u_b_RL __pyx_string_tab[966]
#define __pyx_kp_u_b_RL_2 __pyx_string_tab[967]
#define __pyx_kp_u_b_RRL __pyx_string_tab[968]
#define __pyx_kp_u_b_RRL_2 __pyx_string_tab[969]
#define __pyx_n_u_b_file_name __pyx_string_tab[970]
#define __pyx_n_u_b_new_name __pyx_string_tab[971]
#define __pyx_kp_u_b_no_lLrR __pyx_string_tab[972]
#define __pyx_n_u_b_string __pyx_string_tab[973]
#define __pyx_n_u_ball __pyx_string_tab[974]
#define __pyx_n_u_base __pyx_string_tab[975]
#define __pyx_n_u_bases __pyx_string_tab[976]
#define __pyx_n_u_basis __pyx_string_tab[977]
#define __pyx_n_u_betti_number __pyx_string_tab[978]
#define __pyx_kp_u_binary __pyx_string_tab[979]
#define __pyx_kp_u_binary_dihedral_group_2_2_d __pyx_string_tab[980]
#define __pyx_n_u_bit __pyx_string_tab[981]
#define __pyx_n_u_bits_prec __pyx_string_tab[982]
#define __pyx_n_u_blowup_multiple __pyx_string_tab[983]
#define __pyx_n_u_bool __pyx_string_tab[984]
#define __pyx_n_u_browse __pyx_string_tab[985]
#define __pyx_n_u_browser __pyx_string_tab[986]
#define __pyx_n_u_bundle __pyx_string_tab[987]
#define __pyx_n_u_bundle_from_string __pyx_string_tab[988]
#define __pyx_n_u_byte __pyx_string_tab[989]
#define __pyx_n_u_bytearray_to_bytes __pyx_string_tab[990]
#define __pyx_n_u_byteseq __pyx_string_tab[991]
#define __pyx_n_u_bytestring __pyx_string_tab[992]
#define __pyx_kp_u_c __pyx_string_tab[993]
#define __pyx_n_u_c0 __pyx_string_tab[994]
#define __pyx_n_u_c1 __pyx_string_tab[995]
#define __pyx_n_u_c2 __pyx_string_tab[996]
#define __pyx_n_u_c3 __pyx_string_tab[997]
#define __pyx_n_u_c_2 __pyx_string_tab[998]
#define __pyx_n_u_c_abelianization __pyx_string_tab[999]
#define __pyx_n_u_c_canonized_triangulation __pyx_string_tab[1000]
#define __pyx_n_u_c_center __pyx_string_tab[1001]
#define __pyx_n_u_c_comm_subgroup __pyx_string_tab[1002]
#define __pyx_n_u_c_core_length __pyx_string_tab[1003]
#define __pyx_n_u_c_cover_type __pyx_string_tab[1004]
#define __pyx_n_u_c_eqns __pyx_string_tab[1005]
#define __pyx_n_u_c_factor_0 __pyx_string_tab[1006]
#define __pyx_n_u_c_factor_1 __pyx_string_tab[1007]
#define __pyx_n_u_c_filled_tri __pyx_string_tab[1008]
#define __pyx_n_u_c_longitude __pyx_string_tab[1009]
#define __pyx_n_u_c_matrix __pyx_string_tab[1010]
#define __pyx_n_u_c_meridian __pyx_string_tab[1011]
#define __pyx_n_u_c_moves __pyx_string_tab[1012]
#define __pyx_n_u_c_new_name __pyx_string_tab[1013]
#define __pyx_n_u_c_new_tri __pyx_string_tab[1014]
#define __pyx_n_u_c_obstruction_class __pyx_string_tab[1015]
#define __pyx_n_u_c_opacities __pyx_string_tab[1016]
#define __pyx_n_u_c_representation __pyx_string_tab[1017]
#define __pyx_n_u_c_retriangulated_triangulation __pyx_string_tab[1018]
#define __pyx_n_u_c_string __pyx_string_tab[1019]
#define __pyx_n_u_c_symmetric_triangulation __pyx_string_tab[1020]
#define __pyx_n_u_c_target __pyx_string_tab[1021]
#define __pyx_n_u_c_terse __pyx_string_tab[1022]
#define __pyx_n_u_c_triangulation __pyx_string_tab[1023]
#define __pyx_n_u_c_vars __pyx_string_tab[1024]
#define __pyx_n_u_c_word __pyx_string_tab[1025]
#define __pyx_n_u_cache __pyx_string_tab[1026]
#define __pyx_n_u_callback __pyx_string_tab[1027]
#define __pyx_n_u_canonical __pyx_string_tab[1028]
#define __pyx_n_u_canonical_cells_are_tetrahedra __pyx_string_tab[1029]
#define __pyx_n_u_canonical_retriangulation __pyx_string_tab[1030]
#define __pyx_n_u_canonize __pyx_string_tab[1031]
#define __pyx_n_u_cb_menu __pyx_string_tab[1032]
#define __pyx_n_u_census_index __pyx_string_tab[1033]
#define __pyx_n_u_census_knot_archive __pyx_string_tab[1034]
#define __pyx_n_u_census_knot_numbers __pyx_string_tab[1035]
#define __pyx_n_u_center __pyx_string_tab[1036]
#define __pyx_n_u_centroid_at_origin __pyx_string_tab[1037]
#define __pyx_n_u_certified_shapes __pyx_string_tab[1038]
#define __pyx_n_u_character_variety __pyx_string_tab[1039]
#define __pyx_n_u_character_variety_ideal __pyx_string_tab[1040]
#define __pyx_n_u_character_variety_vars_and_polys __pyx_string_tab[1041]
#define __pyx_n_u_check_SnapPea_memory __pyx_string_tab[1042]
#define __pyx_n_u_check_index __pyx_string_tab[1043]
#define __pyx_n_u_chern_simons __pyx_string_tab[1044]
#define __pyx_n_u_choose_generators __pyx_string_tab[1045]
#define __pyx_n_u_choose_generators_info __pyx_string_tab[1046]
#define __pyx_n_u_circle __pyx_string_tab[1047]
#define __pyx_n_u_class __pyx_string_tab[1048]
#define __pyx_n_u_class_getitem __pyx_string_tab[1049]
#define __pyx_n_u_clear __pyx_string_tab[1050]
#define __pyx_n_u_clear_marks __pyx_string_tab[1051]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[1052]
#define __pyx_n_u_close __pyx_string_tab[1053]
#define __pyx_n_u_closed_census_directory __pyx_string_tab[1054]
#define __pyx_n_u_closed_nonorientable __pyx_string_tab[1055]
#define __pyx_n_u_closed_orientable __pyx_string_tab[1056]
#define __pyx_n_u_closest __pyx_string_tab[1057]
#define __pyx_n_u_cls __pyx_string_tab[1058]
#define __pyx_n_u_cobs __pyx_string_tab[1059]
#define __pyx_n_u_code __pyx_string_tab[1060]
#define __pyx_n_u_codec __pyx_string_tab[1061]
#define __pyx_n_u_coefficient_list __pyx_string_tab[1062]
#define __pyx_n_u_coeffs __pyx_string_tab[1063]
#define __pyx_n_u_col_support __pyx_string_tab[1064]
#define __pyx_n_u_cols __pyx_string_tab[1065]
#define __pyx_n_u_columns __pyx_string_tab[1066]
#define __pyx_n_u_combinatorial __pyx_string_tab[1067]
#define __pyx_n_u_comm_subgroup __pyx_string_tab[1068]
#define __pyx_n_u_commutator_subgroup __pyx_string_tab[1069]
#define __pyx_n_u_compile __pyx_string_tab[1070]
#define __pyx_kp_u_complete __pyx_string_tab[1071]
#define __pyx_n_u_complete_2 __pyx_string_tab[1072]
#define __pyx_kp_u_complete_3 __pyx_string_tab[1073]
#define __pyx_n_u_complete_length __pyx_string_tab[1074]
#define __pyx_kp_u_complete_length_2 __pyx_string_tab[1075]
#define __pyx_n_u_complete_shape_array __pyx_string_tab[1076]
#define __pyx_n_u_complete_shapes __pyx_string_tab[1077]
#define __pyx_n_u_complex __pyx_string_tab[1078]
#define __pyx_n_u_complex_length __pyx_string_tab[1079]
#define __pyx_n_u_complex_volume __pyx_string_tab[1080]
#define __pyx_n_u_complex_volume_2 __pyx_string_tab[1081]
#define __pyx_n_u_components __pyx_string_tab[1082]
#define __pyx_n_u_compute_corners __pyx_string_tab[1083]
#define __pyx_n_u_compute_cusp_shapes __pyx_string_tab[1084]
#define __pyx_n_u_compute_volume __pyx_string_tab[1085]
#define __pyx_n_u_contains __pyx_string_tab[1086]
#define __pyx_kp_u_contains_degenerate_tetrahedra __pyx_string_tab[1087]
#define __pyx_kp_u_contains_flat_tetrahedra __pyx_string_tab[1088]
#define __pyx_kp_u_contains_negatively_oriented_tet __pyx_string_tab[1089]
#define __pyx_n_u_content __pyx_string_tab[1090]
#define __pyx_n_u_copy __pyx_string_tab[1091]
#define __pyx_n_u_copy_c_triangulation __pyx_string_tab[1092]
#define __pyx_n_u_core_length __pyx_string_tab[1093]
#define __pyx_n_u_corners __pyx_string_tab[1094]
#define __pyx_n_u_coset_action __pyx_string_tab[1095]
#define __pyx_n_u_cover __pyx_string_tab[1096]
#define __pyx_n_u_cover_c_triangulation __pyx_string_tab[1097]
#define __pyx_n_u_cover_count __pyx_string_tab[1098]
#define __pyx_n_u_cover_info __pyx_string_tab[1099]
#define __pyx_n_u_cover_locals_genexpr __pyx_string_tab[1100]
#define __pyx_n_u_cover_type __pyx_string_tab[1101]
#define __pyx_n_u_cover_types __pyx_string_tab[1102]
#define __pyx_n_u_covers __pyx_string_tab[1103]
#define __pyx_n_u_covers_gap __pyx_string_tab[1104]
#define __pyx_n_u_covers_low_index __pyx_string_tab[1105]
#define __pyx_n_u_covers_low_index_locals_index __pyx_string_tab[1106]
#define __pyx_n_u_covers_magma __pyx_string_tab[1107]
#define __pyx_n_u_covers_snappea __pyx_string_tab[1108]
#define __pyx_n_u_crossings __pyx_string_tab[1109]
#define __pyx_n_u_cs __pyx_string_tab[1110]
#define __pyx_n_u_curdir __pyx_string_tab[1111]
#define __pyx_n_u_current_modulus __pyx_string_tab[1112]
#define __pyx_n_u_current_shape __pyx_string_tab[1113]
#define __pyx_n_u_current_shape_accuracy __pyx_string_tab[1114]
#define __pyx_n_u_curve_list __pyx_string_tab[1115]
#define __pyx_kp_u_curve_of_length __pyx_string_tab[1116]
#define __pyx_kp_u_cusp __pyx_string_tab[1117]
#define __pyx_n_u_cusp_cross_section_info __pyx_string_tab[1118]
#define __pyx_n_u_cusp_images __pyx_string_tab[1119]
#define __pyx_n_u_cusp_images_2 __pyx_string_tab[1120]
#define __pyx_n_u_cusp_index __pyx_string_tab[1121]
#define __pyx_n_u_cusp_indices __pyx_string_tab[1122]
#define __pyx_n_u_cusp_info __pyx_string_tab[1123]
#define __pyx_n_u_cusp_maps __pyx_string_tab[1124]
#define __pyx_n_u_cusp_maps_2 __pyx_string_tab[1125]
#define __pyx_n_u_cusp_neighborhood __pyx_string_tab[1126]
#define __pyx_n_u_cusp_type __pyx_string_tab[1127]
#define __pyx_n_u_cusps __pyx_string_tab[1128]
#define __pyx_n_u_cusps_compute_cusp_shapes __pyx_string_tab[1129]
#define __pyx_n_u_cusps_to_fill __pyx_string_tab[1130]
#define __pyx_n_u_cutoff __pyx_string_tab[1131]
#define __pyx_n_u_cutoff_length __pyx_string_tab[1132]
#define __pyx_n_u_cutoff_radius __pyx_string_tab[1133]
#define __pyx_n_u_cutout __pyx_string_tab[1134]
#define __pyx_n_u_cy_eval __pyx_string_tab[1135]
#define __pyx_n_u_cyclic __pyx_string_tab[1136]
#define __pyx_kp_u_cython_core_abelian_group_pyx __pyx_string_tab[1137]
#define __pyx_kp_u_cython_core_basic_pyx __pyx_string_tab[1138]
#define __pyx_kp_u_cython_core_cusp_neighborhoods_p __pyx_string_tab[1139]
#define __pyx_kp_u_cython_core_dirichlet_pyx __pyx_string_tab[1140]
#define __pyx_kp_u_cython_core_fundamental_group_py __pyx_string_tab[1141]
#define __pyx_kp_u_cython_core_manifold_pyx __pyx_string_tab[1142]
#define __pyx_kp_u_cython_core_symmetry_group_pyx __pyx_string_tab[1143]
#define __pyx_kp_u_cython_core_tail_pyx __pyx_string_tab[1144]
#define __pyx_kp_u_cython_core_triangulation_pyx __pyx_string_tab[1145]
#define __pyx_kp_u_d __pyx_string_tab[1146]
#define __pyx_kp_u_dB __pyx_string_tab[1147]
#define __pyx_n_u_dLQbcccdxwb __pyx_string_tab[1148]
#define __pyx_n_u_d_2 __pyx_string_tab[1149]
#define __pyx_kp_u_d_3 __pyx_string_tab[1150]
#define __pyx_kp_u_d_4 __pyx_string_tab[1151]
#define __pyx_n_u_data __pyx_string_tab[1152]
#define __pyx_kp_u_data_1_1_2_2_0_1_3_2_2_3_1_0_0 __pyx_string_tab[1153]
#define __pyx_n_u_data_ijk __pyx_string_tab[1154]
#define __pyx_n_u_data_spec __pyx_string_tab[1155]
#define __pyx_n_u_database __pyx_string_tab[1156]
#define __pyx_n_u_datafile __pyx_string_tab[1157]
#define __pyx_n_u_dec_prec __pyx_string_tab[1158]
#define __pyx_n_u_decode __pyx_string_tab[1159]
#define __pyx_n_u_decorated __pyx_string_tab[1160]
#define __pyx_n_u_decorated_isosig __pyx_string_tab[1161]
#define __pyx_n_u_decoration __pyx_string_tab[1162]
#define __pyx_n_u_default_precision __pyx_string_tab[1163]
#define __pyx_n_u_defaultextension __pyx_string_tab[1164]
#define __pyx_kp_u_defined_in __pyx_string_tab[1165]
#define __pyx_n_u_degree __pyx_string_tab[1166]
#define __pyx_n_u_dehn_fill __pyx_string_tab[1167]
#define __pyx_n_u_delattr __pyx_string_tab[1168]
#define __pyx_n_u_delitem __pyx_string_tab[1169]
#define __pyx_n_u_desc __pyx_string_tab[1170]
#define __pyx_n_u_det __pyx_string_tab[1171]
#define __pyx_n_u_details __pyx_string_tab[1172]
#define __pyx_n_u_dict __pyx_string_tab[1173]
#define __pyx_n_u_dict_2 __pyx_string_tab[1174]
#define __pyx_n_u_dict_3 __pyx_string_tab[1175]
#define __pyx_n_u_direct_product_description __pyx_string_tab[1176]
#define __pyx_n_u_dirichlet_domain __pyx_string_tab[1177]
#define __pyx_kp_u_disable __pyx_string_tab[1178]
#define __pyx_n_u_disp __pyx_string_tab[1179]
#define __pyx_n_u_displacement __pyx_string_tab[1180]
#define __pyx_n_u_distance __pyx_string_tab[1181]
#define __pyx_n_u_doc __pyx_string_tab[1182]
#define __pyx_n_u_domain __pyx_string_tab[1183]
#define __pyx_n_u_drill __pyx_string_tab[1184]
#define __pyx_n_u_dual_curves __pyx_string_tab[1185]
#define __pyx_n_u_dual_rows __pyx_string_tab[1186]
#define __pyx_n_u_e __pyx_string_tab[1187]
#define __pyx_n_u_edge __pyx_string_tab[1188]
#define __pyx_n_u_edge_class __pyx_string_tab[1189]
#define __pyx_n_u_edge_image_indices __pyx_string_tab[1190]
#define __pyx_n_u_edge_index __pyx_string_tab[1191]
#define __pyx_n_u_edge_indices __pyx_string_tab[1192]
#define __pyx_n_u_edge_list __pyx_string_tab[1193]
#define __pyx_n_u_edge_orientations __pyx_string_tab[1194]
#define __pyx_n_u_edge_to_index __pyx_string_tab[1195]
#define __pyx_n_u_edge_to_index_dict __pyx_string_tab[1196]
#define __pyx_n_u_edge_valences __pyx_string_tab[1197]
#define __pyx_kp_u_edges __pyx_string_tab[1198]
#define __pyx_n_u_edges_2 __pyx_string_tab[1199]
#define __pyx_n_u_eight_length __pyx_string_tab[1200]
#define __pyx_n_u_elementary_divisors __pyx_string_tab[1201]
#define __pyx_n_u_eliminate_fixed_ptolemys __pyx_string_tab[1202]
#define __pyx_n_u_elt __pyx_string_tab[1203]
#define __pyx_n_u_empty __pyx_string_tab[1204]
#define __pyx_n_u_empty_save __pyx_string_tab[1205]
#define __pyx_kp_u_enable __pyx_string_tab[1206]
#define __pyx_n_u_encode __pyx_string_tab[1207]
#define __pyx_kp_u_end __pyx_string_tab[1208]
#define __pyx_n_u_end_2 __pyx_string_tab[1209]
#define __pyx_n_u_endpoints __pyx_string_tab[1210]
#define __pyx_n_u_engine __pyx_string_tab[1211]
#define __pyx_n_u_enter __pyx_string_tab[1212]
#define __pyx_n_u_entries __pyx_string_tab[1213]
#define __pyx_n_u_enum __pyx_string_tab[1214]
#define __pyx_n_u_enumerate __pyx_string_tab[1215]
#define __pyx_n_u_environ __pyx_string_tab[1216]
#define __pyx_n_u_eqn __pyx_string_tab[1217]
#define __pyx_n_u_eqns __pyx_string_tab[1218]
#define __pyx_n_u_equation_type __pyx_string_tab[1219]
#define __pyx_n_u_equations __pyx_string_tab[1220]
#define __pyx_n_u_euler __pyx_string_tab[1221]
#define __pyx_n_u_eval __pyx_string_tab[1222]
#define __pyx_n_u_exceptions __pyx_string_tab[1223]
#define __pyx_n_u_exit __pyx_string_tab[1224]
#define __pyx_n_u_exit_2 __pyx_string_tab[1225]
#define __pyx_n_u_expand_until_certified __pyx_string_tab[1226]
#define __pyx_n_u_explain_cols __pyx_string_tab[1227]
#define __pyx_n_u_explain_columns __pyx_string_tab[1228]
#define __pyx_kp_u_explain_columns_2 __pyx_string_tab[1229]
#define __pyx_n_u_explain_rows __pyx_string_tab[1230]
#define __pyx_kp_u_explain_rows_2 __pyx_string_tab[1231]
#define __pyx_n_u_explode __pyx_string_tab[1232]
#define __pyx_n_u_export_stl __pyx_string_tab[1233]
#define __pyx_n_u_extends_to_link __pyx_string_tab[1234]
#define __pyx_n_u_extends_to_link_2 __pyx_string_tab[1235]
#define __pyx_n_u_extract_HT_knot __pyx_string_tab[1236]
#define __pyx_n_u_extractfile __pyx_string_tab[1237]
#define __pyx_n_u_f __pyx_string_tab[1238]
#define __pyx_n_u_face __pyx_string_tab[1239]
#define __pyx_n_u_face0_gen __pyx_string_tab[1240]
#define __pyx_n_u_face1_gen __pyx_string_tab[1241]
#define __pyx_n_u_face2_gen __pyx_string_tab[1242]
#define __pyx_n_u_face3_gen __pyx_string_tab[1243]
#define __pyx_n_u_face_index __pyx_string_tab[1244]
#define __pyx_n_u_face_list __pyx_string_tab[1245]
#define __pyx_n_u_face_list_locals_genexpr __pyx_string_tab[1246]
#define __pyx_n_u_facedicts __pyx_string_tab[1247]
#define __pyx_kp_u_faces __pyx_string_tab[1248]
#define __pyx_n_u_faces_2 __pyx_string_tab[1249]
#define __pyx_n_u_factor_0 __pyx_string_tab[1250]
#define __pyx_n_u_factor_1 __pyx_string_tab[1251]
#define __pyx_n_u_file __pyx_string_tab[1252]
#define __pyx_n_u_file_name __pyx_string_tab[1253]
#define __pyx_n_u_filedata __pyx_string_tab[1254]
#define __pyx_n_u_filedialog __pyx_string_tab[1255]
#define __pyx_n_u_filename __pyx_string_tab[1256]
#define __pyx_n_u_files __pyx_string_tab[1257]
#define __pyx_n_u_filetypes __pyx_string_tab[1258]
#define __pyx_n_u_fill __pyx_string_tab[1259]
#define __pyx_n_u_fill_all __pyx_string_tab[1260]
#define __pyx_n_u_fill_by_fold __pyx_string_tab[1261]
#define __pyx_n_u_fill_cusp_spec __pyx_string_tab[1262]
#define __pyx_n_u_filled __pyx_string_tab[1263]
#define __pyx_n_u_filled_2 __pyx_string_tab[1264]
#define __pyx_n_u_filled_length __pyx_string_tab[1265]
#define __pyx_kp_u_filled_length_2 __pyx_string_tab[1266]
#define __pyx_n_u_filled_shape_array __pyx_string_tab[1267]
#define __pyx_n_u_filled_shapes __pyx_string_tab[1268]
#define __pyx_n_u_filled_tri __pyx_string_tab[1269]
#define __pyx_n_u_filled_triangulation __pyx_string_tab[1270]
#define __pyx_n_u_filling __pyx_string_tab[1271]
#define __pyx_n_u_filling_2 __pyx_string_tab[1272]
#define __pyx_n_u_filling_data __pyx_string_tab[1273]
#define __pyx_n_u_fillings __pyx_string_tab[1274]
#define __pyx_n_u_fillings_may_affect_generators __pyx_string_tab[1275]
#define __pyx_n_u_find __pyx_string_tab[1276]
#define __pyx_n_u_findall __pyx_string_tab[1277]
#define __pyx_kp_u_finite_vertices __pyx_string_tab[1278]
#define __pyx_n_u_first_nybble __pyx_string_tab[1279]
#define __pyx_n_u_five_length __pyx_string_tab[1280]
#define __pyx_n_u_five_tet_nonorientable __pyx_string_tab[1281]
#define __pyx_n_u_five_tet_orientable __pyx_string_tab[1282]
#define __pyx_n_u_fixed_alignment __pyx_string_tab[1283]
#define __pyx_n_u_flips __pyx_string_tab[1284]
#define __pyx_n_u_flush __pyx_string_tab[1285]
#define __pyx_n_u_fold __pyx_string_tab[1286]
#define __pyx_n_u_force_recompute __pyx_string_tab[1287]
#define __pyx_n_u_form __pyx_string_tab[1288]
#define __pyx_n_u_format __pyx_string_tab[1289]
#define __pyx_n_u_format_explain_list __pyx_string_tab[1290]
#define __pyx_n_u_format_str __pyx_string_tab[1291]
#define __pyx_n_u_format_two_by_two __pyx_string_tab[1292]
#define __pyx_n_u_from_bytes __pyx_string_tab[1293]
#define __pyx_n_b_from_data __pyx_string_tab[1294]
#define __pyx_n_u_from_isosig __pyx_string_tab[1295]
#define __pyx_n_u_from_pickle __pyx_string_tab[1296]
#define __pyx_n_u_from_string __pyx_string_tab[1297]
#define __pyx_n_u_from_tetrahedra_gluing_data __pyx_string_tab[1298]
#define __pyx_n_u_full_list __pyx_string_tab[1299]
#define __pyx_n_u_full_rigor __pyx_string_tab[1300]
#define __pyx_n_u_func __pyx_string_tab[1301]
#define __pyx_n_u_func_2 __pyx_string_tab[1302]
#define __pyx_n_u_func_OK __pyx_string_tab[1303]
#define __pyx_n_u_func_bad_input __pyx_string_tab[1304]
#define __pyx_n_u_func_cancelled __pyx_string_tab[1305]
#define __pyx_n_u_func_failed __pyx_string_tab[1306]
#define __pyx_n_u_fundamental_group __pyx_string_tab[1307]
#define __pyx_n_u_g __pyx_string_tab[1308]
#define __pyx_n_u_g_eqns __pyx_string_tab[1309]
#define __pyx_kp_u_g_g __pyx_string_tab[1310]
#define __pyx_n_u_gap __pyx_string_tab[1311]
#define __pyx_n_u_gap_image_gens __pyx_string_tab[1312]
#define __pyx_n_u_gap_init __pyx_string_tab[1313]
#define __pyx_n_u_gap_string __pyx_string_tab[1314]
#define __pyx_kp_u_gc __pyx_string_tab[1315]
#define __pyx_n_u_gen __pyx_string_tab[1316]
#define __pyx_n_u_gen_names __pyx_string_tab[1317]
#define __pyx_n_u_generator_bytes __pyx_string_tab[1318]
#define __pyx_n_u_generator_file __pyx_string_tab[1319]
#define __pyx_n_u_generator_path __pyx_string_tab[1320]
#define __pyx_n_u_generators __pyx_string_tab[1321]
#define __pyx_n_u_generators_in_originals __pyx_string_tab[1322]
#define __pyx_n_u_genexpr __pyx_string_tab[1323]
#define __pyx_n_u_gens __pyx_string_tab[1324]
#define __pyx_n_u_geodesics __pyx_string_tab[1325]
#define __pyx_n_u_get __pyx_string_tab[1326]
#define __pyx_n_u_get_HT_knot_DT __pyx_string_tab[1327]
#define __pyx_n_u_get_HT_knot_by_index __pyx_string_tab[1328]
#define __pyx_n_u_get_cusp_indices_and_peripheral __pyx_string_tab[1329]
#define __pyx_n_u_get_data __pyx_string_tab[1330]
#define __pyx_n_u_get_displacement __pyx_string_tab[1331]
#define __pyx_n_u_get_from_link_data __pyx_string_tab[1332]
#define __pyx_n_u_get_generalized_ptolemy_obstruct __pyx_string_tab[1333]
#define __pyx_n_u_get_ptolemy_obstruction_classes __pyx_string_tab[1334]
#define __pyx_n_u_get_ptolemy_variety __pyx_string_tab[1335]
#define __pyx_n_u_get_tetrahedra_gluing_data __pyx_string_tab[1336]
#define __pyx_n_u_get_tetrahedra_shapes __pyx_string_tab[1337]
#define __pyx_n_u_get_tie __pyx_string_tab[1338]
#define __pyx_n_u_get_triangulation_tester __pyx_string_tab[1339]
#define __pyx_kp_u_get_triangulation_tester_doctes __pyx_string_tab[1340]
#define __pyx_kp_u_get_triangulation_tester_line_11 __pyx_string_tab[1341]
#define __pyx_n_u_getitem __pyx_string_tab[1342]
#define __pyx_n_u_getstate __pyx_string_tab[1343]
#define __pyx_n_u_gluing __pyx_string_tab[1344]
#define __pyx_n_u_gluing_equations __pyx_string_tab[1345]
#define __pyx_n_u_gluing_equations_pgl __pyx_string_tab[1346]
#define __pyx_n_u_gluings __pyx_string_tab[1347]
#define __pyx_n_u_group __pyx_string_tab[1348]
#define __pyx_n_u_grouped __pyx_string_tab[1349]
#define __pyx_n_u_groups __pyx_string_tab[1350]
#define __pyx_n_u_gui __pyx_string_tab[1351]
#define __pyx_n_u_gzip __pyx_string_tab[1352]
#define __pyx_n_u_handles __pyx_string_tab[1353]
#define __pyx_n_u_has_finite_vertices __pyx_string_tab[1354]
#define __pyx_n_u_header __pyx_string_tab[1355]
#define __pyx_n_u_high_precision __pyx_string_tab[1356]
#define __pyx_n_u_holonomies __pyx_string_tab[1357]
#define __pyx_n_u_holonomy_accuracy __pyx_string_tab[1358]
#define __pyx_kp_u_holonomy_precision __pyx_string_tab[1359]
#define __pyx_n_u_homology __pyx_string_tab[1360]
#define __pyx_n_u_horoball_list __pyx_string_tab[1361]
#define __pyx_n_u_horoballs __pyx_string_tab[1362]
#define __pyx_n_u_horoviewer __pyx_string_tab[1363]
#define __pyx_n_u_hue __pyx_string_tab[1364]
#define __pyx_kp_u_hyperbolic_data__sa_gz __pyx_string_tab[1365]
#define __pyx_kp_u_hyperbolic_data__sn_gz __pyx_string_tab[1366]
#define __pyx_n_u_i __pyx_string_tab[1367]
#define __pyx_kp_u_icosohedral_group __pyx_string_tab[1368]
#define __pyx_n_u_ideal __pyx_string_tab[1369]
#define __pyx_kp_u_ideal_vertices __pyx_string_tab[1370]
#define __pyx_n_u_identify __pyx_string_tab[1371]
#define __pyx_n_u_identify_2 __pyx_string_tab[1372]
#define __pyx_n_u_ignore_curve_orientations __pyx_string_tab[1373]
#define __pyx_n_u_ignore_curves __pyx_string_tab[1374]
#define __pyx_n_u_ignore_cusp_ordering __pyx_string_tab[1375]
#define __pyx_n_u_ignore_filling_orientations __pyx_string_tab[1376]
#define __pyx_n_u_ignore_orientation __pyx_string_tab[1377]
#define __pyx_n_u_ignore_solution_type __pyx_string_tab[1378]
#define __pyx_n_u_imag __pyx_string_tab[1379]
#define __pyx_n_u_images __pyx_string_tab[1380]
#define __pyx_n_u_immutable __pyx_string_tab[1381]
#define __pyx_kp_u_import_itertools_M_Manifold_L14 __pyx_string_tab[1382]
#define __pyx_n_u_in_radius __pyx_string_tab[1383]
#define __pyx_n_u_include_words __pyx_string_tab[1384]
#define __pyx_n_u_index __pyx_string_tab[1385]
#define __pyx_n_u_index_within_crossings __pyx_string_tab[1386]
#define __pyx_n_u_indices __pyx_string_tab[1387]
#define __pyx_n_u_infinite __pyx_string_tab[1388]
#define __pyx_n_u_info __pyx_string_tab[1389]
#define __pyx_n_u_init __pyx_string_tab[1390]
#define __pyx_n_u_init_hyperbolic_structure __pyx_string_tab[1391]
#define __pyx_n_u_initial_modulus __pyx_string_tab[1392]
#define __pyx_n_u_initial_shape __pyx_string_tab[1393]
#define __pyx_n_u_initial_shape_accuracy __pyx_string_tab[1394]
#define __pyx_n_u_initialize_structure __pyx_string_tab[1395]
#define __pyx_n_u_initializing __pyx_string_tab[1396]
#define __pyx_n_u_input_type __pyx_string_tab[1397]
#define __pyx_n_u_int __pyx_string_tab[1398]
#define __pyx_n_u_int_list __pyx_string_tab[1399]
#define __pyx_n_u_internal __pyx_string_tab[1400]
#define __pyx_n_u_interrupted __pyx_string_tab[1401]
#define __pyx_n_u_intervals __pyx_string_tab[1402]
#define __pyx_n_u_inverse_list_word __pyx_string_tab[1403]
#define __pyx_n_u_irregular __pyx_string_tab[1404]
#define __pyx_n_u_is_GapElement __pyx_string_tab[1405]
#define __pyx_n_u_is_HT_knot __pyx_string_tab[1406]
#define __pyx_n_u_is_MagmaElement __pyx_string_tab[1407]
#define __pyx_n_u_is_S5 __pyx_string_tab[1408]
#define __pyx_n_u_is_abelian __pyx_string_tab[1409]
#define __pyx_n_u_is_alpha_DT_exterior __pyx_string_tab[1410]
#define __pyx_n_u_is_amphicheiral __pyx_string_tab[1411]
#define __pyx_n_u_is_binary_group __pyx_string_tab[1412]
#define __pyx_n_u_is_braid_complement __pyx_string_tab[1413]
#define __pyx_n_u_is_complete __pyx_string_tab[1414]
#define __pyx_n_u_is_coroutine __pyx_string_tab[1415]
#define __pyx_n_u_is_decorated_isosig __pyx_string_tab[1416]
#define __pyx_n_u_is_dihedral __pyx_string_tab[1417]
#define __pyx_n_u_is_direct_product __pyx_string_tab[1418]
#define __pyx_n_u_is_full_group __pyx_string_tab[1419]
#define __pyx_n_u_is_geometric __pyx_string_tab[1420]
#define __pyx_n_u_is_int_DT_exterior __pyx_string_tab[1421]
#define __pyx_n_u_is_invertible_knot __pyx_string_tab[1422]
#define __pyx_n_u_is_isometric_to __pyx_string_tab[1423]
#define __pyx_n_u_is_isometric_to_2 __pyx_string_tab[1424]
#define __pyx_n_u_is_isosig __pyx_string_tab[1425]
#define __pyx_n_u_is_link_complement1 __pyx_string_tab[1426]
#define __pyx_n_u_is_link_complement1_pat __pyx_string_tab[1427]
#define __pyx_n_u_is_link_complement2 __pyx_string_tab[1428]
#define __pyx_n_u_is_link_complement2_pat __pyx_string_tab[1429]
#define __pyx_n_u_is_link_complement3 __pyx_string_tab[1430]
#define __pyx_n_u_is_link_complement3_pat __pyx_string_tab[1431]
#define __pyx_kp_u_is_not_acceptable __pyx_string_tab[1432]
#define __pyx_n_u_is_orientable __pyx_string_tab[1433]
#define __pyx_n_u_is_polyhedral __pyx_string_tab[1434]
#define __pyx_n_u_is_symplectic __pyx_string_tab[1435]
#define __pyx_n_u_is_torus_bundle __pyx_string_tab[1436]
#define __pyx_n_u_is_twister_bundle __pyx_string_tab[1437]
#define __pyx_n_u_is_twister_splitting __pyx_string_tab[1438]
#define __pyx_n_u_is_two_bridge __pyx_string_tab[1439]
#define __pyx_kp_u_isenabled __pyx_string_tab[1440]
#define __pyx_n_u_isfile __pyx_string_tab[1441]
#define __pyx_n_u_islower __pyx_string_tab[1442]
#define __pyx_n_u_isometries __pyx_string_tab[1443]
#define __pyx_n_u_isomorphisms_to __pyx_string_tab[1444]
#define __pyx_n_u_isomorphisms_to_2 __pyx_string_tab[1445]
#define __pyx_n_u_isosig __pyx_string_tab[1446]
#define __pyx_n_u_isosig_pattern __pyx_string_tab[1447]
#define __pyx_n_u_item __pyx_string_tab[1448]
#define __pyx_n_u_items __pyx_string_tab[1449]
#define __pyx_n_u_iter __pyx_string_tab[1450]
#define __pyx_n_u_its_matrix __pyx_string_tab[1451]
#define __pyx_n_u_j __pyx_string_tab[1452]
#define __pyx_n_u_join __pyx_string_tab[1453]
#define __pyx_n_u_k __pyx_string_tab[1454]
#define __pyx_n_u_key __pyx_string_tab[1455]
#define __pyx_n_u_keys __pyx_string_tab[1456]
#define __pyx_n_u_kl __pyx_string_tab[1457]
#define __pyx_n_u_klein __pyx_string_tab[1458]
#define __pyx_n_u_klp __pyx_string_tab[1459]
#define __pyx_n_u_kwargs __pyx_string_tab[1460]
#define __pyx_n_u_l __pyx_string_tab[1461]
#define __pyx_n_u_l0 __pyx_string_tab[1462]
#define __pyx_n_u_l1 __pyx_string_tab[1463]
#define __pyx_n_u_l2 __pyx_string_tab[1464]
#define __pyx_kp_u_lL_P_components_0_9_1_P_crossin __pyx_string_tab[1465]
#define __pyx_n_u_layered __pyx_string_tab[1466]
#define __pyx_n_u_layered_and_marked __pyx_string_tab[1467]
#define __pyx_n_u_lazy __pyx_string_tab[1468]
#define __pyx_n_u_left __pyx_string_tab[1469]
#define __pyx_n_u_left_pad_string __pyx_string_tab[1470]
#define __pyx_n_u_len __pyx_string_tab[1471]
#define __pyx_n_u_lenStr __pyx_string_tab[1472]
#define __pyx_n_u_len_2 __pyx_string_tab[1473]
#define __pyx_n_u_length __pyx_string_tab[1474]
#define __pyx_kp_u_length_2 __pyx_string_tab[1475]
#define __pyx_n_u_length_spectrum __pyx_string_tab[1476]
#define __pyx_n_u_length_spectrum_dicts __pyx_string_tab[1477]
#define __pyx_n_u_letter __pyx_string_tab[1478]
#define __pyx_n_u_letter_seperator __pyx_string_tab[1479]
#define __pyx_n_u_line __pyx_string_tab[1480]
#define __pyx_n_u_line0 __pyx_string_tab[1481]
#define __pyx_n_u_line1 __pyx_string_tab[1482]
#define __pyx_n_u_line2 __pyx_string_tab[1483]
#define __pyx_n_u_line3 __pyx_string_tab[1484]
#define __pyx_n_u_link __pyx_string_tab[1485]
#define __pyx_n_u_link_archive __pyx_string_tab[1486]
#define __pyx_n_u_link_directory __pyx_string_tab[1487]
#define __pyx_n_u_list_as_word __pyx_string_tab[1488]
#define __pyx_n_u_list_as_word_locals_genexpr __pyx_string_tab[1489]
#define __pyx_kp_u_list_snappy_Manifold __pyx_string_tab[1490]
#define __pyx_kp_u_list_snappy_Triangulation __pyx_string_tab[1491]
#define __pyx_n_u_ljust __pyx_string_tab[1492]
#define __pyx_n_u_log __pyx_string_tab[1493]
#define __pyx_n_u_log_im __pyx_string_tab[1494]
#define __pyx_n_u_log_re __pyx_string_tab[1495]
#define __pyx_n_u_log_shape __pyx_string_tab[1496]
#define __pyx_n_u_long_relators __pyx_string_tab[1497]
#define __pyx_n_u_longitude __pyx_string_tab[1498]
#define __pyx_n_u_longitude_2 __pyx_string_tab[1499]
#define __pyx_n_u_longitude_accuracy __pyx_string_tab[1500]
#define __pyx_n_u_lookup __pyx_string_tab[1501]
#define __pyx_n_u_low_index __pyx_string_tab[1502]
#define __pyx_n_u_lower __pyx_string_tab[1503]
#define __pyx_n_u_m __pyx_string_tab[1504]
#define __pyx_n_u_m003 __pyx_string_tab[1505]
#define __pyx_n_u_m004 __pyx_string_tab[1506]
#define __pyx_n_u_magma __pyx_string_tab[1507]
#define __pyx_n_u_magma_init __pyx_string_tab[1508]
#define __pyx_n_u_magma_string __pyx_string_tab[1509]
#define __pyx_n_u_main __pyx_string_tab[1510]
#define __pyx_n_u_major __pyx_string_tab[1511]
#define __pyx_n_u_manifold __pyx_string_tab[1512]
#define __pyx_n_u_manifoldMethods __pyx_string_tab[1513]
#define __pyx_n_u_manifold_class __pyx_string_tab[1514]
#define __pyx_n_u_manifold_class_2 __pyx_string_tab[1515]
#define __pyx_n_u_manifold_name __pyx_string_tab[1516]
#define __pyx_n_u_manifold_path __pyx_string_tab[1517]
#define __pyx_n_u_manifold_paths __pyx_string_tab[1518]
#define __pyx_n_u_manifolds __pyx_string_tab[1519]
#define __pyx_n_u_map __pyx_string_tab[1520]
#define __pyx_n_u_maps __pyx_string_tab[1521]
#define __pyx_n_u_mark_solid_tori __pyx_string_tab[1522]
#define __pyx_n_u_marked __pyx_string_tab[1523]
#define __pyx_n_u_marked_tetrahedra __pyx_string_tab[1524]
#define __pyx_n_u_mask __pyx_string_tab[1525]
#define __pyx_n_u_mat __pyx_string_tab[1526]
#define __pyx_n_u_match __pyx_string_tab[1527]
#define __pyx_n_u_math __pyx_string_tab[1528]
#define __pyx_n_u_matrices __pyx_string_tab[1529]
#define __pyx_n_u_matrix __pyx_string_tab[1530]
#define __pyx_n_u_matrix_2 __pyx_string_tab[1531]
#define __pyx_n_u_matsnf __pyx_string_tab[1532]
#define __pyx_n_u_max __pyx_string_tab[1533]
#define __pyx_n_u_max_crossings __pyx_string_tab[1534]
#define __pyx_n_u_max_reach __pyx_string_tab[1535]
#define __pyx_n_u_max_segments __pyx_string_tab[1536]
#define __pyx_n_u_maximize_injectivity_radius __pyx_string_tab[1537]
#define __pyx_n_u_meridian __pyx_string_tab[1538]
#define __pyx_n_u_meridian_2 __pyx_string_tab[1539]
#define __pyx_n_u_meridian_accuracy __pyx_string_tab[1540]
#define __pyx_n_u_message __pyx_string_tab[1541]
#define __pyx_n_u_metaclass __pyx_string_tab[1542]
#define __pyx_n_u_method __pyx_string_tab[1543]
#define __pyx_n_u_minimize_number_of_generators __pyx_string_tab[1544]
#define __pyx_kp_u_mirrored_arc __pyx_string_tab[1545]
#define __pyx_n_u_mode __pyx_string_tab[1546]
#define __pyx_n_u_model __pyx_string_tab[1547]
#define __pyx_n_u_module __pyx_string_tab[1548]
#define __pyx_n_u_modulus __pyx_string_tab[1549]
#define __pyx_n_u_monodromy __pyx_string_tab[1550]
#define __pyx_kp_u_morwen8 __pyx_string_tab[1551]
#define __pyx_kp_u_morwen8_tgz __pyx_string_tab[1552]
#define __pyx_n_u_morwen_link_directory __pyx_string_tab[1553]
#define __pyx_n_u_moves __pyx_string_tab[1554]
#define __pyx_n_u_mro_entries __pyx_string_tab[1555]
#define __pyx_n_u_msg_stream __pyx_string_tab[1556]
#define __pyx_n_u_mult __pyx_string_tab[1557]
#define __pyx_n_u_multiplicities __pyx_string_tab[1558]
#define __pyx_n_u_multiplicity __pyx_string_tab[1559]
#define __pyx_n_u_multiply_elements __pyx_string_tab[1560]
#define __pyx_n_u_myslice __pyx_string_tab[1561]
#define __pyx_n_u_n __pyx_string_tab[1562]
#define __pyx_n_u_name __pyx_string_tab[1563]
#define __pyx_n_u_name_2 __pyx_string_tab[1564]
#define __pyx_n_u_ncols __pyx_string_tab[1565]
#define __pyx_n_u_neighbor __pyx_string_tab[1566]
#define __pyx_n_u_neighbor0_idx __pyx_string_tab[1567]
#define __pyx_n_u_neighbor1_idx __pyx_string_tab[1568]
#define __pyx_n_u_neighbor2_idx __pyx_string_tab[1569]
#define __pyx_n_u_neighbor3_idx __pyx_string_tab[1570]
#define __pyx_n_u_neighbor_end __pyx_string_tab[1571]
#define __pyx_n_u_neighbors __pyx_string_tab[1572]
#define __pyx_n_u_new __pyx_string_tab[1573]
#define __pyx_n_u_new_2 __pyx_string_tab[1574]
#define __pyx_n_u_new_displacement __pyx_string_tab[1575]
#define __pyx_n_u_new_name __pyx_string_tab[1576]
#define __pyx_n_u_new_tie __pyx_string_tab[1577]
#define __pyx_n_u_new_tri __pyx_string_tab[1578]
#define __pyx_n_u_next __pyx_string_tab[1579]
#define __pyx_n_u_next_2 __pyx_string_tab[1580]
#define __pyx_n_u_no_arcs __pyx_string_tab[1581]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[1582]
#define __pyx_kp_u_no_solution_found __pyx_string_tab[1583]
#define __pyx_n_u_non_peripheral __pyx_string_tab[1584]
#define __pyx_kp_u_nonabelian_group_of_order_d __pyx_string_tab[1585]
#define __pyx_kp_u_nonalternating_gz __pyx_string_tab[1586]
#define __pyx_n_u_nonorientable __pyx_string_tab[1587]
#define __pyx_n_u_nonzeros __pyx_string_tab[1588]
#define __pyx_kp_u_not_attempted __pyx_string_tab[1589]
#define __pyx_kp_u_not_filled __pyx_string_tab[1590]
#define __pyx_n_u_nrows __pyx_string_tab[1591]
#define __pyx_n_u_num __pyx_string_tab[1592]
#define __pyx_n_u_num_cols __pyx_string_tab[1593]
#define __pyx_n_u_num_components __pyx_string_tab[1594]
#define __pyx_n_u_num_crossings __pyx_string_tab[1595]
#define __pyx_n_u_num_curves __pyx_string_tab[1596]
#define __pyx_n_u_num_cusps __pyx_string_tab[1597]
#define __pyx_n_u_num_edges __pyx_string_tab[1598]
#define __pyx_n_u_num_faces __pyx_string_tab[1599]
#define __pyx_n_u_num_fake_cusps __pyx_string_tab[1600]
#define __pyx_n_u_num_finite_vertices __pyx_string_tab[1601]
#define __pyx_n_u_num_gen __pyx_string_tab[1602]
#define __pyx_n_u_num_generators __pyx_string_tab[1603]
#define __pyx_n_u_num_gens __pyx_string_tab[1604]
#define __pyx_n_u_num_ideal_vertices __pyx_string_tab[1605]
#define __pyx_n_u_num_lengths __pyx_string_tab[1606]
#define __pyx_n_u_num_links __pyx_string_tab[1607]
#define __pyx_n_u_num_nonor_cusps __pyx_string_tab[1608]
#define __pyx_n_u_num_or_cusps __pyx_string_tab[1609]
#define __pyx_n_u_num_orig_gens __pyx_string_tab[1610]
#define __pyx_n_u_num_original_generators __pyx_string_tab[1611]
#define __pyx_n_u_num_relations __pyx_string_tab[1612]
#define __pyx_n_u_num_relators __pyx_string_tab[1613]
#define __pyx_n_u_num_rows __pyx_string_tab[1614]
#define __pyx_n_u_num_subdivisions __pyx_string_tab[1615]
#define __pyx_n_u_num_surfaces __pyx_string_tab[1616]
#define __pyx_n_u_num_tet __pyx_string_tab[1617]
#define __pyx_n_u_num_tetrahedra __pyx_string_tab[1618]
#define __pyx_n_u_num_threads __pyx_string_tab[1619]
#define __pyx_n_u_num_vertices __pyx_string_tab[1620]
#define __pyx_n_u_number __pyx_string_tab[1621]
#define __pyx_n_u_number_2 __pyx_string_tab[1622]
#define __pyx_n_u_number_to_native_number __pyx_string_tab[1623]
#define __pyx_n_u_obsolete __pyx_string_tab[1624]
#define __pyx_n_u_obstruction_class __pyx_string_tab[1625]
#define __pyx_kp_u_octahedral_group __pyx_string_tab[1626]
#define __pyx_kp_u_of __pyx_string_tab[1627]
#define __pyx_n_u_of_link __pyx_string_tab[1628]
#define __pyx_kp_u_of_shape __pyx_string_tab[1629]
#define __pyx_n_u_offset __pyx_string_tab[1630]
#define __pyx_n_u_old __pyx_string_tab[1631]
#define __pyx_n_u_omega __pyx_string_tab[1632]
#define __pyx_n_u_one_manifold __pyx_string_tab[1633]
#define __pyx_kp_u_one_sided __pyx_string_tab[1634]
#define __pyx_n_u_one_tet_lengths __pyx_string_tab[1635]
#define __pyx_n_u_one_tet_tilts __pyx_string_tab[1636]
#define __pyx_n_u_one_vertex_lengths __pyx_string_tab[1637]
#define __pyx_n_u_opacities __pyx_string_tab[1638]
#define __pyx_n_u_open __pyx_string_tab[1639]
#define __pyx_n_u_operator __pyx_string_tab[1640]
#define __pyx_n_u_order __pyx_string_tab[1641]
#define __pyx_n_u_orient __pyx_string_tab[1642]
#define __pyx_n_u_orientability __pyx_string_tab[1643]
#define __pyx_n_u_orientable __pyx_string_tab[1644]
#define __pyx_n_u_orientation_cover __pyx_string_tab[1645]
#define __pyx_kp_u_orientation_preserving __pyx_string_tab[1646]
#define __pyx_kp_u_orientation_reversing __pyx_string_tab[1647]
#define __pyx_n_u_orig_gens __pyx_string_tab[1648]
#define __pyx_n_u_original_generators __pyx_string_tab[1649]
#define __pyx_n_u_original_index __pyx_string_tab[1650]
#define __pyx_n_u_os __pyx_string_tab[1651]
#define __pyx_n_u_other __pyx_string_tab[1652]
#define __pyx_n_u_out_radius __pyx_string_tab[1653]
#define __pyx_n_u_output __pyx_string_tab[1654]
#define __pyx_n_u_output_file __pyx_string_tab[1655]
#define __pyx_n_u_owns_c_symmetry_group __pyx_string_tab[1656]
#define __pyx_n_u_p __pyx_string_tab[1657]
#define __pyx_n_u_pad __pyx_string_tab[1658]
#define __pyx_n_u_pair __pyx_string_tab[1659]
#define __pyx_n_u_pairing_matrices __pyx_string_tab[1660]
#define __pyx_n_u_pairing_words __pyx_string_tab[1661]
#define __pyx_n_u_pari __pyx_string_tab[1662]
#define __pyx_n_u_parity __pyx_string_tab[1663]
#define __pyx_n_u_part __pyx_string_tab[1664]
#define __pyx_n_u_parts __pyx_string_tab[1665]
#define __pyx_n_u_passes_at_fours __pyx_string_tab[1666]
#define __pyx_n_u_path __pyx_string_tab[1667]
#define __pyx_n_u_path_2 __pyx_string_tab[1668]
#define __pyx_n_u_peripheral __pyx_string_tab[1669]
#define __pyx_n_u_peripheral_curves __pyx_string_tab[1670]
#define __pyx_n_u_peripheral_data __pyx_string_tab[1671]
#define __pyx_n_u_perm __pyx_string_tab[1672]
#define __pyx_n_u_perm0 __pyx_string_tab[1673]
#define __pyx_n_u_perm1 __pyx_string_tab[1674]
#define __pyx_n_u_perm2 __pyx_string_tab[1675]
#define __pyx_n_u_perm3 __pyx_string_tab[1676]
#define __pyx_n_u_perms __pyx_string_tab[1677]
#define __pyx_n_u_permutation __pyx_string_tab[1678]
#define __pyx_n_u_permutation_rep __pyx_string_tab[1679]
#define __pyx_n_u_permutation_reps __pyx_string_tab[1680]
#define __pyx_kp_b_pickle __pyx_string_tab[1681]
#define __pyx_n_b_pickle_2 __pyx_string_tab[1682]
#define __pyx_n_u_pickle_2 __pyx_string_tab[1683]
#define __pyx_n_u_pieces __pyx_string_tab[1684]
#define __pyx_n_u_plink __pyx_string_tab[1685]
#define __pyx_n_u_plink_callback __pyx_string_tab[1686]
#define __pyx_n_u_plink_callback_2 __pyx_string_tab[1687]
#define __pyx_n_u_polish_hyperbolic_structures __pyx_string_tab[1688]
#define __pyx_n_u_polished_tetrahedra_shapes __pyx_string_tab[1689]
#define __pyx_n_u_polyhedral_description __pyx_string_tab[1690]
#define __pyx_n_u_polyviewer __pyx_string_tab[1691]
#define __pyx_n_u_pop __pyx_string_tab[1692]
#define __pyx_n_u_popitem __pyx_string_tab[1693]
#define __pyx_n_u_position __pyx_string_tab[1694]
#define __pyx_n_u_precision __pyx_string_tab[1695]
#define __pyx_n_u_precision_2 __pyx_string_tab[1696]
#define __pyx_n_u_prefix __pyx_string_tab[1697]
#define __pyx_n_u_prepare __pyx_string_tab[1698]
#define __pyx_n_u_presentation __pyx_string_tab[1699]
#define __pyx_n_u_presentation_matrix __pyx_string_tab[1700]
#define __pyx_n_u_print __pyx_string_tab[1701]
#define __pyx_n_u_protocol __pyx_string_tab[1702]
#define __pyx_n_u_ptolemy __pyx_string_tab[1703]
#define __pyx_n_u_ptolemyManifoldMethods __pyx_string_tab[1704]
#define __pyx_n_u_ptolemy_equations_action_by_dec __pyx_string_tab[1705]
#define __pyx_n_u_ptolemy_equations_boundary_map __pyx_string_tab[1706]
#define __pyx_n_u_ptolemy_equations_boundary_map_2 __pyx_string_tab[1707]
#define __pyx_n_u_ptolemy_equations_boundary_map_3 __pyx_string_tab[1708]
#define __pyx_n_u_ptolemy_equations_identified_co __pyx_string_tab[1709]
#define __pyx_n_u_ptolemy_equations_identified_fa __pyx_string_tab[1710]
#define __pyx_n_u_ptolemy_generalized_obstruction __pyx_string_tab[1711]
#define __pyx_n_u_ptolemy_obstruction_classes __pyx_string_tab[1712]
#define __pyx_n_u_ptolemy_variety __pyx_string_tab[1713]
#define __pyx_n_u_python_major_version __pyx_string_tab[1714]
#define __pyx_n_u_pyx_PickleError __pyx_string_tab[1715]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[1716]
#define __pyx_n_u_pyx_result __pyx_string_tab[1717]
#define __pyx_n_u_pyx_state __pyx_string_tab[1718]
#define __pyx_n_u_pyx_type __pyx_string_tab[1719]
#define __pyx_n_u_pyx_unpickle_PresentationMatri __pyx_string_tab[1720]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[1721]
#define __pyx_n_u_q_2 __pyx_string_tab[1722]
#define __pyx_n_u_qualname __pyx_string_tab[1723]
#define __pyx_n_u_r __pyx_string_tab[1724]
#define __pyx_kp_u_r_2 __pyx_string_tab[1725]
#define __pyx_n_u_radius __pyx_string_tab[1726]
#define __pyx_n_u_randomize __pyx_string_tab[1727]
#define __pyx_n_u_range __pyx_string_tab[1728]
#define __pyx_n_u_rank __pyx_string_tab[1729]
#define __pyx_n_u_raw_form __pyx_string_tab[1730]
#define __pyx_n_u_rb __pyx_string_tab[1731]
#define __pyx_n_u_re __pyx_string_tab[1732]
#define __pyx_n_u_reach __pyx_string_tab[1733]
#define __pyx_n_u_read __pyx_string_tab[1734]
#define __pyx_n_u_readline __pyx_string_tab[1735]
#define __pyx_n_u_readlines __pyx_string_tab[1736]
#define __pyx_n_u_real __pyx_string_tab[1737]
#define __pyx_n_u_real_coerced_to_bits_prec __pyx_string_tab[1738]
#define __pyx_n_u_recompute __pyx_string_tab[1739]
#define __pyx_n_u_record __pyx_string_tab[1740]
#define __pyx_n_u_rect __pyx_string_tab[1741]
#define __pyx_n_u_rect_im __pyx_string_tab[1742]
#define __pyx_n_u_rect_re __pyx_string_tab[1743]
#define __pyx_n_u_rect_shape __pyx_string_tab[1744]
#define __pyx_n_u_reduce __pyx_string_tab[1745]
#define __pyx_n_u_reduce_cython __pyx_string_tab[1746]
#define __pyx_n_u_reduce_ex __pyx_string_tab[1747]
#define __pyx_n_u_reduce_list_word __pyx_string_tab[1748]
#define __pyx_n_u_regular __pyx_string_tab[1749]
#define __pyx_n_u_reindex_cusps __pyx_string_tab[1750]
#define __pyx_n_u_rel __pyx_string_tab[1751]
#define __pyx_n_u_relation __pyx_string_tab[1752]
#define __pyx_n_u_relation_list __pyx_string_tab[1753]
#define __pyx_n_u_relators __pyx_string_tab[1754]
#define __pyx_n_u_rels __pyx_string_tab[1755]
#define __pyx_n_u_remove __pyx_string_tab[1756]
#define __pyx_n_u_remove_finite_vertices __pyx_string_tab[1757]
#define __pyx_n_u_remove_finite_vertices_2 __pyx_string_tab[1758]
#define __pyx_n_u_reopen __pyx_string_tab[1759]
#define __pyx_n_u_rep __pyx_string_tab[1760]
#define __pyx_n_u_replace __pyx_string_tab[1761]
#define __pyx_n_u_repr __pyx_string_tab[1762]
#define __pyx_n_u_repr_2 __pyx_string_tab[1763]
#define __pyx_n_u_reps __pyx_string_tab[1764]
#define __pyx_n_u_result __pyx_string_tab[1765]
#define __pyx_n_u_result_curves __pyx_string_tab[1766]
#define __pyx_n_u_result_cusp_indices __pyx_string_tab[1767]
#define __pyx_n_u_return __pyx_string_tab[1768]
#define __pyx_kp_u_return_F __pyx_string_tab[1769]
#define __pyx_n_u_return_isometries __pyx_string_tab[1770]
#define __pyx_n_u_return_matrices __pyx_string_tab[1771]
#define __pyx_n_u_return_type __pyx_string_tab[1772]
#define __pyx_n_u_retval __pyx_string_tab[1773]
#define __pyx_n_u_rev_spec_dict __pyx_string_tab[1774]
#define __pyx_n_u_reverse_orientation __pyx_string_tab[1775]
#define __pyx_n_u_right __pyx_string_tab[1776]
#define __pyx_n_u_rjust __pyx_string_tab[1777]
#define __pyx_n_u_rolfsen_link_regexs __pyx_string_tab[1778]
#define __pyx_n_u_round __pyx_string_tab[1779]
#define __pyx_n_u_row __pyx_string_tab[1780]
#define __pyx_n_u_row_entries __pyx_string_tab[1781]
#define __pyx_n_u_row_op __pyx_string_tab[1782]
#define __pyx_n_u_rows __pyx_string_tab[1783]
#define __pyx_n_u_s __pyx_string_tab[1784]
#define __pyx_kp_u_s_2 __pyx_string_tab[1785]
#define __pyx_kp_u_s_3 __pyx_string_tab[1786]
#define __pyx_kp_u_s_4 __pyx_string_tab[1787]
#define __pyx_kp_u_s_x_s __pyx_string_tab[1788]
#define __pyx_n_u_sage __pyx_string_tab[1789]
#define __pyx_n_u_sage_groups_free_group __pyx_string_tab[1790]
#define __pyx_n_u_sage_groups_perm_gps_permgroup __pyx_string_tab[1791]
#define __pyx_n_u_sage_groups_perm_gps_permgroup_e __pyx_string_tab[1792]
#define __pyx_n_u_sage_helper __pyx_string_tab[1793]
#define __pyx_n_u_sage_interfaces_abc __pyx_string_tab[1794]
#define __pyx_n_u_sage_interfaces_gap __pyx_string_tab[1795]
#define __pyx_n_u_sage_interfaces_magma __pyx_string_tab[1796]
#define __pyx_n_u_sage_matrix __pyx_string_tab[1797]
#define __pyx_n_u_sage_matrix_constructor __pyx_string_tab[1798]
#define __pyx_n_u_sage_object __pyx_string_tab[1799]
#define __pyx_n_u_sage_rings_integer __pyx_string_tab[1800]
#define __pyx_n_u_sage_structure_sage_object __pyx_string_tab[1801]
#define __pyx_n_u_save __pyx_string_tab[1802]
#define __pyx_n_u_savefile __pyx_string_tab[1803]
#define __pyx_n_u_second_char __pyx_string_tab[1804]
#define __pyx_n_u_second_nybble __pyx_string_tab[1805]
#define __pyx_n_u_seed __pyx_string_tab[1806]
#define __pyx_n_u_seek __pyx_string_tab[1807]
#define __pyx_n_u_segment __pyx_string_tab[1808]
#define __pyx_n_u_segment_list __pyx_string_tab[1809]
#define __pyx_n_u_self __pyx_string_tab[1810]
#define __pyx_n_u_send __pyx_string_tab[1811]
#define __pyx_n_u_sep __pyx_string_tab[1812]
#define __pyx_n_u_set_DTcode __pyx_string_tab[1813]
#define __pyx_n_u_set_PDcode __pyx_string_tab[1814]
#define __pyx_n_u_set_displacement __pyx_string_tab[1815]
#define __pyx_n_u_set_name __pyx_string_tab[1816]
#define __pyx_n_u_set_name_2 __pyx_string_tab[1817]
#define __pyx_n_u_set_peripheral_curves __pyx_string_tab[1818]
#define __pyx_n_u_set_peripheral_from_decoration __pyx_string_tab[1819]
#define __pyx_n_u_set_rand_seed __pyx_string_tab[1820]
#define __pyx_n_u_set_real_precision __pyx_string_tab[1821]
#define __pyx_n_u_set_target_holonomy __pyx_string_tab[1822]
#define __pyx_n_u_set_test_flag __pyx_string_tab[1823]
#define __pyx_n_u_set_tetrahedra_shapes __pyx_string_tab[1824]
#define __pyx_n_u_set_tie __pyx_string_tab[1825]
#define __pyx_n_u_setattr __pyx_string_tab[1826]
#define __pyx_n_u_setitem __pyx_string_tab[1827]
#define __pyx_n_u_setstate __pyx_string_tab[1828]
#define __pyx_n_u_setstate_cython __pyx_string_tab[1829]
#define __pyx_n_u_seven_length __pyx_string_tab[1830]
#define __pyx_n_u_shape __pyx_string_tab[1831]
#define __pyx_n_u_shape_accuracy __pyx_string_tab[1832]
#define __pyx_kp_u_shape_precision __pyx_string_tab[1833]
#define __pyx_n_u_shapes __pyx_string_tab[1834]
#define __pyx_n_u_short_relators __pyx_string_tab[1835]
#define __pyx_n_u_shortest __pyx_string_tab[1836]
#define __pyx_n_u_shortest_longitudes __pyx_string_tab[1837]
#define __pyx_n_u_shortest_meridians __pyx_string_tab[1838]
#define __pyx_n_u_show_uAcknowledge __pyx_string_tab[1839]
#define __pyx_n_u_shrink_factor __pyx_string_tab[1840]
#define __pyx_n_u_side __pyx_string_tab[1841]
#define __pyx_n_u_side_lengths __pyx_string_tab[1842]
#define __pyx_n_u_sided __pyx_string_tab[1843]
#define __pyx_n_u_sign __pyx_string_tab[1844]
#define __pyx_n_u_signs __pyx_string_tab[1845]
#define __pyx_n_u_signtype __pyx_string_tab[1846]
#define __pyx_n_u_simplified_matrix __pyx_string_tab[1847]
#define __pyx_n_u_simplify __pyx_string_tab[1848]
#define __pyx_n_u_simplify_presentation __pyx_string_tab[1849]
#define __pyx_n_u_singularity_index __pyx_string_tab[1850]
#define __pyx_n_u_six_length __pyx_string_tab[1851]
#define __pyx_n_u_size __pyx_string_tab[1852]
#define __pyx_n_u_smith_form __pyx_string_tab[1853]
#define __pyx_n_u_snap __pyx_string_tab[1854]
#define __pyx_n_u_snapPea __pyx_string_tab[1855]
#define __pyx_n_u_snappea __pyx_string_tab[1856]
#define __pyx_n_u_snappy __pyx_string_tab[1857]
#define __pyx_kp_u_snappy_Manifold __pyx_string_tab[1858]
#define __pyx_kp_u_snappy_Triangulation __pyx_string_tab[1859]
#define __pyx_n_u_so_far __pyx_string_tab[1860]
#define __pyx_n_u_soln __pyx_string_tab[1861]
#define __pyx_n_u_solution_type __pyx_string_tab[1862]
#define __pyx_n_u_sorted __pyx_string_tab[1863]
#define __pyx_n_u_spec __pyx_string_tab[1864]
#define __pyx_n_u_spec_2 __pyx_string_tab[1865]
#define __pyx_n_u_specs __pyx_string_tab[1866]
#define __pyx_n_u_spectrum __pyx_string_tab[1867]
#define __pyx_n_u_spherogram __pyx_string_tab[1868]
#define __pyx_n_u_spin_short __pyx_string_tab[1869]
#define __pyx_n_u_spine_radius __pyx_string_tab[1870]
#define __pyx_n_u_split __pyx_string_tab[1871]
#define __pyx_n_u_split_filling_info __pyx_string_tab[1872]
#define __pyx_n_u_splitting __pyx_string_tab[1873]
#define __pyx_n_u_splitting_from_string __pyx_string_tab[1874]
#define __pyx_n_u_splitting_surfaces __pyx_string_tab[1875]
#define __pyx_n_u_start __pyx_string_tab[1876]
#define __pyx_n_u_startswith __pyx_string_tab[1877]
#define __pyx_n_u_state __pyx_string_tab[1878]
#define __pyx_n_u_staticmethod __pyx_string_tab[1879]
#define __pyx_n_u_stderr __pyx_string_tab[1880]
#define __pyx_n_u_stdout __pyx_string_tab[1881]
#define __pyx_n_u_step __pyx_string_tab[1882]
#define __pyx_n_u_stl __pyx_string_tab[1883]
#define __pyx_n_u_stop __pyx_string_tab[1884]
#define __pyx_n_u_stopper __pyx_string_tab[1885]
#define __pyx_n_u_stopping_displacement __pyx_string_tab[1886]
#define __pyx_n_u_str __pyx_string_tab[1887]
#define __pyx_n_u_strandtype __pyx_string_tab[1888]
#define __pyx_n_u_strategy __pyx_string_tab[1889]
#define __pyx_n_u_string __pyx_string_tab[1890]
#define __pyx_kp_u_stringsource __pyx_string_tab[1891]
#define __pyx_n_u_strip __pyx_string_tab[1892]
#define __pyx_n_u_strline __pyx_string_tab[1893]
#define __pyx_n_u_struct __pyx_string_tab[1894]
#define __pyx_n_u_structure __pyx_string_tab[1895]
#define __pyx_n_u_subgroup __pyx_string_tab[1896]
#define __pyx_n_u_success __pyx_string_tab[1897]
#define __pyx_n_u_sum __pyx_string_tab[1898]
#define __pyx_n_u_super __pyx_string_tab[1899]
#define __pyx_n_u_surface __pyx_string_tab[1900]
#define __pyx_n_u_surfaces __pyx_string_tab[1901]
#define __pyx_kp_u_surfaces_but_you_asked_for_surf __pyx_string_tab[1902]
#define __pyx_n_u_symmetric_triangulation __pyx_string_tab[1903]
#define __pyx_n_u_symmetries_of_link __pyx_string_tab[1904]
#define __pyx_n_u_symmetries_of_manifold __pyx_string_tab[1905]
#define __pyx_n_u_symmetry_group __pyx_string_tab[1906]
#define __pyx_n_u_symplectic_basis __pyx_string_tab[1907]
#define __pyx_n_u_symplectic_form __pyx_string_tab[1908]
#define __pyx_n_u_sys __pyx_string_tab[1909]
#define __pyx_n_u_t __pyx_string_tab[1910]
#define __pyx_n_u_table __pyx_string_tab[1911]
#define __pyx_n_u_table_directory __pyx_string_tab[1912]
#define __pyx_n_u_tail __pyx_string_tab[1913]
#define __pyx_n_u_tail_vertex_index __pyx_string_tab[1914]
#define __pyx_n_u_tarfile __pyx_string_tab[1915]
#define __pyx_n_u_target __pyx_string_tab[1916]
#define __pyx_n_u_tarpath __pyx_string_tab[1917]
#define __pyx_n_u_temp __pyx_string_tab[1918]
#define __pyx_n_u_tempfile __pyx_string_tab[1919]
#define __pyx_n_u_test __pyx_string_tab[1920]
#define __pyx_n_u_tet __pyx_string_tab[1921]
#define __pyx_n_u_tet_num __pyx_string_tab[1922]
#define __pyx_n_u_tetrahedra_data __pyx_string_tab[1923]
#define __pyx_n_u_tetrahedra_shapes __pyx_string_tab[1924]
#define __pyx_kp_u_tetrahedra_shapes_were_inserted __pyx_string_tab[1925]
#define __pyx_kp_u_tetrahedral_group __pyx_string_tab[1926]
#define __pyx_kp_u_the_gap_method_for_covers_requir __pyx_string_tab[1927]
#define __pyx_kp_u_the_magma_method_for_covers_requ __pyx_string_tab[1928]
#define __pyx_n_u_three_to_two __pyx_string_tab[1929]
#define __pyx_n_u_throw __pyx_string_tab[1930]
#define __pyx_n_u_tilts __pyx_string_tab[1931]
#define __pyx_n_u_time __pyx_string_tab[1932]
#define __pyx_n_u_tip __pyx_string_tab[1933]
#define __pyx_n_u_tip_vertex_index __pyx_string_tab[1934]
#define __pyx_n_u_title __pyx_string_tab[1935]
#define __pyx_n_u_to_byte_str __pyx_string_tab[1936]
#define __pyx_n_u_to_bytes __pyx_string_tab[1937]
#define __pyx_n_u_to_do __pyx_string_tab[1938]
#define __pyx_n_u_to_str __pyx_string_tab[1939]
#define __pyx_n_u_to_string __pyx_string_tab[1940]
#define __pyx_n_u_to_string_locals_genexpr __pyx_string_tab[1941]
#define __pyx_n_u_top_level_tries __pyx_string_tab[1942]
#define __pyx_n_u_topology __pyx_string_tab[1943]
#define __pyx_kp_u_torus_cusp __pyx_string_tab[1944]
#define __pyx_n_u_total __pyx_string_tab[1945]
#define __pyx_n_u_translations __pyx_string_tab[1946]
#define __pyx_kp_u_tri __pyx_string_tab[1947]
#define __pyx_kp_u_tri_txt __pyx_string_tab[1948]
#define __pyx_n_u_triangulation __pyx_string_tab[1949]
#define __pyx_n_u_triangulation_class __pyx_string_tab[1950]
#define __pyx_n_u_triangulation_help __pyx_string_tab[1951]
#define __pyx_n_u_triangulation_isosig __pyx_string_tab[1952]
#define __pyx_n_u_try_hard_to_shorten_relators __pyx_string_tab[1953]
#define __pyx_n_u_twister __pyx_string_tab[1954]
#define __pyx_n_u_twister_word __pyx_string_tab[1955]
#define __pyx_n_u_two_sided __pyx_string_tab[1956]
#define __pyx_kp_u_two_sided_2 __pyx_string_tab[1957]
#define __pyx_n_u_two_to_three __pyx_string_tab[1958]
#define __pyx_n_u_type __pyx_string_tab[1959]
#define __pyx_n_u_type_str __pyx_string_tab[1960]
#define __pyx_n_u_types __pyx_string_tab[1961]
#define __pyx_n_u_typing __pyx_string_tab[1962]
#define __pyx_kp_u_typing_Optional_str __pyx_string_tab[1963]
#define __pyx_n_u_u __pyx_string_tab[1964]
#define __pyx_n_u_undecorated_triangulation_isosi __pyx_string_tab[1965]
#define __pyx_n_u_unit __pyx_string_tab[1966]
#define __pyx_n_u_unknown __pyx_string_tab[1967]
#define __pyx_n_u_unnamed __pyx_string_tab[1968]
#define __pyx_kp_u_unnamed_link __pyx_string_tab[1969]
#define __pyx_n_u_unpack __pyx_string_tab[1970]
#define __pyx_n_u_unpickle_dirichlet_domain __pyx_string_tab[1971]
#define __pyx_kp_u_unrecognized_solution_type __pyx_string_tab[1972]
#define __pyx_n_u_unsimplified_filled_triangulati __pyx_string_tab[1973]
#define __pyx_n_u_unsimplified_filled_triangulati_2 __pyx_string_tab[1974]
#define __pyx_n_u_update __pyx_string_tab[1975]
#define __pyx_n_u_upper __pyx_string_tab[1976]
#define __pyx_n_u_use_field_conversion __pyx_string_tab[1977]
#define __pyx_n_u_use_setstate __pyx_string_tab[1978]
#define __pyx_n_u_user_radius __pyx_string_tab[1979]
#define __pyx_kp_u_utf_8 __pyx_string_tab[1980]
#define __pyx_n_u_v __pyx_string_tab[1981]
#define __pyx_kp_u_v1205_2_3 __pyx_string_tab[1982]
#define __pyx_n_u_valid_index __pyx_string_tab[1983]
#define __pyx_n_u_value __pyx_string_tab[1984]
#define __pyx_n_u_values __pyx_string_tab[1985]
#define __pyx_n_u_verbose_form __pyx_string_tab[1986]
#define __pyx_n_u_verified __pyx_string_tab[1987]
#define __pyx_n_u_verify __pyx_string_tab[1988]
#define __pyx_n_u_verify_complex_volume __pyx_string_tab[1989]
#define __pyx_n_u_version_info __pyx_string_tab[1990]
#define __pyx_n_u_vertex __pyx_string_tab[1991]
#define __pyx_n_u_vertex_class __pyx_string_tab[1992]
#define __pyx_n_u_vertex_data_list __pyx_string_tab[1993]
#define __pyx_n_u_vertex_epsilon __pyx_string_tab[1994]
#define __pyx_n_u_vertex_image_indices __pyx_string_tab[1995]
#define __pyx_n_u_vertex_indices __pyx_string_tab[1996]
#define __pyx_n_u_vertex_list __pyx_string_tab[1997]
#define __pyx_n_u_vertex_list_2 __pyx_string_tab[1998]
#define __pyx_n_u_vertex_to_index __pyx_string_tab[1999]
#define __pyx_n_u_vertex_to_index_dict __pyx_string_tab[2000]
#define __pyx_n_u_vertices __pyx_string_tab[2001]
#define __pyx_n_u_view __pyx_string_tab[2002]
#define __pyx_n_u_vol __pyx_string_tab[2003]
#define __pyx_n_u_volume __pyx_string_tab[2004]
#define __pyx_n_u_w __pyx_string_tab[2005]
#define __pyx_n_u_w0 __pyx_string_tab[2006]
#define __pyx_n_u_w1 __pyx_string_tab[2007]
#define __pyx_kp_u_was_not_found __pyx_string_tab[2008]
#define __pyx_n_u_wb __pyx_string_tab[2009]
#define __pyx_n_u_where_to_resume __pyx_string_tab[2010]
#define __pyx_n_u_which_curve __pyx_string_tab[2011]
#define __pyx_n_u_which_cusp __pyx_string_tab[2012]
#define __pyx_n_u_which_solution __pyx_string_tab[2013]
#define __pyx_n_u_which_surface __pyx_string_tab[2014]
#define __pyx_kp_u_with_Dehn_filling_coefficients __pyx_string_tab[2015]
#define __pyx_kp_u_with_euler __pyx_string_tab[2016]
#define __pyx_n_u_with_hyperbolic_structure __pyx_string_tab[2017]
#define __pyx_n_u_within_sage __pyx_string_tab[2018]
#define __pyx_n_u_without_hyperbolic_structure __pyx_string_tab[2019]
#define __pyx_n_u_word __pyx_string_tab[2020]
#define __pyx_n_u_word_as_list __pyx_string_tab[2021]
#define __pyx_n_u_word_list __pyx_string_tab[2022]
#define __pyx_n_u_word_moves __pyx_string_tab[2023]
#define __pyx_n_u_words __pyx_string_tab[2024]
#define __pyx_n_u_write __pyx_string_tab[2025]
#define __pyx_n_u_x __pyx_string_tab[2026]
#define __pyx_n_u_x012 __pyx_string_tab[2027]
#define __pyx_kp_u_xX_d __pyx_string_tab[2028]
#define __pyx_kp_u_x_d_1 __pyx_string_tab[2029]
#define __pyx_n_u_y __pyx_string_tab[2030]
#define __pyx_n_u_y123 __pyx_string_tab[2031]
#define __pyx_n_u_z __pyx_string_tab[2032]
#define __pyx_n_u_zeros __pyx_string_tab[2033]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_Triangulation);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_Triangulation);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_Manifold);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_Manifold);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_AbelianGroup);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_AbelianGroup);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_PresentationMatrix);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_PresentationMatrix);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_CFundamentalGroup);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_CFundamentalGroup);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_CHolonomyGroup);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_CHolonomyGroup);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_SymmetryGroup);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_SymmetryGroup);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_CDirichletDomain);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_CDirichletDomain);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP_CCuspNeighborhood);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP_CCuspNeighborhood);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_defaults);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_defaults);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr);
  Py_CLEAR(clear_module_state->__pyx_k__29);
  Py_CLEAR(clear_module_state->__pyx_k__31);
  Py_CLEAR(clear_module_state->__pyx_k__38);
  for (int i=0; i<6; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<79; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<311; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<2034; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  Py_CLEAR(clear_module_state->__pyx_float_0_0);
  Py_CLEAR(clear_module_state->__pyx_float_0_1);
  Py_CLEAR(clear_module_state->__pyx_float_0_2);
  Py_CLEAR(clear_module_state->__pyx_float_0_9);
  Py_CLEAR(clear_module_state->__pyx_float_1_0);
  Py_CLEAR(clear_module_state->__pyx_float_1eneg_9);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_3);
  Py_CLEAR(clear_module_state->__pyx_int_4);
  Py_CLEAR(clear_module_state->__pyx_int_5);
  Py_CLEAR(clear_module_state->__pyx_int_6);
  Py_CLEAR(clear_module_state->__pyx_int_7);
  Py_CLEAR(clear_module_state->__pyx_int_8);
  Py_CLEAR(clear_module_state->__pyx_int_9);
  Py_CLEAR(clear_module_state->__pyx_int_10);
  Py_CLEAR(clear_module_state->__pyx_int_11);
  Py_CLEAR(clear_module_state->__pyx_int_12);
  Py_CLEAR(clear_module_state->__pyx_int_13);
  Py_CLEAR(clear_module_state->__pyx_int_14);
  Py_CLEAR(clear_module_state->__pyx_int_15);
  Py_CLEAR(clear_module_state->__pyx_int_16);
  Py_CLEAR(clear_module_state->__pyx_int_17);
  Py_CLEAR(clear_module_state->__pyx_int_18);
  Py_CLEAR(clear_module_state->__pyx_int_19);
  Py_CLEAR(clear_module_state->__pyx_int_20);
  Py_CLEAR(clear_module_state->__pyx_int_21);
  Py_CLEAR(clear_module_state->__pyx_int_22);
  Py_CLEAR(clear_module_state->__pyx_int_23);
  Py_CLEAR(clear_module_state->__pyx_int_24);
  Py_CLEAR(clear_module_state->__pyx_int_25);
  Py_CLEAR(clear_module_state->__pyx_int_26);
  Py_CLEAR(clear_module_state->__pyx_int_27);
  Py_CLEAR(clear_module_state->__pyx_int_28);
  Py_CLEAR(clear_module_state->__pyx_int_29);
  Py_CLEAR(clear_module_state->__pyx_int_30);
  Py_CLEAR(clear_module_state->__pyx_int_31);
  Py_CLEAR(clear_module_state->__pyx_int_32);
  Py_CLEAR(clear_module_state->__pyx_int_33);
  Py_CLEAR(clear_module_state->__pyx_int_34);
  Py_CLEAR(clear_module_state->__pyx_int_35);
  Py_CLEAR(clear_module_state->__pyx_int_36);
  Py_CLEAR(clear_module_state->__pyx_int_37);
  Py_CLEAR(clear_module_state->__pyx_int_38);
  Py_CLEAR(clear_module_state->__pyx_int_39);
  Py_CLEAR(clear_module_state->__pyx_int_40);
  Py_CLEAR(clear_module_state->__pyx_int_41);
  Py_CLEAR(clear_module_state->__pyx_int_42);
  Py_CLEAR(clear_module_state->__pyx_int_43);
  Py_CLEAR(clear_module_state->__pyx_int_44);
  Py_CLEAR(clear_module_state->__pyx_int_45);
  Py_CLEAR(clear_module_state->__pyx_int_46);
  Py_CLEAR(clear_module_state->__pyx_int_47);
  Py_CLEAR(clear_module_state->__pyx_int_48);
  Py_CLEAR(clear_module_state->__pyx_int_49);
  Py_CLEAR(clear_module_state->__pyx_int_50);
  Py_CLEAR(clear_module_state->__pyx_int_51);
  Py_CLEAR(clear_module_state->__pyx_int_52);
  Py_CLEAR(clear_module_state->__pyx_int_53);
  Py_CLEAR(clear_module_state->__pyx_int_54);
  Py_CLEAR(clear_module_state->__pyx_int_55);
  Py_CLEAR(clear_module_state->__pyx_int_56);
  Py_CLEAR(clear_module_state->__pyx_int_57);
  Py_CLEAR(clear_module_state->__pyx_int_58);
  Py_CLEAR(clear_module_state->__pyx_int_59);
  Py_CLEAR(clear_module_state->__pyx_int_60);
  Py_CLEAR(clear_module_state->__pyx_int_61);
  Py_CLEAR(clear_module_state->__pyx_int_62);
  Py_CLEAR(clear_module_state->__pyx_int_63);
  Py_CLEAR(clear_module_state->__pyx_int_64);
  Py_CLEAR(clear_module_state->__pyx_int_65);
  Py_CLEAR(clear_module_state->__pyx_int_66);
  Py_CLEAR(clear_module_state->__pyx_int_67);
  Py_CLEAR(clear_module_state->__pyx_int_68);
  Py_CLEAR(clear_module_state->__pyx_int_69);
  Py_CLEAR(clear_module_state->__pyx_int_70);
  Py_CLEAR(clear_module_state->__pyx_int_71);
  Py_CLEAR(clear_module_state->__pyx_int_72);
  Py_CLEAR(clear_module_state->__pyx_int_73);
  Py_CLEAR(clear_module_state->__pyx_int_74);
  Py_CLEAR(clear_module_state->__pyx_int_75);
  Py_CLEAR(clear_module_state->__pyx_int_76);
  Py_CLEAR(clear_module_state->__pyx_int_77);
  Py_CLEAR(clear_module_state->__pyx_int_78);
  Py_CLEAR(clear_module_state->__pyx_int_79);
  Py_CLEAR(clear_module_state->__pyx_int_80);
  Py_CLEAR(clear_module_state->__pyx_int_81);
  Py_CLEAR(clear_module_state->__pyx_int_82);
  Py_CLEAR(clear_module_state->__pyx_int_83);
  Py_CLEAR(clear_module_state->__pyx_int_84);
  Py_CLEAR(clear_module_state->__pyx_int_85);
  Py_CLEAR(clear_module_state->__pyx_int_86);
  Py_CLEAR(clear_module_state->__pyx_int_87);
  Py_CLEAR(clear_module_state->__pyx_int_88);
  Py_CLEAR(clear_module_state->__pyx_int_89);
  Py_CLEAR(clear_module_state->__pyx_int_90);
  Py_CLEAR(clear_module_state->__pyx_int_91);
  Py_CLEAR(clear_module_state->__pyx_int_92);
  Py_CLEAR(clear_module_state->__pyx_int_93);
  Py_CLEAR(clear_module_state->__pyx_int_94);
  Py_CLEAR(clear_module_state->__pyx_int_95);
  Py_CLEAR(clear_module_state->__pyx_int_96);
  Py_CLEAR(clear_module_state->__pyx_int_97);
  Py_CLEAR(clear_module_state->__pyx_int_98);
  Py_CLEAR(clear_module_state->__pyx_int_99);
  Py_CLEAR(clear_module_state->__pyx_int_100);
  Py_CLEAR(clear_module_state->__pyx_int_101);
  Py_CLEAR(clear_module_state->__pyx_int_102);
  Py_CLEAR(clear_module_state->__pyx_int_103);
  Py_CLEAR(clear_module_state->__pyx_int_104);
  Py_CLEAR(clear_module_state->__pyx_int_105);
  Py_CLEAR(clear_module_state->__pyx_int_106);
  Py_CLEAR(clear_module_state->__pyx_int_107);
  Py_CLEAR(clear_module_state->__pyx_int_108);
  Py_CLEAR(clear_module_state->__pyx_int_109);
  Py_CLEAR(clear_module_state->__pyx_int_110);
  Py_CLEAR(clear_module_state->__pyx_int_111);
  Py_CLEAR(clear_module_state->__pyx_int_112);
  Py_CLEAR(clear_module_state->__pyx_int_113);
  Py_CLEAR(clear_module_state->__pyx_int_114);
  Py_CLEAR(clear_module_state->__pyx_int_115);
  Py_CLEAR(clear_module_state->__pyx_int_116);
  Py_CLEAR(clear_module_state->__pyx_int_117);
  Py_CLEAR(clear_module_state->__pyx_int_118);
  Py_CLEAR(clear_module_state->__pyx_int_119);
  Py_CLEAR(clear_module_state->__pyx_int_120);
  Py_CLEAR(clear_module_state->__pyx_int_121);
  Py_CLEAR(clear_module_state->__pyx_int_122);
  Py_CLEAR(clear_module_state->__pyx_int_123);
  Py_CLEAR(clear_module_state->__pyx_int_124);
  Py_CLEAR(clear_module_state->__pyx_int_125);
  Py_CLEAR(clear_module_state->__pyx_int_126);
  Py_CLEAR(clear_module_state->__pyx_int_127);
  Py_CLEAR(clear_module_state->__pyx_int_128);
  Py_CLEAR(clear_module_state->__pyx_int_129);
  Py_CLEAR(clear_module_state->__pyx_int_130);
  Py_CLEAR(clear_module_state->__pyx_int_131);
  Py_CLEAR(clear_module_state->__pyx_int_132);
  Py_CLEAR(clear_module_state->__pyx_int_133);
  Py_CLEAR(clear_module_state->__pyx_int_134);
  Py_CLEAR(clear_module_state->__pyx_int_135);
  Py_CLEAR(clear_module_state->__pyx_int_136);
  Py_CLEAR(clear_module_state->__pyx_int_137);
  Py_CLEAR(clear_module_state->__pyx_int_138);
  Py_CLEAR(clear_module_state->__pyx_int_139);
  Py_CLEAR(clear_module_state->__pyx_int_140);
  Py_CLEAR(clear_module_state->__pyx_int_141);
  Py_CLEAR(clear_module_state->__pyx_int_142);
  Py_CLEAR(clear_module_state->__pyx_int_143);
  Py_CLEAR(clear_module_state->__pyx_int_144);
  Py_CLEAR(clear_module_state->__pyx_int_145);
  Py_CLEAR(clear_module_state->__pyx_int_146);
  Py_CLEAR(clear_module_state->__pyx_int_147);
  Py_CLEAR(clear_module_state->__pyx_int_148);
  Py_CLEAR(clear_module_state->__pyx_int_149);
  Py_CLEAR(clear_module_state->__pyx_int_150);
  Py_CLEAR(clear_module_state->__pyx_int_151);
  Py_CLEAR(clear_module_state->__pyx_int_152);
  Py_CLEAR(clear_module_state->__pyx_int_153);
  Py_CLEAR(clear_module_state->__pyx_int_154);
  Py_CLEAR(clear_module_state->__pyx_int_155);
  Py_CLEAR(clear_module_state->__pyx_int_156);
  Py_CLEAR(clear_module_state->__pyx_int_157);
  Py_CLEAR(clear_module_state->__pyx_int_158);
  Py_CLEAR(clear_module_state->__pyx_int_159);
  Py_CLEAR(clear_module_state->__pyx_int_160);
  Py_CLEAR(clear_module_state->__pyx_int_161);
  Py_CLEAR(clear_module_state->__pyx_int_162);
  Py_CLEAR(clear_module_state->__pyx_int_163);
  Py_CLEAR(clear_module_state->__pyx_int_164);
  Py_CLEAR(clear_module_state->__pyx_int_165);
  Py_CLEAR(clear_module_state->__pyx_int_166);
  Py_CLEAR(clear_module_state->__pyx_int_167);
  Py_CLEAR(clear_module_state->__pyx_int_168);
  Py_CLEAR(clear_module_state->__pyx_int_169);
  Py_CLEAR(clear_module_state->__pyx_int_170);
  Py_CLEAR(clear_module_state->__pyx_int_171);
  Py_CLEAR(clear_module_state->__pyx_int_172);
  Py_CLEAR(clear_module_state->__pyx_int_173);
  Py_CLEAR(clear_module_state->__pyx_int_174);
  Py_CLEAR(clear_module_state->__pyx_int_175);
  Py_CLEAR(clear_module_state->__pyx_int_176);
  Py_CLEAR(clear_module_state->__pyx_int_177);
  Py_CLEAR(clear_module_state->__pyx_int_178);
  Py_CLEAR(clear_module_state->__pyx_int_179);
  Py_CLEAR(clear_module_state->__pyx_int_180);
  Py_CLEAR(clear_module_state->__pyx_int_181);
  Py_CLEAR(clear_module_state->__pyx_int_182);
  Py_CLEAR(clear_module_state->__pyx_int_183);
  Py_CLEAR(clear_module_state->__pyx_int_184);
  Py_CLEAR(clear_module_state->__pyx_int_185);
  Py_CLEAR(clear_module_state->__pyx_int_186);
  Py_CLEAR(clear_module_state->__pyx_int_187);
  Py_CLEAR(clear_module_state->__pyx_int_188);
  Py_CLEAR(clear_module_state->__pyx_int_189);
  Py_CLEAR(clear_module_state->__pyx_int_190);
  Py_CLEAR(clear_module_state->__pyx_int_191);
  Py_CLEAR(clear_module_state->__pyx_int_192);
  Py_CLEAR(clear_module_state->__pyx_int_193);
  Py_CLEAR(clear_module_state->__pyx_int_194);
  Py_CLEAR(clear_module_state->__pyx_int_195);
  Py_CLEAR(clear_module_state->__pyx_int_196);
  Py_CLEAR(clear_module_state->__pyx_int_197);
  Py_CLEAR(clear_module_state->__pyx_int_198);
  Py_CLEAR(clear_module_state->__pyx_int_199);
  Py_CLEAR(clear_module_state->__pyx_int_200);
  Py_CLEAR(clear_module_state->__pyx_int_201);
  Py_CLEAR(clear_module_state->__pyx_int_202);
  Py_CLEAR(clear_module_state->__pyx_int_203);
  Py_CLEAR(clear_module_state->__pyx_int_204);
  Py_CLEAR(clear_module_state->__pyx_int_205);
  Py_CLEAR(clear_module_state->__pyx_int_206);
  Py_CLEAR(clear_module_state->__pyx_int_207);
  Py_CLEAR(clear_module_state->__pyx_int_208);
  Py_CLEAR(clear_module_state->__pyx_int_209);
  Py_CLEAR(clear_module_state->__pyx_int_210);
  Py_CLEAR(clear_module_state->__pyx_int_211);
  Py_CLEAR(clear_module_state->__pyx_int_212);
  Py_CLEAR(clear_module_state->__pyx_int_213);
  Py_CLEAR(clear_module_state->__pyx_int_214);
  Py_CLEAR(clear_module_state->__pyx_int_215);
  Py_CLEAR(clear_module_state->__pyx_int_216);
  Py_CLEAR(clear_module_state->__pyx_int_217);
  Py_CLEAR(clear_module_state->__pyx_int_218);
  Py_CLEAR(clear_module_state->__pyx_int_219);
  Py_CLEAR(clear_module_state->__pyx_int_220);
  Py_CLEAR(clear_module_state->__pyx_int_221);
  Py_CLEAR(clear_module_state->__pyx_int_222);
  Py_CLEAR(clear_module_state->__pyx_int_223);
  Py_CLEAR(clear_module_state->__pyx_int_224);
  Py_CLEAR(clear_module_state->__pyx_int_225);
  Py_CLEAR(clear_module_state->__pyx_int_226);
  Py_CLEAR(clear_module_state->__pyx_int_227);
  Py_CLEAR(clear_module_state->__pyx_int_228);
  Py_CLEAR(clear_module_state->__pyx_int_229);
  Py_CLEAR(clear_module_state->__pyx_int_230);
  Py_CLEAR(clear_module_state->__pyx_int_231);
  Py_CLEAR(clear_module_state->__pyx_int_232);
  Py_CLEAR(clear_module_state->__pyx_int_233);
  Py_CLEAR(clear_module_state->__pyx_int_234);
  Py_CLEAR(clear_module_state->__pyx_int_235);
  Py_CLEAR(clear_module_state->__pyx_int_236);
  Py_CLEAR(clear_module_state->__pyx_int_237);
  Py_CLEAR(clear_module_state->__pyx_int_238);
  Py_CLEAR(clear_module_state->__pyx_int_239);
  Py_CLEAR(clear_module_state->__pyx_int_240);
  Py_CLEAR(clear_module_state->__pyx_int_241);
  Py_CLEAR(clear_module_state->__pyx_int_242);
  Py_CLEAR(clear_module_state->__pyx_int_243);
  Py_CLEAR(clear_module_state->__pyx_int_244);
  Py_CLEAR(clear_module_state->__pyx_int_245);
  Py_CLEAR(clear_module_state->__pyx_int_246);
  Py_CLEAR(clear_module_state->__pyx_int_247);
  Py_CLEAR(clear_module_state->__pyx_int_248);
  Py_CLEAR(clear_module_state->__pyx_int_249);
  Py_CLEAR(clear_module_state->__pyx_int_250);
  Py_CLEAR(clear_module_state->__pyx_int_251);
  Py_CLEAR(clear_module_state->__pyx_int_252);
  Py_CLEAR(clear_module_state->__pyx_int_253);
  Py_CLEAR(clear_module_state->__pyx_int_254);
  Py_CLEAR(clear_module_state->__pyx_int_255);
  Py_CLEAR(clear_module_state->__pyx_int_256);
  Py_CLEAR(clear_module_state->__pyx_int_257);
  Py_CLEAR(clear_module_state->__pyx_int_258);
  Py_CLEAR(clear_module_state->__pyx_int_259);
  Py_CLEAR(clear_module_state->__pyx_int_260);
  Py_CLEAR(clear_module_state->__pyx_int_261);
  Py_CLEAR(clear_module_state->__pyx_int_262);
  Py_CLEAR(clear_module_state->__pyx_int_263);
  Py_CLEAR(clear_module_state->__pyx_int_264);
  Py_CLEAR(clear_module_state->__pyx_int_265);
  Py_CLEAR(clear_module_state->__pyx_int_266);
  Py_CLEAR(clear_module_state->__pyx_int_267);
  Py_CLEAR(clear_module_state->__pyx_int_268);
  Py_CLEAR(clear_module_state->__pyx_int_269);
  Py_CLEAR(clear_module_state->__pyx_int_270);
  Py_CLEAR(clear_module_state->__pyx_int_271);
  Py_CLEAR(clear_module_state->__pyx_int_272);
  Py_CLEAR(clear_module_state->__pyx_int_273);
  Py_CLEAR(clear_module_state->__pyx_int_274);
  Py_CLEAR(clear_module_state->__pyx_int_275);
  Py_CLEAR(clear_module_state->__pyx_int_276);
  Py_CLEAR(clear_module_state->__pyx_int_277);
  Py_CLEAR(clear_module_state->__pyx_int_278);
  Py_CLEAR(clear_module_state->__pyx_int_279);
  Py_CLEAR(clear_module_state->__pyx_int_280);
  Py_CLEAR(clear_module_state->__pyx_int_281);
  Py_CLEAR(clear_module_state->__pyx_int_282);
  Py_CLEAR(clear_module_state->__pyx_int_283);
  Py_CLEAR(clear_module_state->__pyx_int_284);
  Py_CLEAR(clear_module_state->__pyx_int_285);
  Py_CLEAR(clear_module_state->__pyx_int_286);
  Py_CLEAR(clear_module_state->__pyx_int_287);
  Py_CLEAR(clear_module_state->__pyx_int_288);
  Py_CLEAR(clear_module_state->__pyx_int_289);
  Py_CLEAR(clear_module_state->__pyx_int_290);
  Py_CLEAR(clear_module_state->__pyx_int_291);
  Py_CLEAR(clear_module_state->__pyx_int_292);
  Py_CLEAR(clear_module_state->__pyx_int_293);
  Py_CLEAR(clear_module_state->__pyx_int_294);
  Py_CLEAR(clear_module_state->__pyx_int_295);
  Py_CLEAR(clear_module_state->__pyx_int_296);
  Py_CLEAR(clear_module_state->__pyx_int_297);
  Py_CLEAR(clear_module_state->__pyx_int_298);
  Py_CLEAR(clear_module_state->__pyx_int_299);
  Py_CLEAR(clear_module_state->__pyx_int_300);
  Py_CLEAR(clear_module_state->__pyx_int_301);
  Py_CLEAR(clear_module_state->__pyx_int_302);
  Py_CLEAR(clear_module_state->__pyx_int_303);
  Py_CLEAR(clear_module_state->__pyx_int_304);
  Py_CLEAR(clear_module_state->__pyx_int_305);
  Py_CLEAR(clear_module_state->__pyx_int_306);
  Py_CLEAR(clear_module_state->__pyx_int_307);
  Py_CLEAR(clear_module_state->__pyx_int_308);
  Py_CLEAR(clear_module_state->__pyx_int_309);
  Py_CLEAR(clear_module_state->__pyx_int_310);
  Py_CLEAR(clear_module_state->__pyx_int_311);
  Py_CLEAR(clear_module_state->__pyx_int_312);
  Py_CLEAR(clear_module_state->__pyx_int_313);
  Py_CLEAR(clear_module_state->__pyx_int_314);
  Py_CLEAR(clear_module_state->__pyx_int_315);
  Py_CLEAR(clear_module_state->__pyx_int_316);
  Py_CLEAR(clear_module_state->__pyx_int_317);
  Py_CLEAR(clear_module_state->__pyx_int_318);
  Py_CLEAR(clear_module_state->__pyx_int_319);
  Py_CLEAR(clear_module_state->__pyx_int_320);
  Py_CLEAR(clear_module_state->__pyx_int_321);
  Py_CLEAR(clear_module_state->__pyx_int_322);
  Py_CLEAR(clear_module_state->__pyx_int_323);
  Py_CLEAR(clear_module_state->__pyx_int_324);
  Py_CLEAR(clear_module_state->__pyx_int_325);
  Py_CLEAR(clear_module_state->__pyx_int_326);
  Py_CLEAR(clear_module_state->__pyx_int_327);
  Py_CLEAR(clear_module_state->__pyx_int_328);
  Py_CLEAR(clear_module_state->__pyx_int_329);
  Py_CLEAR(clear_module_state->__pyx_int_330);
  Py_CLEAR(clear_module_state->__pyx_int_331);
  Py_CLEAR(clear_module_state->__pyx_int_332);
  Py_CLEAR(clear_module_state->__pyx_int_333);
  Py_CLEAR(clear_module_state->__pyx_int_334);
  Py_CLEAR(clear_module_state->__pyx_int_335);
  Py_CLEAR(clear_module_state->__pyx_int_336);
  Py_CLEAR(clear_module_state->__pyx_int_337);
  Py_CLEAR(clear_module_state->__pyx_int_338);
  Py_CLEAR(clear_module_state->__pyx_int_339);
  Py_CLEAR(clear_module_state->__pyx_int_340);
  Py_CLEAR(clear_module_state->__pyx_int_341);
  Py_CLEAR(clear_module_state->__pyx_int_342);
  Py_CLEAR(clear_module_state->__pyx_int_343);
  Py_CLEAR(clear_module_state->__pyx_int_344);
  Py_CLEAR(clear_module_state->__pyx_int_345);
  Py_CLEAR(clear_module_state->__pyx_int_346);
  Py_CLEAR(clear_module_state->__pyx_int_347);
  Py_CLEAR(clear_module_state->__pyx_int_348);
  Py_CLEAR(clear_module_state->__pyx_int_349);
  Py_CLEAR(clear_module_state->__pyx_int_350);
  Py_CLEAR(clear_module_state->__pyx_int_351);
  Py_CLEAR(clear_module_state->__pyx_int_352);
  Py_CLEAR(clear_module_state->__pyx_int_353);
  Py_CLEAR(clear_module_state->__pyx_int_354);
  Py_CLEAR(clear_module_state->__pyx_int_355);
  Py_CLEAR(clear_module_state->__pyx_int_356);
  Py_CLEAR(clear_module_state->__pyx_int_357);
  Py_CLEAR(clear_module_state->__pyx_int_358);
  Py_CLEAR(clear_module_state->__pyx_int_359);
  Py_CLEAR(clear_module_state->__pyx_int_360);
  Py_CLEAR(clear_module_state->__pyx_int_361);
  Py_CLEAR(clear_module_state->__pyx_int_362);
  Py_CLEAR(clear_module_state->__pyx_int_363);
  Py_CLEAR(clear_module_state->__pyx_int_364);
  Py_CLEAR(clear_module_state->__pyx_int_365);
  Py_CLEAR(clear_module_state->__pyx_int_366);
  Py_CLEAR(clear_module_state->__pyx_int_367);
  Py_CLEAR(clear_module_state->__pyx_int_368);
  Py_CLEAR(clear_module_state->__pyx_int_369);
  Py_CLEAR(clear_module_state->__pyx_int_370);
  Py_CLEAR(clear_module_state->__pyx_int_371);
  Py_CLEAR(clear_module_state->__pyx_int_372);
  Py_CLEAR(clear_module_state->__pyx_int_373);
  Py_CLEAR(clear_module_state->__pyx_int_374);
  Py_CLEAR(clear_module_state->__pyx_int_375);
  Py_CLEAR(clear_module_state->__pyx_int_376);
  Py_CLEAR(clear_module_state->__pyx_int_377);
  Py_CLEAR(clear_module_state->__pyx_int_378);
  Py_CLEAR(clear_module_state->__pyx_int_379);
  Py_CLEAR(clear_module_state->__pyx_int_380);
  Py_CLEAR(clear_module_state->__pyx_int_381);
  Py_CLEAR(clear_module_state->__pyx_int_382);
  Py_CLEAR(clear_module_state->__pyx_int_383);
  Py_CLEAR(clear_module_state->__pyx_int_384);
  Py_CLEAR(clear_module_state->__pyx_int_385);
  Py_CLEAR(clear_module_state->__pyx_int_386);
  Py_CLEAR(clear_module_state->__pyx_int_387);
  Py_CLEAR(clear_module_state->__pyx_int_388);
  Py_CLEAR(clear_module_state->__pyx_int_389);
  Py_CLEAR(clear_module_state->__pyx_int_390);
  Py_CLEAR(clear_module_state->__pyx_int_391);
  Py_CLEAR(clear_module_state->__pyx_int_392);
  Py_CLEAR(clear_module_state->__pyx_int_393);
  Py_CLEAR(clear_module_state->__pyx_int_394);
  Py_CLEAR(clear_module_state->__pyx_int_395);
  Py_CLEAR(clear_module_state->__pyx_int_396);
  Py_CLEAR(clear_module_state->__pyx_int_397);
  Py_CLEAR(clear_module_state->__pyx_int_398);
  Py_CLEAR(clear_module_state->__pyx_int_399);
  Py_CLEAR(clear_module_state->__pyx_int_400);
  Py_CLEAR(clear_module_state->__pyx_int_401);
  Py_CLEAR(clear_module_state->__pyx_int_402);
  Py_CLEAR(clear_module_state->__pyx_int_403);
  Py_CLEAR(clear_module_state->__pyx_int_404);
  Py_CLEAR(clear_module_state->__pyx_int_405);
  Py_CLEAR(clear_module_state->__pyx_int_406);
  Py_CLEAR(clear_module_state->__pyx_int_407);
  Py_CLEAR(clear_module_state->__pyx_int_408);
  Py_CLEAR(clear_module_state->__pyx_int_409);
  Py_CLEAR(clear_module_state->__pyx_int_410);
  Py_CLEAR(clear_module_state->__pyx_int_411);
  Py_CLEAR(clear_module_state->__pyx_int_412);
  Py_CLEAR(clear_module_state->__pyx_int_413);
  Py_CLEAR(clear_module_state->__pyx_int_414);
  Py_CLEAR(clear_module_state->__pyx_int_552);
  Py_CLEAR(clear_module_state->__pyx_int_887);
  Py_CLEAR(clear_module_state->__pyx_int_888);
  Py_CLEAR(clear_module_state->__pyx_int_962);
  Py_CLEAR(clear_module_state->__pyx_int_1260);
  Py_CLEAR(clear_module_state->__pyx_int_1288);
  Py_CLEAR(clear_module_state->__pyx_int_3552);
  Py_CLEAR(clear_module_state->__pyx_int_4878);
  Py_CLEAR(clear_module_state->__pyx_int_5110);
  Py_CLEAR(clear_module_state->__pyx_int_10000);
  Py_CLEAR(clear_module_state->__pyx_int_11031);
  Py_CLEAR(clear_module_state->__pyx_int_12846);
  Py_CLEAR(clear_module_state->__pyx_int_17661);
  Py_CLEAR(clear_module_state->__pyx_int_19536);
  Py_CLEAR(clear_module_state->__pyx_int_27436);
  Py_CLEAR(clear_module_state->__pyx_int_32768);
  Py_CLEAR(clear_module_state->__pyx_int_85263);
  Py_CLEAR(clear_module_state->__pyx_int_168030);
  Py_CLEAR(clear_module_state->__pyx_int_379799);
  Py_CLEAR(clear_module_state->__pyx_int_1008906);
  Py_CLEAR(clear_module_state->__pyx_int_60959262);
  Py_CLEAR(clear_module_state->__pyx_int_64961464);
  Py_CLEAR(clear_module_state->__pyx_int_94173347);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_int_neg_3);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  #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_8SnapPyHP_Triangulation);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_Triangulation);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_Manifold);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_Manifold);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_AbelianGroup);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_AbelianGroup);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_PresentationMatrix);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_PresentationMatrix);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_CFundamentalGroup);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_CFundamentalGroup);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_CHolonomyGroup);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_CHolonomyGroup);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_SymmetryGroup);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_SymmetryGroup);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_CDirichletDomain);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_CDirichletDomain);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP_CCuspNeighborhood);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP_CCuspNeighborhood);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_defaults);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_defaults);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr);
  Py_VISIT(traverse_module_state->__pyx_k__29);
  Py_VISIT(traverse_module_state->__pyx_k__31);
  Py_VISIT(traverse_module_state->__pyx_k__38);
  for (int i=0; i<6; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<79; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<311; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<2034; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_2);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_9);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1eneg_9);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_2);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_3);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_4);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_5);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_6);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_7);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_8);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_9);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_10);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_11);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_12);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_13);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_14);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_15);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_16);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_17);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_18);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_19);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_20);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_21);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_22);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_23);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_24);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_25);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_26);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_27);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_28);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_29);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_30);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_31);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_32);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_33);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_34);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_35);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_36);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_37);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_38);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_39);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_40);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_41);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_42);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_43);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_44);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_45);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_46);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_47);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_48);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_49);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_50);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_51);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_52);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_53);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_54);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_55);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_56);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_57);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_58);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_59);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_60);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_61);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_62);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_63);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_64);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_65);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_66);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_67);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_68);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_69);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_70);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_71);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_72);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_73);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_74);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_75);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_76);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_77);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_78);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_79);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_80);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_81);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_82);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_83);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_84);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_85);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_86);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_87);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_88);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_89);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_90);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_91);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_92);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_93);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_94);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_95);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_96);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_97);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_98);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_99);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_100);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_101);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_102);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_103);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_104);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_105);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_106);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_107);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_108);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_109);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_110);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_111);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_112);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_113);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_114);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_115);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_116);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_117);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_118);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_119);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_120);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_121);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_122);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_123);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_124);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_125);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_126);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_127);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_128);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_129);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_130);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_131);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_132);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_133);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_134);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_135);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_136);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_137);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_138);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_139);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_140);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_141);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_142);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_143);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_144);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_145);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_146);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_147);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_148);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_149);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_150);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_151);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_152);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_153);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_154);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_155);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_156);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_157);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_158);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_159);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_160);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_161);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_162);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_163);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_164);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_165);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_166);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_167);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_168);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_169);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_170);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_171);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_172);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_173);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_174);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_175);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_176);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_177);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_178);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_179);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_180);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_181);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_182);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_183);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_184);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_185);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_186);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_187);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_188);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_189);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_190);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_191);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_192);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_193);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_194);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_195);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_196);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_197);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_198);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_199);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_200);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_201);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_202);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_203);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_204);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_205);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_206);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_207);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_208);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_209);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_210);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_211);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_212);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_213);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_214);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_215);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_216);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_217);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_218);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_219);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_220);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_221);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_222);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_223);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_224);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_225);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_226);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_227);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_228);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_229);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_230);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_231);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_232);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_233);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_234);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_235);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_236);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_237);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_238);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_239);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_240);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_241);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_242);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_243);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_244);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_245);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_246);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_247);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_248);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_249);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_250);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_251);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_252);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_253);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_254);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_255);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_256);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_257);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_258);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_259);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_260);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_261);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_262);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_263);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_264);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_265);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_266);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_267);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_268);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_269);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_270);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_271);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_272);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_273);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_274);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_275);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_276);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_277);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_278);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_279);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_280);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_281);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_282);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_283);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_284);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_285);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_286);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_287);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_288);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_289);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_290);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_291);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_292);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_293);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_294);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_295);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_296);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_297);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_298);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_299);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_300);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_301);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_302);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_303);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_304);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_305);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_306);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_307);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_308);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_309);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_310);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_311);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_312);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_313);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_314);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_315);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_316);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_317);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_318);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_319);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_320);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_321);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_322);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_323);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_324);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_325);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_326);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_327);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_328);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_329);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_330);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_331);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_332);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_333);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_334);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_335);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_336);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_337);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_338);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_339);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_340);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_341);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_342);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_343);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_344);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_345);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_346);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_347);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_348);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_349);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_350);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_351);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_352);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_353);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_354);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_355);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_356);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_357);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_358);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_359);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_360);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_361);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_362);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_363);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_364);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_365);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_366);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_367);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_368);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_369);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_370);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_371);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_372);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_373);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_374);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_375);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_376);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_377);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_378);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_379);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_380);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_381);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_382);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_383);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_384);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_385);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_386);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_387);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_388);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_389);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_390);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_391);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_392);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_393);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_394);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_395);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_396);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_397);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_398);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_399);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_400);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_401);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_402);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_403);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_404);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_405);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_406);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_407);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_408);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_409);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_410);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_411);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_412);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_413);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_414);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_552);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_887);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_888);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_962);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1260);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1288);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_3552);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_4878);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_5110);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_10000);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_11031);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_12846);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_17661);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_19536);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_27436);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_32768);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_85263);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_168030);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_379799);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1008906);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_60959262);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_64961464);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_94173347);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_3);
  return 0;
}
#endif
/* #### Code section: module_code ### */
int SnapPy_test_flag;
Boolean gLongComputationInProgress;
Boolean gLongComputationCancelled;
PyObject *gLongComputationTicker = 0;

/* "cython/numbers/qd.pyx":35
 *         void write(char *s, int len, int precision)
 * 
 * cdef real_to_string(Real x):             # <<<<<<<<<<<<<<
 *     cdef char buffer[128]
 *     x.write(buffer, 128, 64)
*/

static PyObject *__pyx_f_8SnapPyHP_real_to_string(__pyx_t_8SnapPyHP_Real __pyx_v_x) {
  char __pyx_v_buffer[0x80];
  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("real_to_string", 0);

  /* "cython/numbers/qd.pyx":37
 * cdef real_to_string(Real x):
 *     cdef char buffer[128]
 *     x.write(buffer, 128, 64)             # <<<<<<<<<<<<<<
 *     return buffer  # this should return a python string
 * 
*/
  __pyx_v_x.write(__pyx_v_buffer, 0x80, 64);

  /* "cython/numbers/qd.pyx":38
 *     cdef char buffer[128]
 *     x.write(buffer, 128, 64)
 *     return buffer  # this should return a python string             # <<<<<<<<<<<<<<
 * 
 * cdef Real2gen_direct(Real R):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/numbers/qd.pyx":35
 *         void write(char *s, int len, int precision)
 * 
 * cdef real_to_string(Real x):             # <<<<<<<<<<<<<<
 *     cdef char buffer[128]
 *     x.write(buffer, 128, 64)
*/

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

/* "cython/numbers/qd.pyx":40
 *     return buffer  # this should return a python string
 * 
 * cdef Real2gen_direct(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a pari gen of type t_REAL.  This constructs the gen
*/

static PyObject *__pyx_f_8SnapPyHP_Real2gen_direct(__pyx_t_8SnapPyHP_Real __pyx_v_R) {
  double *__pyx_v_qd;
  int __pyx_v_i;
  PyObject *__pyx_v_result = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Real2gen_direct", 0);

  /* "cython/numbers/qd.pyx":51
 * 
 *     """
 *     cdef double* qd = <double*>&R             # <<<<<<<<<<<<<<
 *     cdef int i
 *     # The value of a qd_real is the sum of the values of its four doubles.
*/
  __pyx_v_qd = ((double *)(&__pyx_v_R));

  /* "cython/numbers/qd.pyx":54
 *     cdef int i
 *     # The value of a qd_real is the sum of the values of its four doubles.
 *     result = pari._real_coerced_to_bits_prec(qd[0], 256)             # <<<<<<<<<<<<<<
 *     for i in range(1,4):
 *         result += pari._real_coerced_to_bits_prec(qd[i], 256)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_real_coerced_to_bits_prec); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble((__pyx_v_qd[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_int_256};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/numbers/qd.pyx":55
 *     # The value of a qd_real is the sum of the values of its four doubles.
 *     result = pari._real_coerced_to_bits_prec(qd[0], 256)
 *     for i in range(1,4):             # <<<<<<<<<<<<<<
 *         result += pari._real_coerced_to_bits_prec(qd[i], 256)
 *     return result
*/
  for (__pyx_t_6 = 1; __pyx_t_6 < 4; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cython/numbers/qd.pyx":56
 *     result = pari._real_coerced_to_bits_prec(qd[0], 256)
 *     for i in range(1,4):
 *         result += pari._real_coerced_to_bits_prec(qd[i], 256)             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_real_coerced_to_bits_prec); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyFloat_FromDouble((__pyx_v_qd[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_int_256};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "cython/numbers/qd.pyx":57
 *     for i in range(1,4):
 *         result += pari._real_coerced_to_bits_prec(qd[i], 256)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef Real2gen_string(Real R):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/numbers/qd.pyx":40
 *     return buffer  # this should return a python string
 * 
 * cdef Real2gen_direct(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a pari gen of type t_REAL.  This constructs the gen
*/

  /* 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("SnapPyHP.Real2gen_direct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/numbers/qd.pyx":59
 *     return result
 * 
 * cdef Real2gen_string(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a pari gen of type t_REAL.
*/

static PyObject *__pyx_f_8SnapPyHP_Real2gen_string(__pyx_t_8SnapPyHP_Real __pyx_v_R) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Real2gen_string", 0);

  /* "cython/numbers/qd.pyx":64
 *     This constructs the gen from the string representation of the real.
 *     """
 *     return pari(real_to_string(R))             # <<<<<<<<<<<<<<
 * 
 * cdef Complex gen2Complex(g):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8SnapPyHP_real_to_string(__pyx_v_R); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/numbers/qd.pyx":59
 *     return result
 * 
 * cdef Real2gen_string(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a pari gen of type t_REAL.
*/

  /* 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("SnapPyHP.Real2gen_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/numbers/qd.pyx":66
 *     return pari(real_to_string(R))
 * 
 * cdef Complex gen2Complex(g):             # <<<<<<<<<<<<<<
 *     cdef Complex result
 *     cdef py_string
*/

static Complex __pyx_f_8SnapPyHP_gen2Complex(PyObject *__pyx_v_g) {
  Complex __pyx_v_result;
  PyObject *__pyx_v_py_string = 0;
  char *__pyx_v_c_string;
  __pyx_t_8SnapPyHP_Real __pyx_v_real_part;
  __pyx_t_8SnapPyHP_Real __pyx_v_imag_part;
  PyObject *__pyx_v_old_precision = NULL;
  Complex __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  __pyx_t_8SnapPyHP_Real __pyx_t_8;
  __pyx_t_8SnapPyHP_Real __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gen2Complex", 0);

  /* "cython/numbers/qd.pyx":71
 *     cdef char* c_string
 *     cdef Real real_part, imag_part
 *     old_precision = pari.set_real_precision(64)             # <<<<<<<<<<<<<<
 * 
 *     py_string = to_byte_str(str(g.real()).replace(' E','E'))  # save a reference
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_real_precision); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_64};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_old_precision = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/numbers/qd.pyx":73
 *     old_precision = pari.set_real_precision(64)
 * 
 *     py_string = to_byte_str(str(g.real()).replace(' E','E'))  # save a reference             # <<<<<<<<<<<<<<
 *     c_string = py_string
 *     real_part = <Real>c_string
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __pyx_v_g;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_real, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyUnicode_Replace(((PyObject*)__pyx_t_6), __pyx_mstate_global->__pyx_kp_u_E, __pyx_mstate_global->__pyx_n_u_E_2, -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_py_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/numbers/qd.pyx":74
 * 
 *     py_string = to_byte_str(str(g.real()).replace(' E','E'))  # save a reference
 *     c_string = py_string             # <<<<<<<<<<<<<<
 *     real_part = <Real>c_string
 *     py_string = to_byte_str(str(g.imag()).replace(' E','E'))  # save a reference
*/
  __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_py_string); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(6, 74, __pyx_L1_error)
  __pyx_v_c_string = __pyx_t_7;

  /* "cython/numbers/qd.pyx":75
 *     py_string = to_byte_str(str(g.real()).replace(' E','E'))  # save a reference
 *     c_string = py_string
 *     real_part = <Real>c_string             # <<<<<<<<<<<<<<
 *     py_string = to_byte_str(str(g.imag()).replace(' E','E'))  # save a reference
 *     c_string = py_string
*/
  __pyx_v_real_part = ((__pyx_t_8SnapPyHP_Real)__pyx_v_c_string);

  /* "cython/numbers/qd.pyx":76
 *     c_string = py_string
 *     real_part = <Real>c_string
 *     py_string = to_byte_str(str(g.imag()).replace(' E','E'))  # save a reference             # <<<<<<<<<<<<<<
 *     c_string = py_string
 *     imag_part = <Real>c_string
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __pyx_v_g;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_imag, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyUnicode_Replace(((PyObject*)__pyx_t_6), __pyx_mstate_global->__pyx_kp_u_E, __pyx_mstate_global->__pyx_n_u_E_2, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_py_string, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/numbers/qd.pyx":77
 *     real_part = <Real>c_string
 *     py_string = to_byte_str(str(g.imag()).replace(' E','E'))  # save a reference
 *     c_string = py_string             # <<<<<<<<<<<<<<
 *     imag_part = <Real>c_string
 *     result.real, result.imag = real_part, imag_part
*/
  __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_py_string); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(6, 77, __pyx_L1_error)
  __pyx_v_c_string = __pyx_t_7;

  /* "cython/numbers/qd.pyx":78
 *     py_string = to_byte_str(str(g.imag()).replace(' E','E'))  # save a reference
 *     c_string = py_string
 *     imag_part = <Real>c_string             # <<<<<<<<<<<<<<
 *     result.real, result.imag = real_part, imag_part
 * 
*/
  __pyx_v_imag_part = ((__pyx_t_8SnapPyHP_Real)__pyx_v_c_string);

  /* "cython/numbers/qd.pyx":79
 *     c_string = py_string
 *     imag_part = <Real>c_string
 *     result.real, result.imag = real_part, imag_part             # <<<<<<<<<<<<<<
 * 
 *     pari.set_real_precision(old_precision)
*/
  __pyx_t_8 = __pyx_v_real_part;
  __pyx_t_9 = __pyx_v_imag_part;
  __pyx_v_result.real = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);
  __pyx_v_result.imag = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

  /* "cython/numbers/qd.pyx":81
 *     result.real, result.imag = real_part, imag_part
 * 
 *     pari.set_real_precision(old_precision)             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_set_real_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_old_precision};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/numbers/qd.pyx":82
 * 
 *     pari.set_real_precision(old_precision)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef Real2Number(Real R):
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/numbers/qd.pyx":66
 *     return pari(real_to_string(R))
 * 
 * cdef Complex gen2Complex(g):             # <<<<<<<<<<<<<<
 *     cdef Complex result
 *     cdef py_string
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.gen2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_string);
  __Pyx_XDECREF(__pyx_v_old_precision);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/numbers/qd.pyx":84
 *     return result
 * 
 * cdef Real2Number(Real R):             # <<<<<<<<<<<<<<
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):
*/

static PyObject *__pyx_f_8SnapPyHP_Real2Number(__pyx_t_8SnapPyHP_Real __pyx_v_R) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Real2Number", 0);

  /* "cython/numbers/qd.pyx":85
 * 
 * cdef Real2Number(Real R):
 *     return Number(Real2gen(R))             # <<<<<<<<<<<<<<
 * cdef Complex2Number(Complex C):
 *     return Number(Complex2gen(C))
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_v_8SnapPyHP_Real2gen(__pyx_v_R); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/numbers/qd.pyx":84
 *     return result
 * 
 * cdef Real2Number(Real R):             # <<<<<<<<<<<<<<
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):
*/

  /* 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("SnapPyHP.Real2Number", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/numbers/qd.pyx":86
 * cdef Real2Number(Real R):
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):             # <<<<<<<<<<<<<<
 *     return Number(Complex2gen(C))
*/

static PyObject *__pyx_f_8SnapPyHP_Complex2Number(Complex __pyx_v_C) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Complex2Number", 0);

  /* "cython/numbers/qd.pyx":87
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):
 *     return Number(Complex2gen(C))             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8SnapPyHP_Complex2gen(__pyx_v_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/numbers/qd.pyx":86
 * cdef Real2Number(Real R):
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):             # <<<<<<<<<<<<<<
 *     return Number(Complex2gen(C))
*/

  /* 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("SnapPyHP.Complex2Number", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":31
 *         from sage.interfaces.abc import GapElement, MagmaElement
 * 
 *         def is_GapElement(elt):             # <<<<<<<<<<<<<<
 *             return isinstance(elt, GapElement)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_1is_GapElement(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_8SnapPyHP_1is_GapElement = {"is_GapElement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_1is_GapElement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_1is_GapElement(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_elt = 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_GapElement (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 31, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 31, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_GapElement", 0) < 0) __PYX_ERR(1, 31, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_GapElement", 1, 1, 1, i); __PYX_ERR(1, 31, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 31, __pyx_L3_error)
    }
    __pyx_v_elt = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_GapElement", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 31, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.is_GapElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_is_GapElement(__pyx_self, __pyx_v_elt);

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

static PyObject *__pyx_pf_8SnapPyHP_is_GapElement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_elt) {
  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("is_GapElement", 0);

  /* "cython/core/basic.pyx":32
 * 
 *         def is_GapElement(elt):
 *             return isinstance(elt, GapElement)             # <<<<<<<<<<<<<<
 * 
 *         def is_MagmaElement(elt):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_GapElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_elt, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 32, __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(1, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":31
 *         from sage.interfaces.abc import GapElement, MagmaElement
 * 
 *         def is_GapElement(elt):             # <<<<<<<<<<<<<<
 *             return isinstance(elt, GapElement)
 * 
*/

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

/* "cython/core/basic.pyx":34
 *             return isinstance(elt, GapElement)
 * 
 *         def is_MagmaElement(elt):             # <<<<<<<<<<<<<<
 *             return isinstance(elt, MagmaElement)
 *     except:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_3is_MagmaElement(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_8SnapPyHP_3is_MagmaElement = {"is_MagmaElement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_3is_MagmaElement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_3is_MagmaElement(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_elt = 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_MagmaElement (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 34, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 34, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_MagmaElement", 0) < 0) __PYX_ERR(1, 34, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_MagmaElement", 1, 1, 1, i); __PYX_ERR(1, 34, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 34, __pyx_L3_error)
    }
    __pyx_v_elt = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_MagmaElement", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 34, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.is_MagmaElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_2is_MagmaElement(__pyx_self, __pyx_v_elt);

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

static PyObject *__pyx_pf_8SnapPyHP_2is_MagmaElement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_elt) {
  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("is_MagmaElement", 0);

  /* "cython/core/basic.pyx":35
 * 
 *         def is_MagmaElement(elt):
 *             return isinstance(elt, MagmaElement)             # <<<<<<<<<<<<<<
 *     except:
 *         from sage.interfaces.gap import is_GapElement
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MagmaElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_elt, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 35, __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(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":34
 *             return isinstance(elt, GapElement)
 * 
 *         def is_MagmaElement(elt):             # <<<<<<<<<<<<<<
 *             return isinstance(elt, MagmaElement)
 *     except:
*/

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

/* "cython/core/basic.pyx":85
 *     asksaveasfile = None
 * 
 * def valid_index(i, n, format_str):             # <<<<<<<<<<<<<<
 *     """
 *     Return range(n)[i] or raises a nicely formatted IndexError
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_5valid_index(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_8SnapPyHP_4valid_index, "\n    Return range(n)[i] or raises a nicely formatted IndexError\n    using format_str.\n\n    This does several things for us::\n\n        * avoid that cython happily converts a float to an int, so a call\n          such as M.dehn_fill((1,0), 0.6) would succeed.\n        * converts a negative index such as -1 to n - 1\n        * checks that i is in the right range\n        * supports Sage and numpy Integers: they are not python int's but\n          have __index__ (see PEP 357)\n\n    It is faster than reimplementing these behaviors.\n    ");
static PyMethodDef __pyx_mdef_8SnapPyHP_5valid_index = {"valid_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_5valid_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_4valid_index};
static PyObject *__pyx_pw_8SnapPyHP_5valid_index(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_i = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_v_format_str = 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("valid_index (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_format_str,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 85, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 85, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 85, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 85, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "valid_index", 0) < 0) __PYX_ERR(1, 85, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("valid_index", 1, 3, 3, i); __PYX_ERR(1, 85, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 85, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 85, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 85, __pyx_L3_error)
    }
    __pyx_v_i = values[0];
    __pyx_v_n = values[1];
    __pyx_v_format_str = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("valid_index", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 85, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.valid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_4valid_index(__pyx_self, __pyx_v_i, __pyx_v_n, __pyx_v_format_str);

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

static PyObject *__pyx_pf_8SnapPyHP_4valid_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i, PyObject *__pyx_v_n, PyObject *__pyx_v_format_str) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  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("valid_index", 0);

  /* "cython/core/basic.pyx":101
 *     It is faster than reimplementing these behaviors.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return range(n)[i]
 *     except IndexError:
*/
  {
    __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:*/ {

      /* "cython/core/basic.pyx":102
 *     """
 *     try:
 *         return range(n)[i]             # <<<<<<<<<<<<<<
 *     except IndexError:
 *         raise IndexError(format_str % i)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_6 = __pyx_builtin_range; 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_n};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __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(1, 102, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 102, __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;

      /* "cython/core/basic.pyx":101
 *     It is faster than reimplementing these behaviors.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return range(n)[i]
 *     except IndexError:
*/
    }
    __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;

    /* "cython/core/basic.pyx":103
 *     try:
 *         return range(n)[i]
 *     except IndexError:             # <<<<<<<<<<<<<<
 *         raise IndexError(format_str % i)
 * 
*/
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("SnapPyHP.valid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(1, 103, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "cython/core/basic.pyx":104
 *         return range(n)[i]
 *     except IndexError:
 *         raise IndexError(format_str % i)             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_builtin_IndexError);
      __pyx_t_11 = __pyx_builtin_IndexError; 
      __pyx_t_12 = PyNumber_Remainder(__pyx_v_format_str, __pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 104, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 104, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 104, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "cython/core/basic.pyx":101
 *     It is faster than reimplementing these behaviors.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return range(n)[i]
 *     except IndexError:
*/
    __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;
  }

  /* "cython/core/basic.pyx":85
 *     asksaveasfile = None
 * 
 * def valid_index(i, n, format_str):             # <<<<<<<<<<<<<<
 *     """
 *     Return range(n)[i] or raises a nicely formatted IndexError
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.valid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":109
 * # A stream for asynchronous messages
 * class MsgIO():
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         if sys.stdout is None:
 *             self.write = None
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_5MsgIO_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_5MsgIO_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_5MsgIO_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_5MsgIO_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 109, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(1, 109, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 109, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 109, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 109, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.MsgIO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_5MsgIO___init__(__pyx_self, __pyx_v_self);

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

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

  /* "cython/core/basic.pyx":110
 * class MsgIO():
 *     def __init__(self):
 *         if sys.stdout is None:             # <<<<<<<<<<<<<<
 *             self.write = None
 *             self.flush = None
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cython/core/basic.pyx":111
 *     def __init__(self):
 *         if sys.stdout is None:
 *             self.write = None             # <<<<<<<<<<<<<<
 *             self.flush = None
 *         else:
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_write, Py_None) < 0) __PYX_ERR(1, 111, __pyx_L1_error)

    /* "cython/core/basic.pyx":112
 *         if sys.stdout is None:
 *             self.write = None
 *             self.flush = None             # <<<<<<<<<<<<<<
 *         else:
 *             self.write = sys.stdout.write
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_flush, Py_None) < 0) __PYX_ERR(1, 112, __pyx_L1_error)

    /* "cython/core/basic.pyx":110
 * class MsgIO():
 *     def __init__(self):
 *         if sys.stdout is None:             # <<<<<<<<<<<<<<
 *             self.write = None
 *             self.flush = None
*/
    goto __pyx_L3;
  }

  /* "cython/core/basic.pyx":114
 *             self.flush = None
 *         else:
 *             self.write = sys.stdout.write             # <<<<<<<<<<<<<<
 *             self.flush = sys.stdout.flush
 * 
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_2) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":115
 *         else:
 *             self.write = sys.stdout.write
 *             self.flush = sys.stdout.flush             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_flush); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_flush, __pyx_t_2) < 0) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cython/core/basic.pyx":109
 * # A stream for asynchronous messages
 * class MsgIO():
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         if sys.stdout is None:
 *             self.write = None
*/

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

/* "cython/core/basic.pyx":121
 * 
 * 
 * def to_str(s):             # <<<<<<<<<<<<<<
 *     return s.decode()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_7to_str(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_8SnapPyHP_7to_str = {"to_str", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_7to_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_7to_str(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_s = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_str (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 121, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 121, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_str", 0) < 0) __PYX_ERR(1, 121, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_str", 1, 1, 1, i); __PYX_ERR(1, 121, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 121, __pyx_L3_error)
    }
    __pyx_v_s = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_str", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 121, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_6to_str(__pyx_self, __pyx_v_s);

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

static PyObject *__pyx_pf_8SnapPyHP_6to_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_str", 0);

  /* "cython/core/basic.pyx":122
 * 
 * def to_str(s):
 *     return s.decode()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_s;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":121
 * 
 * 
 * def to_str(s):             # <<<<<<<<<<<<<<
 *     return s.decode()
 * 
*/

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

/* "cython/core/basic.pyx":125
 * 
 * 
 * def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *     return bytes(x)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_9bytearray_to_bytes(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_8SnapPyHP_9bytearray_to_bytes = {"bytearray_to_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_9bytearray_to_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_9bytearray_to_bytes(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;
  #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("bytearray_to_bytes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 125, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 125, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bytearray_to_bytes", 0) < 0) __PYX_ERR(1, 125, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bytearray_to_bytes", 1, 1, 1, i); __PYX_ERR(1, 125, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 125, __pyx_L3_error)
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bytearray_to_bytes", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 125, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.bytearray_to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8bytearray_to_bytes(__pyx_self, __pyx_v_x);

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

static PyObject *__pyx_pf_8SnapPyHP_8bytearray_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bytearray_to_bytes", 0);

  /* "cython/core/basic.pyx":126
 * 
 * def bytearray_to_bytes(x):
 *     return bytes(x)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)(&PyBytes_Type));
  __pyx_t_3 = ((PyObject *)(&PyBytes_Type)); 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_x};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":125
 * 
 * 
 * def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *     return bytes(x)
 * 
*/

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

/* "cython/core/basic.pyx":129
 * 
 * 
 * def to_byte_str(s):             # <<<<<<<<<<<<<<
 *     return s.encode('utf-8') if type(s) != bytes else s
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_11to_byte_str(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_8SnapPyHP_11to_byte_str = {"to_byte_str", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_11to_byte_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_11to_byte_str(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_s = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_byte_str (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 129, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_byte_str", 0) < 0) __PYX_ERR(1, 129, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_byte_str", 1, 1, 1, i); __PYX_ERR(1, 129, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 129, __pyx_L3_error)
    }
    __pyx_v_s = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_byte_str", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 129, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.to_byte_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_10to_byte_str(__pyx_self, __pyx_v_s);

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

static PyObject *__pyx_pf_8SnapPyHP_10to_byte_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_byte_str", 0);

  /* "cython/core/basic.pyx":130
 * 
 * def to_byte_str(s):
 *     return s.encode('utf-8') if type(s) != bytes else s             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_s)), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_4 = __pyx_v_s;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_utf_8};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_s);
    __pyx_t_1 = __pyx_v_s;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":129
 * 
 * 
 * def to_byte_str(s):             # <<<<<<<<<<<<<<
 *     return s.encode('utf-8') if type(s) != bytes else s
 * 
*/

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

/* "cython/core/basic.pyx":159
 * 
 * 
 * def set_test_flag(int value):             # <<<<<<<<<<<<<<
 *     cdef int old
 *     global SnapPy_test_flag
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13set_test_flag(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_8SnapPyHP_13set_test_flag = {"set_test_flag", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13set_test_flag, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13set_test_flag(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
) {
  int __pyx_v_value;
  #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_test_flag (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 159, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 159, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_test_flag", 0) < 0) __PYX_ERR(1, 159, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_test_flag", 1, 1, 1, i); __PYX_ERR(1, 159, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 159, __pyx_L3_error)
    }
    __pyx_v_value = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_test_flag", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 159, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.set_test_flag", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_12set_test_flag(__pyx_self, __pyx_v_value);

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

static PyObject *__pyx_pf_8SnapPyHP_12set_test_flag(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_value) {
  int __pyx_v_old;
  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("set_test_flag", 0);

  /* "cython/core/basic.pyx":162
 *     cdef int old
 *     global SnapPy_test_flag
 *     old = SnapPy_test_flag             # <<<<<<<<<<<<<<
 *     SnapPy_test_flag = value
 *     return old
*/
  __pyx_v_old = SnapPy_test_flag;

  /* "cython/core/basic.pyx":163
 *     global SnapPy_test_flag
 *     old = SnapPy_test_flag
 *     SnapPy_test_flag = value             # <<<<<<<<<<<<<<
 *     return old
 * 
*/
  SnapPy_test_flag = __pyx_v_value;

  /* "cython/core/basic.pyx":164
 *     old = SnapPy_test_flag
 *     SnapPy_test_flag = value
 *     return old             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":159
 * 
 * 
 * def set_test_flag(int value):             # <<<<<<<<<<<<<<
 *     cdef int old
 *     global SnapPy_test_flag
*/

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

/* "cython/core/basic.pyx":168
 * 
 * # Implementation of the SnapPea UI functions and their global variables.
 * cdef public void uFatalError(const_char_ptr function,             # <<<<<<<<<<<<<<
 *                              const_char_ptr file) except *:
 *     # Only raise exception the first time so that we see the first
*/

void uFatalError(const char* __pyx_v_function, const char* __pyx_v_file) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[5];
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uFatalError", 0);

  /* "cython/core/basic.pyx":172
 *     # Only raise exception the first time so that we see the first
 *     # uFatalError which is usually the root cause of the problem.
 *     if not PyErr_Occurred():             # <<<<<<<<<<<<<<
 *         raise SnapPeaFatalError('SnapPea crashed in function %s(), '
 *                                 'defined in %s.c.' % (function, file))
*/
  __pyx_t_1 = (!(PyErr_Occurred() != 0));
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/basic.pyx":173
 *     # uFatalError which is usually the root cause of the problem.
 *     if not PyErr_Occurred():
 *         raise SnapPeaFatalError('SnapPea crashed in function %s(), '             # <<<<<<<<<<<<<<
 *                                 'defined in %s.c.' % (function, file))
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SnapPeaFatalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/basic.pyx":174
 *     if not PyErr_Occurred():
 *         raise SnapPeaFatalError('SnapPea crashed in function %s(), '
 *                                 'defined in %s.c.' % (function, file))             # <<<<<<<<<<<<<<
 * 
 * # Global variables used for interrupt processing
*/
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_function); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_file); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_SnapPea_crashed_in_function;
    __pyx_t_8[1] = __pyx_t_6;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_defined_in;
    __pyx_t_8[3] = __pyx_t_7;
    __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u_c;

    /* "cython/core/basic.pyx":173
 *     # uFatalError which is usually the root cause of the problem.
 *     if not PyErr_Occurred():
 *         raise SnapPeaFatalError('SnapPea crashed in function %s(), '             # <<<<<<<<<<<<<<
 *                                 'defined in %s.c.' % (function, file))
 * 
*/
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 5, 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 3, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 173, __pyx_L1_error)

    /* "cython/core/basic.pyx":172
 *     # Only raise exception the first time so that we see the first
 *     # uFatalError which is usually the root cause of the problem.
 *     if not PyErr_Occurred():             # <<<<<<<<<<<<<<
 *         raise SnapPeaFatalError('SnapPea crashed in function %s(), '
 *                                 'defined in %s.c.' % (function, file))
*/
  }

  /* "cython/core/basic.pyx":168
 * 
 * # Implementation of the SnapPea UI functions and their global variables.
 * cdef public void uFatalError(const_char_ptr function,             # <<<<<<<<<<<<<<
 *                              const_char_ptr file) except *:
 *     # Only raise exception the first time so that we see the first
*/

  /* function exit 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);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.uFatalError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":186
 * 
 * 
 * def SnapPea_interrupt():             # <<<<<<<<<<<<<<
 *     """
 *     The UI can call this to stop SnapPea.  Returns True if SnapPea s busy.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_15SnapPea_interrupt(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_8SnapPyHP_14SnapPea_interrupt, "\n    The UI can call this to stop SnapPea.  Returns True if SnapPea s busy.\n    If SnapPea is busy, the side effect is to set the gLongComputationCancelled\n    flag.\n    ");
static PyMethodDef __pyx_mdef_8SnapPyHP_15SnapPea_interrupt = {"SnapPea_interrupt", (PyCFunction)__pyx_pw_8SnapPyHP_15SnapPea_interrupt, METH_NOARGS, __pyx_doc_8SnapPyHP_14SnapPea_interrupt};
static PyObject *__pyx_pw_8SnapPyHP_15SnapPea_interrupt(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SnapPea_interrupt (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8SnapPyHP_14SnapPea_interrupt(__pyx_self);

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

static PyObject *__pyx_pf_8SnapPyHP_14SnapPea_interrupt(CYTHON_UNUSED PyObject *__pyx_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("SnapPea_interrupt", 0);

  /* "cython/core/basic.pyx":194
 *     global gLongComputationCancelled
 *     global gLongComputationInProgress
 *     if gLongComputationInProgress:             # <<<<<<<<<<<<<<
 *         gLongComputationCancelled = True
 *     return gLongComputationInProgress
*/
  __pyx_t_1 = (gLongComputationInProgress != 0);
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":195
 *     global gLongComputationInProgress
 *     if gLongComputationInProgress:
 *         gLongComputationCancelled = True             # <<<<<<<<<<<<<<
 *     return gLongComputationInProgress
 * 
*/
    gLongComputationCancelled = 1;

    /* "cython/core/basic.pyx":194
 *     global gLongComputationCancelled
 *     global gLongComputationInProgress
 *     if gLongComputationInProgress:             # <<<<<<<<<<<<<<
 *         gLongComputationCancelled = True
 *     return gLongComputationInProgress
*/
  }

  /* "cython/core/basic.pyx":196
 *     if gLongComputationInProgress:
 *         gLongComputationCancelled = True
 *     return gLongComputationInProgress             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_Boolean(gLongComputationInProgress); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":186
 * 
 * 
 * def SnapPea_interrupt():             # <<<<<<<<<<<<<<
 *     """
 *     The UI can call this to stop SnapPea.  Returns True if SnapPea s busy.
*/

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

/* "cython/core/basic.pyx":199
 * 
 * 
 * cdef public void uLongComputationBegins(const_char_ptr message,             # <<<<<<<<<<<<<<
 *                                         Boolean is_abortable):
 *     global gLongComputationCancelled
*/

void uLongComputationBegins(CYTHON_UNUSED const char* __pyx_v_message, CYTHON_UNUSED Boolean __pyx_v_is_abortable) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uLongComputationBegins", 0);

  /* "cython/core/basic.pyx":204
 *     global gLongComputationInProgress
 *     global gLongComputationTicker
 *     gLongComputationCancelled = False             # <<<<<<<<<<<<<<
 *     gLongComputationInProgress = True
 *     gLongComputationTicker = time.time()
*/
  gLongComputationCancelled = 0;

  /* "cython/core/basic.pyx":205
 *     global gLongComputationTicker
 *     gLongComputationCancelled = False
 *     gLongComputationInProgress = True             # <<<<<<<<<<<<<<
 *     gLongComputationTicker = time.time()
 * 
*/
  gLongComputationInProgress = 1;

  /* "cython/core/basic.pyx":206
 *     gLongComputationCancelled = False
 *     gLongComputationInProgress = True
 *     gLongComputationTicker = time.time()             # <<<<<<<<<<<<<<
 * 
 * cdef public c_FuncResult uLongComputationContinues() except *:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_XGOTREF(gLongComputationTicker);
  __Pyx_DECREF_SET(gLongComputationTicker, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":199
 * 
 * 
 * cdef public void uLongComputationBegins(const_char_ptr message,             # <<<<<<<<<<<<<<
 *                                         Boolean is_abortable):
 *     global gLongComputationCancelled
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.uLongComputationBegins", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":208
 *     gLongComputationTicker = time.time()
 * 
 * cdef public c_FuncResult uLongComputationContinues() except *:             # <<<<<<<<<<<<<<
 *     global gLongComputationCancelled
 *     global gLongComputationInProgress
*/

FuncResult uLongComputationContinues(void) {
  PyObject *__pyx_v_now = 0;
  FuncResult __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uLongComputationContinues", 0);

  /* "cython/core/basic.pyx":213
 *     global gLongComputationTicker
 *     cdef now
 *     if gLongComputationCancelled:             # <<<<<<<<<<<<<<
 *         return func_cancelled
 *     elif UI_callback is not None:
*/
  __pyx_t_1 = (gLongComputationCancelled != 0);
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":214
 *     cdef now
 *     if gLongComputationCancelled:
 *         return func_cancelled             # <<<<<<<<<<<<<<
 *     elif UI_callback is not None:
 *         now = time.time()
*/
    __pyx_r = func_cancelled;
    goto __pyx_L0;

    /* "cython/core/basic.pyx":213
 *     global gLongComputationTicker
 *     cdef now
 *     if gLongComputationCancelled:             # <<<<<<<<<<<<<<
 *         return func_cancelled
 *     elif UI_callback is not None:
*/
  }

  /* "cython/core/basic.pyx":215
 *     if gLongComputationCancelled:
 *         return func_cancelled
 *     elif UI_callback is not None:             # <<<<<<<<<<<<<<
 *         now = time.time()
 *         if now - gLongComputationTicker > 0.2:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":216
 *         return func_cancelled
 *     elif UI_callback is not None:
 *         now = time.time()             # <<<<<<<<<<<<<<
 *         if now - gLongComputationTicker > 0.2:
 *             UI_callback()
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_now = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":217
 *     elif UI_callback is not None:
 *         now = time.time()
 *         if now - gLongComputationTicker > 0.2:             # <<<<<<<<<<<<<<
 *             UI_callback()
 *             gLongComputationTicker = now
*/
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_now, gLongComputationTicker); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_mstate_global->__pyx_float_0_2, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "cython/core/basic.pyx":218
 *         now = time.time()
 *         if now - gLongComputationTicker > 0.2:
 *             UI_callback()             # <<<<<<<<<<<<<<
 *             gLongComputationTicker = now
 *     return func_OK
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 218, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":219
 *         if now - gLongComputationTicker > 0.2:
 *             UI_callback()
 *             gLongComputationTicker = now             # <<<<<<<<<<<<<<
 *     return func_OK
 * 
*/
      __Pyx_INCREF(__pyx_v_now);
      __Pyx_XGOTREF(gLongComputationTicker);
      __Pyx_DECREF_SET(gLongComputationTicker, __pyx_v_now);
      __Pyx_GIVEREF(__pyx_v_now);

      /* "cython/core/basic.pyx":217
 *     elif UI_callback is not None:
 *         now = time.time()
 *         if now - gLongComputationTicker > 0.2:             # <<<<<<<<<<<<<<
 *             UI_callback()
 *             gLongComputationTicker = now
*/
    }

    /* "cython/core/basic.pyx":215
 *     if gLongComputationCancelled:
 *         return func_cancelled
 *     elif UI_callback is not None:             # <<<<<<<<<<<<<<
 *         now = time.time()
 *         if now - gLongComputationTicker > 0.2:
*/
  }

  /* "cython/core/basic.pyx":220
 *             UI_callback()
 *             gLongComputationTicker = now
 *     return func_OK             # <<<<<<<<<<<<<<
 * 
 * cdef public void uLongComputationEnds() except*:
*/
  __pyx_r = func_OK;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":208
 *     gLongComputationTicker = time.time()
 * 
 * cdef public c_FuncResult uLongComputationContinues() except *:             # <<<<<<<<<<<<<<
 *     global gLongComputationCancelled
 *     global gLongComputationInProgress
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.uLongComputationContinues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (FuncResult) 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":222
 *     return func_OK
 * 
 * cdef public void uLongComputationEnds() except*:             # <<<<<<<<<<<<<<
 *     global gLongComputationCancelled
 *     global gLongComputationInProgress
*/

void uLongComputationEnds(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uLongComputationEnds", 0);

  /* "cython/core/basic.pyx":225
 *     global gLongComputationCancelled
 *     global gLongComputationInProgress
 *     gLongComputationInProgress = False             # <<<<<<<<<<<<<<
 *     if gLongComputationCancelled:
 *         gLongComputationCancelled = False
*/
  gLongComputationInProgress = 0;

  /* "cython/core/basic.pyx":226
 *     global gLongComputationInProgress
 *     gLongComputationInProgress = False
 *     if gLongComputationCancelled:             # <<<<<<<<<<<<<<
 *         gLongComputationCancelled = False
 *         if UI_callback is not None:
*/
  __pyx_t_1 = (gLongComputationCancelled != 0);
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":227
 *     gLongComputationInProgress = False
 *     if gLongComputationCancelled:
 *         gLongComputationCancelled = False             # <<<<<<<<<<<<<<
 *         if UI_callback is not None:
 *             UI_callback(interrupted=True)
*/
    gLongComputationCancelled = 0;

    /* "cython/core/basic.pyx":228
 *     if gLongComputationCancelled:
 *         gLongComputationCancelled = False
 *         if UI_callback is not None:             # <<<<<<<<<<<<<<
 *             UI_callback(interrupted=True)
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__pyx_t_2 != Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/basic.pyx":229
 *         gLongComputationCancelled = False
 *         if UI_callback is not None:
 *             UI_callback(interrupted=True)             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL};
        __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_interrupted, Py_True, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(1, 229, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":228
 *     if gLongComputationCancelled:
 *         gLongComputationCancelled = False
 *         if UI_callback is not None:             # <<<<<<<<<<<<<<
 *             UI_callback(interrupted=True)
 * 
*/
    }

    /* "cython/core/basic.pyx":226
 *     global gLongComputationInProgress
 *     gLongComputationInProgress = False
 *     if gLongComputationCancelled:             # <<<<<<<<<<<<<<
 *         gLongComputationCancelled = False
 *         if UI_callback is not None:
*/
  }

  /* "cython/core/basic.pyx":222
 *     return func_OK
 * 
 * cdef public void uLongComputationEnds() except*:             # <<<<<<<<<<<<<<
 *     global gLongComputationCancelled
 *     global gLongComputationInProgress
*/

  /* function exit 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_6);
  __Pyx_AddTraceback("SnapPyHP.uLongComputationEnds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":234
 * show_uAcknowledge = False
 * 
 * cdef public void uAcknowledge(const_char_ptr message):             # <<<<<<<<<<<<<<
 *     if show_uAcknowledge:
 *         sys.stderr.write(to_str(<char *> message))
*/

void uAcknowledge(const char* __pyx_v_message) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uAcknowledge", 0);

  /* "cython/core/basic.pyx":235
 * 
 * cdef public void uAcknowledge(const_char_ptr message):
 *     if show_uAcknowledge:             # <<<<<<<<<<<<<<
 *         sys.stderr.write(to_str(<char *> message))
 *         sys.stderr.write('\n')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_show_uAcknowledge); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __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(1, 235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":236
 * cdef public void uAcknowledge(const_char_ptr message):
 *     if show_uAcknowledge:
 *         sys.stderr.write(to_str(<char *> message))             # <<<<<<<<<<<<<<
 *         sys.stderr.write('\n')
 *     return
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyBytes_FromString(((char *)__pyx_v_message)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":237
 *     if show_uAcknowledge:
 *         sys.stderr.write(to_str(<char *> message))
 *         sys.stderr.write('\n')             # <<<<<<<<<<<<<<
 *     return
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":235
 * 
 * cdef public void uAcknowledge(const_char_ptr message):
 *     if show_uAcknowledge:             # <<<<<<<<<<<<<<
 *         sys.stderr.write(to_str(<char *> message))
 *         sys.stderr.write('\n')
*/
  }

  /* "cython/core/basic.pyx":238
 *         sys.stderr.write(to_str(<char *> message))
 *         sys.stderr.write('\n')
 *     return             # <<<<<<<<<<<<<<
 * 
 * cdef public void uAbortMemoryFull():
*/
  goto __pyx_L0;

  /* "cython/core/basic.pyx":234
 * show_uAcknowledge = False
 * 
 * cdef public void uAcknowledge(const_char_ptr message):             # <<<<<<<<<<<<<<
 *     if show_uAcknowledge:
 *         sys.stderr.write(to_str(<char *> message))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.uAcknowledge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":240
 *     return
 * 
 * cdef public void uAbortMemoryFull():             # <<<<<<<<<<<<<<
 *     sys.stderr.write('Out of memory.\n')
 *     sys.exit(2)
*/

void uAbortMemoryFull(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uAbortMemoryFull", 0);

  /* "cython/core/basic.pyx":241
 * 
 * cdef public void uAbortMemoryFull():
 *     sys.stderr.write('Out of memory.\n')             # <<<<<<<<<<<<<<
 *     sys.exit(2)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Out_of_memory};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":242
 * cdef public void uAbortMemoryFull():
 *     sys.stderr.write('Out of memory.\n')
 *     sys.exit(2)             # <<<<<<<<<<<<<<
 * 
 * cdef public int uQuery(const_char_ptr  message,
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":240
 *     return
 * 
 * cdef public void uAbortMemoryFull():             # <<<<<<<<<<<<<<
 *     sys.stderr.write('Out of memory.\n')
 *     sys.exit(2)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.uAbortMemoryFull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":244
 *     sys.exit(2)
 * 
 * cdef public int uQuery(const_char_ptr  message,             # <<<<<<<<<<<<<<
 *                        const_int       num_responses,
 *                        const_char_ptr  responses[],
*/

int uQuery(const char* __pyx_v_message, CYTHON_UNUSED const int __pyx_v_num_responses, const char* *__pyx_v_responses, const int __pyx_v_default_response) {
  char *__pyx_v_default;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[5];
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uQuery", 0);

  /* "cython/core/basic.pyx":251
 *     #  from the user, but for now it is set up to return the default
 *     #  response, to facilitate batch computations.
 *     cdef char *default = <char *> responses[<int> default_response]             # <<<<<<<<<<<<<<
 *     sys.stderr.write('Q: %s\nA:  %s\n' % (<char *> message, default))
 *     return <int> default_response
*/
  __pyx_v_default = ((char *)(__pyx_v_responses[((int)__pyx_v_default_response)]));

  /* "cython/core/basic.pyx":252
 *     #  response, to facilitate batch computations.
 *     cdef char *default = <char *> responses[<int> default_response]
 *     sys.stderr.write('Q: %s\nA:  %s\n' % (<char *> message, default))             # <<<<<<<<<<<<<<
 *     return <int> default_response
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBytes_FromString(((char *)__pyx_v_message)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Q;
  __pyx_t_7[1] = __pyx_t_5;
  __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_A;
  __pyx_t_7[3] = __pyx_t_6;
  __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":253
 *     cdef char *default = <char *> responses[<int> default_response]
 *     sys.stderr.write('Q: %s\nA:  %s\n' % (<char *> message, default))
 *     return <int> default_response             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((int)__pyx_v_default_response);
  goto __pyx_L0;

  /* "cython/core/basic.pyx":244
 *     sys.exit(2)
 * 
 * cdef public int uQuery(const_char_ptr  message,             # <<<<<<<<<<<<<<
 *                        const_int       num_responses,
 *                        const_char_ptr  responses[],
*/

  /* 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("SnapPyHP.uQuery", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":256
 * 
 * 
 * def cy_eval(s):             # <<<<<<<<<<<<<<
 *     return eval(s)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17cy_eval(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_8SnapPyHP_17cy_eval = {"cy_eval", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17cy_eval, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17cy_eval(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_s = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cy_eval (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 256, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 256, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cy_eval", 0) < 0) __PYX_ERR(1, 256, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cy_eval", 1, 1, 1, i); __PYX_ERR(1, 256, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 256, __pyx_L3_error)
    }
    __pyx_v_s = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cy_eval", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 256, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.cy_eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16cy_eval(__pyx_self, __pyx_v_s);

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

static PyObject *__pyx_pf_8SnapPyHP_16cy_eval(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cy_eval", 0);

  /* "cython/core/basic.pyx":257
 * 
 * def cy_eval(s):
 *     return eval(s)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_eval);
  __pyx_t_3 = __pyx_builtin_eval; 
  __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_v_s) {
    if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < 0) __PYX_ERR(1, 257, __pyx_L1_error)
  }
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_s, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":256
 * 
 * 
 * def cy_eval(s):             # <<<<<<<<<<<<<<
 *     return eval(s)
 * 
*/

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

/* "cython/core/basic.pyx":260
 * 
 * 
 * def smith_form(M):             # <<<<<<<<<<<<<<
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_19smith_form(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_8SnapPyHP_19smith_form = {"smith_form", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_19smith_form, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_19smith_form(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_M = 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("smith_form (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_M,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 260, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "smith_form", 0) < 0) __PYX_ERR(1, 260, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("smith_form", 1, 1, 1, i); __PYX_ERR(1, 260, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 260, __pyx_L3_error)
    }
    __pyx_v_M = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("smith_form", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.smith_form", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_18smith_form(__pyx_self, __pyx_v_M);

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

static PyObject *__pyx_pf_8SnapPyHP_18smith_form(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_M) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_result = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_zeros = NULL;
  PyObject *__pyx_v_nonzeros = NULL;
  PyObject *__pyx_7genexpr__pyx_v_x = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_x = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("smith_form", 0);
  __Pyx_INCREF(__pyx_v_M);

  /* "cython/core/basic.pyx":261
 * 
 * def smith_form(M):
 *     if _within_sage:             # <<<<<<<<<<<<<<
 *         if not hasattr(M, 'elementary_divisors'):
 *             M = sage_matrix(M)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 261, __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(1, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":262
 * def smith_form(M):
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):             # <<<<<<<<<<<<<<
 *             M = sage_matrix(M)
 *         m, n = M.nrows(), M.ncols()
*/
    __pyx_t_2 = __Pyx_HasAttr(__pyx_v_M, __pyx_mstate_global->__pyx_n_u_elementary_divisors); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 262, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_2);
    if (__pyx_t_3) {

      /* "cython/core/basic.pyx":263
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):
 *             M = sage_matrix(M)             # <<<<<<<<<<<<<<
 *         m, n = M.nrows(), M.ncols()
 *         result = M.elementary_divisors(algorithm='pari')
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sage_matrix); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_M};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 263, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":262
 * def smith_form(M):
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):             # <<<<<<<<<<<<<<
 *             M = sage_matrix(M)
 *         m, n = M.nrows(), M.ncols()
*/
    }

    /* "cython/core/basic.pyx":264
 *         if not hasattr(M, 'elementary_divisors'):
 *             M = sage_matrix(M)
 *         m, n = M.nrows(), M.ncols()             # <<<<<<<<<<<<<<
 *         result = M.elementary_divisors(algorithm='pari')
 *     else:
*/
    __pyx_t_5 = __pyx_v_M;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_nrows, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_4 = __pyx_v_M;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ncols, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_v_m = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_n = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":265
 *             M = sage_matrix(M)
 *         m, n = M.nrows(), M.ncols()
 *         result = M.elementary_divisors(algorithm='pari')             # <<<<<<<<<<<<<<
 *     else:
 *         if not isinstance(M, matrix):
*/
    __pyx_t_1 = __pyx_v_M;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, NULL};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_algorithm, __pyx_mstate_global->__pyx_n_u_pari, __pyx_t_4, __pyx_callargs+1, 0) < 0) __PYX_ERR(1, 265, __pyx_L1_error)
      __pyx_t_5 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_v_result = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":261
 * 
 * def smith_form(M):
 *     if _within_sage:             # <<<<<<<<<<<<<<
 *         if not hasattr(M, 'elementary_divisors'):
 *             M = sage_matrix(M)
*/
    goto __pyx_L3;
  }

  /* "cython/core/basic.pyx":267
 *         result = M.elementary_divisors(algorithm='pari')
 *     else:
 *         if not isinstance(M, matrix):             # <<<<<<<<<<<<<<
 *             M = matrix(M)
 *         m, n = M.shape
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_IsInstance(__pyx_v_M, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 267, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (!__pyx_t_3);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":268
 *     else:
 *         if not isinstance(M, matrix):
 *             M = matrix(M)             # <<<<<<<<<<<<<<
 *         m, n = M.shape
 *         result = [int(x) for x in pari.matrix(m, n, M.entries()).matsnf()]
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_M};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":267
 *         result = M.elementary_divisors(algorithm='pari')
 *     else:
 *         if not isinstance(M, matrix):             # <<<<<<<<<<<<<<
 *             M = matrix(M)
 *         m, n = M.shape
*/
    }

    /* "cython/core/basic.pyx":269
 *         if not isinstance(M, matrix):
 *             M = matrix(M)
 *         m, n = M.shape             # <<<<<<<<<<<<<<
 *         result = [int(x) for x in pari.matrix(m, n, M.entries()).matsnf()]
 * 
*/
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 269, __pyx_L1_error)
    __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(1, 269, __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_INCREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 269, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 269, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 269, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 269, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_m = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/basic.pyx":270
 *             M = matrix(M)
 *         m, n = M.shape
 *         result = [int(x) for x in pari.matrix(m, n, M.entries()).matsnf()]             # <<<<<<<<<<<<<<
 * 
 *     # PARI views the input to matsnf0 as square.
*/
    { /* enter inner scope */
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 270, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 270, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 270, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_12 = __pyx_v_M;
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
        __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_entries, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 270, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
        assert(__pyx_t_9);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_m, __pyx_v_n, __pyx_t_10};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 270, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_1 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_matsnf, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 270, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 270, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 270, __pyx_L10_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 270, __pyx_L10_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_13);
            ++__pyx_t_13;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 270, __pyx_L10_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_13));
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_13);
            #endif
            ++__pyx_t_13;
          }
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 270, __pyx_L10_error)
        } else {
          __pyx_t_4 = __pyx_t_14(__pyx_t_7);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 270, __pyx_L10_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_7genexpr__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 270, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(1, 270, __pyx_L10_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
      goto __pyx_L14_exit_scope;
      __pyx_L10_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
      goto __pyx_L1_error;
      __pyx_L14_exit_scope:;
    } /* exit inner scope */
    __pyx_v_result = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "cython/core/basic.pyx":273
 * 
 *     # PARI views the input to matsnf0 as square.
 *     if m < n:             # <<<<<<<<<<<<<<
 *         result = result + [0]*(n-m)
 *     if m > n:
*/
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_m, __pyx_v_n, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 273, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":274
 *     # PARI views the input to matsnf0 as square.
 *     if m < n:
 *         result = result + [0]*(n-m)             # <<<<<<<<<<<<<<
 *     if m > n:
 *         for i in range(m - n):
*/
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_n, __pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 274, __pyx_L1_error);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_temp)) __PYX_ERR(1, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_7);
      __pyx_t_7 = __pyx_temp;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_v_result, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":273
 * 
 *     # PARI views the input to matsnf0 as square.
 *     if m < n:             # <<<<<<<<<<<<<<
 *         result = result + [0]*(n-m)
 *     if m > n:
*/
  }

  /* "cython/core/basic.pyx":275
 *     if m < n:
 *         result = result + [0]*(n-m)
 *     if m > n:             # <<<<<<<<<<<<<<
 *         for i in range(m - n):
 *             result.remove(0)
*/
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_m, __pyx_v_n, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 275, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":276
 *         result = result + [0]*(n-m)
 *     if m > n:
 *         for i in range(m - n):             # <<<<<<<<<<<<<<
 *             result.remove(0)
 * 
*/
    __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_4 = __pyx_builtin_range; 
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_m, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 276, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 276, __pyx_L1_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13);
          ++__pyx_t_13;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 276, __pyx_L1_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13);
          #endif
          ++__pyx_t_13;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 276, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_14(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 276, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":277
 *     if m > n:
 *         for i in range(m - n):
 *             result.remove(0)             # <<<<<<<<<<<<<<
 * 
 *     # For consistency with SnapPea, need to switch the order of the factors.
*/
      __pyx_t_1 = __pyx_v_result;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_0};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":276
 *         result = result + [0]*(n-m)
 *     if m > n:
 *         for i in range(m - n):             # <<<<<<<<<<<<<<
 *             result.remove(0)
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/basic.pyx":275
 *     if m < n:
 *         result = result + [0]*(n-m)
 *     if m > n:             # <<<<<<<<<<<<<<
 *         for i in range(m - n):
 *             result.remove(0)
*/
  }

  /* "cython/core/basic.pyx":280
 * 
 *     # For consistency with SnapPea, need to switch the order of the factors.
 *     zeros = [x for x in result if x == 0]             # <<<<<<<<<<<<<<
 *     nonzeros = [x for x in result if x != 0]
 *     nonzeros.sort()
*/
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 280, __pyx_L22_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
      __pyx_t_5 = __pyx_v_result; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 280, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 280, __pyx_L22_error)
    }
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 280, __pyx_L22_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_13);
          ++__pyx_t_13;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 280, __pyx_L22_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13));
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13);
          #endif
          ++__pyx_t_13;
        }
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 280, __pyx_L22_error)
      } else {
        __pyx_t_1 = __pyx_t_14(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 280, __pyx_L22_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__Pyx_PyLong_BoolEqObjC(__pyx_8genexpr1__pyx_v_x, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 280, __pyx_L22_error)
      if (__pyx_t_2) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr1__pyx_v_x))) __PYX_ERR(1, 280, __pyx_L22_error)
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
    goto __pyx_L27_exit_scope;
    __pyx_L22_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L27_exit_scope:;
  } /* exit inner scope */
  __pyx_v_zeros = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":281
 *     # For consistency with SnapPea, need to switch the order of the factors.
 *     zeros = [x for x in result if x == 0]
 *     nonzeros = [x for x in result if x != 0]             # <<<<<<<<<<<<<<
 *     nonzeros.sort()
 *     return nonzeros + zeros
*/
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 281, __pyx_L30_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
      __pyx_t_5 = __pyx_v_result; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 281, __pyx_L30_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 281, __pyx_L30_error)
    }
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 281, __pyx_L30_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_13);
          ++__pyx_t_13;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 281, __pyx_L30_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13));
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13);
          #endif
          ++__pyx_t_13;
        }
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 281, __pyx_L30_error)
      } else {
        __pyx_t_1 = __pyx_t_14(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 281, __pyx_L30_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__Pyx_PyLong_BoolNeObjC(__pyx_8genexpr2__pyx_v_x, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 281, __pyx_L30_error)
      if (__pyx_t_2) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr2__pyx_v_x))) __PYX_ERR(1, 281, __pyx_L30_error)
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x); __pyx_8genexpr2__pyx_v_x = 0;
    goto __pyx_L35_exit_scope;
    __pyx_L30_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x); __pyx_8genexpr2__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L35_exit_scope:;
  } /* exit inner scope */
  __pyx_v_nonzeros = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":282
 *     zeros = [x for x in result if x == 0]
 *     nonzeros = [x for x in result if x != 0]
 *     nonzeros.sort()             # <<<<<<<<<<<<<<
 *     return nonzeros + zeros
 * 
*/
  __pyx_t_15 = PyList_Sort(__pyx_v_nonzeros); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(1, 282, __pyx_L1_error)

  /* "cython/core/basic.pyx":283
 *     nonzeros = [x for x in result if x != 0]
 *     nonzeros.sort()
 *     return nonzeros + zeros             # <<<<<<<<<<<<<<
 * 
 * # end smith form code
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyNumber_Add(__pyx_v_nonzeros, __pyx_v_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":260
 * 
 * 
 * def smith_form(M):             # <<<<<<<<<<<<<<
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.smith_form", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_zeros);
  __Pyx_XDECREF(__pyx_v_nonzeros);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":306
 * 
 * # SnapPea memory usage
 * def check_SnapPea_memory():             # <<<<<<<<<<<<<<
 *     verify_my_malloc_usage()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_21check_SnapPea_memory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_21check_SnapPea_memory = {"check_SnapPea_memory", (PyCFunction)__pyx_pw_8SnapPyHP_21check_SnapPea_memory, METH_NOARGS, 0};
static PyObject *__pyx_pw_8SnapPyHP_21check_SnapPea_memory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_SnapPea_memory (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8SnapPyHP_20check_SnapPea_memory(__pyx_self);

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

static PyObject *__pyx_pf_8SnapPyHP_20check_SnapPea_memory(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_SnapPea_memory", 0);

  /* "cython/core/basic.pyx":307
 * # SnapPea memory usage
 * def check_SnapPea_memory():
 *     verify_my_malloc_usage()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  verify_my_malloc_usage(); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 307, __pyx_L1_error)

  /* "cython/core/basic.pyx":306
 * 
 * # SnapPea memory usage
 * def check_SnapPea_memory():             # <<<<<<<<<<<<<<
 *     verify_my_malloc_usage()
 * 
*/

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

/* "cython/core/basic.pyx":310
 * 
 * 
 * def set_rand_seed(seed):             # <<<<<<<<<<<<<<
 *     """
 *     Set seed of the random number generator used for choosing
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_23set_rand_seed(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_8SnapPyHP_22set_rand_seed, "\n    Set seed of the random number generator used for choosing\n    triangulation moves.\n    ");
static PyMethodDef __pyx_mdef_8SnapPyHP_23set_rand_seed = {"set_rand_seed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_23set_rand_seed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_22set_rand_seed};
static PyObject *__pyx_pw_8SnapPyHP_23set_rand_seed(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_seed = 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_rand_seed (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 310, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_rand_seed", 0) < 0) __PYX_ERR(1, 310, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_rand_seed", 1, 1, 1, i); __PYX_ERR(1, 310, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 310, __pyx_L3_error)
    }
    __pyx_v_seed = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_rand_seed", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 310, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.set_rand_seed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_22set_rand_seed(__pyx_self, __pyx_v_seed);

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

static PyObject *__pyx_pf_8SnapPyHP_22set_rand_seed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seed) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_rand_seed", 0);

  /* "cython/core/basic.pyx":315
 *     triangulation moves.
 *     """
 *     srand(seed)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_unsigned_int(__pyx_v_seed); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 315, __pyx_L1_error)
  srand(__pyx_t_1);

  /* "cython/core/basic.pyx":310
 * 
 * 
 * def set_rand_seed(seed):             # <<<<<<<<<<<<<<
 *     """
 *     Set seed of the random number generator used for choosing
*/

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

/* "cython/core/basic.pyx":320
 * # Ptolemy utility functions
 * # convert and free an identification of variables structure
 * cdef convert_and_free_identification_of_variables(             # <<<<<<<<<<<<<<
 *         Identification_of_variables c_vars):
 *     var_list = []
*/

static PyObject *__pyx_f_8SnapPyHP_convert_and_free_identification_of_variables(Identification_of_variables __pyx_v_c_vars) {
  PyObject *__pyx_v_var_list = NULL;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_and_free_identification_of_variables", 0);

  /* "cython/core/basic.pyx":322
 * cdef convert_and_free_identification_of_variables(
 *         Identification_of_variables c_vars):
 *     var_list = []             # <<<<<<<<<<<<<<
 * 
 *     if c_vars.variables:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_var_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":324
 *     var_list = []
 * 
 *     if c_vars.variables:             # <<<<<<<<<<<<<<
 *         for i in range(c_vars.num_identifications):
 *             var_list.append(
*/
  __pyx_t_2 = (__pyx_v_c_vars.variables != 0);
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":325
 * 
 *     if c_vars.variables:
 *         for i in range(c_vars.num_identifications):             # <<<<<<<<<<<<<<
 *             var_list.append(
 *                   (c_vars.signs[i],
*/
    __pyx_t_3 = __pyx_v_c_vars.num_identifications;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "cython/core/basic.pyx":327
 *         for i in range(c_vars.num_identifications):
 *             var_list.append(
 *                   (c_vars.signs[i],             # <<<<<<<<<<<<<<
 *                    c_vars.powers[i],
 *                    to_str(c_vars.variables[i][0]),
*/
      __pyx_t_1 = __Pyx_PyLong_From_int((__pyx_v_c_vars.signs[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/basic.pyx":328
 *             var_list.append(
 *                   (c_vars.signs[i],
 *                    c_vars.powers[i],             # <<<<<<<<<<<<<<
 *                    to_str(c_vars.variables[i][0]),
 *                    to_str(c_vars.variables[i][1])))
*/
      __pyx_t_6 = __Pyx_PyLong_From_int((__pyx_v_c_vars.powers[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/basic.pyx":329
 *                   (c_vars.signs[i],
 *                    c_vars.powers[i],
 *                    to_str(c_vars.variables[i][0]),             # <<<<<<<<<<<<<<
 *                    to_str(c_vars.variables[i][1])))
 *     return var_list
*/
      __pyx_t_8 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyBytes_FromString(((__pyx_v_c_vars.variables[__pyx_v_i])[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_8);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }

      /* "cython/core/basic.pyx":330
 *                    c_vars.powers[i],
 *                    to_str(c_vars.variables[i][0]),
 *                    to_str(c_vars.variables[i][1])))             # <<<<<<<<<<<<<<
 *     return var_list
 * 
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = __Pyx_PyBytes_FromString(((__pyx_v_c_vars.variables[__pyx_v_i])[1])); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }

      /* "cython/core/basic.pyx":327
 *         for i in range(c_vars.num_identifications):
 *             var_list.append(
 *                   (c_vars.signs[i],             # <<<<<<<<<<<<<<
 *                    c_vars.powers[i],
 *                    to_str(c_vars.variables[i][0]),
*/
      __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 327, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(1, 327, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(1, 327, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_9) != (0)) __PYX_ERR(1, 327, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_9 = 0;

      /* "cython/core/basic.pyx":326
 *     if c_vars.variables:
 *         for i in range(c_vars.num_identifications):
 *             var_list.append(             # <<<<<<<<<<<<<<
 *                   (c_vars.signs[i],
 *                    c_vars.powers[i],
*/
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_var_list, __pyx_t_8); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 326, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }

    /* "cython/core/basic.pyx":324
 *     var_list = []
 * 
 *     if c_vars.variables:             # <<<<<<<<<<<<<<
 *         for i in range(c_vars.num_identifications):
 *             var_list.append(
*/
  }

  /* "cython/core/basic.pyx":331
 *                    to_str(c_vars.variables[i][0]),
 *                    to_str(c_vars.variables[i][1])))
 *     return var_list             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_var_list);
  __pyx_r = __pyx_v_var_list;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":320
 * # Ptolemy utility functions
 * # convert and free an identification of variables structure
 * cdef convert_and_free_identification_of_variables(             # <<<<<<<<<<<<<<
 *         Identification_of_variables c_vars):
 *     var_list = []
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.convert_and_free_identification_of_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_var_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":335
 * 
 * # convert and free an integer matrix from C
 * cdef convert_and_free_integer_matrix(             # <<<<<<<<<<<<<<
 *         Integer_matrix_with_explanations c_matrix):
 *     if not c_matrix.entries:
*/

static PyObject *__pyx_f_8SnapPyHP_convert_and_free_integer_matrix(Integer_matrix_with_explanations __pyx_v_c_matrix) {
  PyObject *__pyx_v_python_matrix = NULL;
  PyObject *__pyx_v_explain_row = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_explain_column = NULL;
  int __pyx_8genexpr3__pyx_v_i;
  int __pyx_8genexpr4__pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_and_free_integer_matrix", 0);

  /* "cython/core/basic.pyx":337
 * cdef convert_and_free_integer_matrix(
 *         Integer_matrix_with_explanations c_matrix):
 *     if not c_matrix.entries:             # <<<<<<<<<<<<<<
 *         return []
 * 
*/
  __pyx_t_1 = (!(__pyx_v_c_matrix.entries != 0));
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":338
 *         Integer_matrix_with_explanations c_matrix):
 *     if not c_matrix.entries:
 *         return []             # <<<<<<<<<<<<<<
 * 
 *     python_matrix = [[c_matrix.entries[i][j]
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/basic.pyx":337
 * cdef convert_and_free_integer_matrix(
 *         Integer_matrix_with_explanations c_matrix):
 *     if not c_matrix.entries:             # <<<<<<<<<<<<<<
 *         return []
 * 
*/
  }

  /* "cython/core/basic.pyx":340
 *         return []
 * 
 *     python_matrix = [[c_matrix.entries[i][j]             # <<<<<<<<<<<<<<
 *                       for j in range(c_matrix.num_cols)]
 *                      for i in range(c_matrix.num_rows)]
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/basic.pyx":342
 *     python_matrix = [[c_matrix.entries[i][j]
 *                       for j in range(c_matrix.num_cols)]
 *                      for i in range(c_matrix.num_rows)]             # <<<<<<<<<<<<<<
 * 
 *     explain_row = []
*/
    __pyx_t_3 = __pyx_v_c_matrix.num_rows;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_8genexpr3__pyx_v_i = __pyx_t_5;
      { /* enter inner scope */

        /* "cython/core/basic.pyx":340
 *         return []
 * 
 *     python_matrix = [[c_matrix.entries[i][j]             # <<<<<<<<<<<<<<
 *                       for j in range(c_matrix.num_cols)]
 *                      for i in range(c_matrix.num_rows)]
*/
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "cython/core/basic.pyx":341
 * 
 *     python_matrix = [[c_matrix.entries[i][j]
 *                       for j in range(c_matrix.num_cols)]             # <<<<<<<<<<<<<<
 *                      for i in range(c_matrix.num_rows)]
 * 
*/
        __pyx_t_7 = __pyx_v_c_matrix.num_cols;
        __pyx_t_8 = __pyx_t_7;
        for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
          __pyx_8genexpr4__pyx_v_j = __pyx_t_9;

          /* "cython/core/basic.pyx":340
 *         return []
 * 
 *     python_matrix = [[c_matrix.entries[i][j]             # <<<<<<<<<<<<<<
 *                       for j in range(c_matrix.num_cols)]
 *                      for i in range(c_matrix.num_rows)]
*/
          __pyx_t_10 = __Pyx_PyLong_From_int(((__pyx_v_c_matrix.entries[__pyx_8genexpr3__pyx_v_i])[__pyx_8genexpr4__pyx_v_j])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 340, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_10))) __PYX_ERR(1, 340, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_v_python_matrix = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":344
 *                      for i in range(c_matrix.num_rows)]
 * 
 *     explain_row = []             # <<<<<<<<<<<<<<
 * 
 *     for i in range(c_matrix.num_rows):
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_row = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":346
 *     explain_row = []
 * 
 *     for i in range(c_matrix.num_rows):             # <<<<<<<<<<<<<<
 *         if c_matrix.explain_row[i]:
 *             explain_row.append(to_str(c_matrix.explain_row[i]))
*/
  __pyx_t_3 = __pyx_v_c_matrix.num_rows;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cython/core/basic.pyx":347
 * 
 *     for i in range(c_matrix.num_rows):
 *         if c_matrix.explain_row[i]:             # <<<<<<<<<<<<<<
 *             explain_row.append(to_str(c_matrix.explain_row[i]))
 *         else:
*/
    __pyx_t_1 = ((__pyx_v_c_matrix.explain_row[__pyx_v_i]) != 0);
    if (__pyx_t_1) {

      /* "cython/core/basic.pyx":348
 *     for i in range(c_matrix.num_rows):
 *         if c_matrix.explain_row[i]:
 *             explain_row.append(to_str(c_matrix.explain_row[i]))             # <<<<<<<<<<<<<<
 *         else:
 *             explain_row.append(None)
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyBytes_FromString((__pyx_v_c_matrix.explain_row[__pyx_v_i])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
        __pyx_t_12 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_11};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 348, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_explain_row, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 348, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":347
 * 
 *     for i in range(c_matrix.num_rows):
 *         if c_matrix.explain_row[i]:             # <<<<<<<<<<<<<<
 *             explain_row.append(to_str(c_matrix.explain_row[i]))
 *         else:
*/
      goto __pyx_L10;
    }

    /* "cython/core/basic.pyx":350
 *             explain_row.append(to_str(c_matrix.explain_row[i]))
 *         else:
 *             explain_row.append(None)             # <<<<<<<<<<<<<<
 * 
 *     explain_column = []
*/
    /*else*/ {
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_explain_row, Py_None); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
    }
    __pyx_L10:;
  }

  /* "cython/core/basic.pyx":352
 *             explain_row.append(None)
 * 
 *     explain_column = []             # <<<<<<<<<<<<<<
 * 
 *     for i in range(c_matrix.num_cols):
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_column = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":354
 *     explain_column = []
 * 
 *     for i in range(c_matrix.num_cols):             # <<<<<<<<<<<<<<
 *         if c_matrix.explain_column[i]:
 *             explain_column.append(to_str(c_matrix.explain_column[i]))
*/
  __pyx_t_3 = __pyx_v_c_matrix.num_cols;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cython/core/basic.pyx":355
 * 
 *     for i in range(c_matrix.num_cols):
 *         if c_matrix.explain_column[i]:             # <<<<<<<<<<<<<<
 *             explain_column.append(to_str(c_matrix.explain_column[i]))
 *         else:
*/
    __pyx_t_1 = ((__pyx_v_c_matrix.explain_column[__pyx_v_i]) != 0);
    if (__pyx_t_1) {

      /* "cython/core/basic.pyx":356
 *     for i in range(c_matrix.num_cols):
 *         if c_matrix.explain_column[i]:
 *             explain_column.append(to_str(c_matrix.explain_column[i]))             # <<<<<<<<<<<<<<
 *         else:
 *             explain_column.append(None)
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyBytes_FromString((__pyx_v_c_matrix.explain_column[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
        __pyx_t_12 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 356, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_explain_column, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 356, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":355
 * 
 *     for i in range(c_matrix.num_cols):
 *         if c_matrix.explain_column[i]:             # <<<<<<<<<<<<<<
 *             explain_column.append(to_str(c_matrix.explain_column[i]))
 *         else:
*/
      goto __pyx_L13;
    }

    /* "cython/core/basic.pyx":358
 *             explain_column.append(to_str(c_matrix.explain_column[i]))
 *         else:
 *             explain_column.append(None)             # <<<<<<<<<<<<<<
 * 
 *     free_integer_matrix_with_explanations(c_matrix)
*/
    /*else*/ {
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_explain_column, Py_None); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 358, __pyx_L1_error)
    }
    __pyx_L13:;
  }

  /* "cython/core/basic.pyx":360
 *             explain_column.append(None)
 * 
 *     free_integer_matrix_with_explanations(c_matrix)             # <<<<<<<<<<<<<<
 * 
 *     return python_matrix, explain_row, explain_column
*/
  free_integer_matrix_with_explanations(__pyx_v_c_matrix);

  /* "cython/core/basic.pyx":362
 *     free_integer_matrix_with_explanations(c_matrix)
 * 
 *     return python_matrix, explain_row, explain_column             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_python_matrix);
  __Pyx_GIVEREF(__pyx_v_python_matrix);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_python_matrix) != (0)) __PYX_ERR(1, 362, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_row);
  __Pyx_GIVEREF(__pyx_v_explain_row);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_row) != (0)) __PYX_ERR(1, 362, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_column);
  __Pyx_GIVEREF(__pyx_v_explain_column);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_column) != (0)) __PYX_ERR(1, 362, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":335
 * 
 * # convert and free an integer matrix from C
 * cdef convert_and_free_integer_matrix(             # <<<<<<<<<<<<<<
 *         Integer_matrix_with_explanations c_matrix):
 *     if not c_matrix.entries:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.convert_and_free_integer_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_python_matrix);
  __Pyx_XDECREF(__pyx_v_explain_row);
  __Pyx_XDECREF(__pyx_v_explain_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":367
 * class MatrixWithExplanations():
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 * 
 *         self.matrix = mat
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_22MatrixWithExplanations_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_22MatrixWithExplanations_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_22MatrixWithExplanations_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_22MatrixWithExplanations_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_mat = 0;
  PyObject *__pyx_v_explain_rows = 0;
  PyObject *__pyx_v_explain_columns = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_explain_rows,&__pyx_mstate_global->__pyx_n_u_explain_columns,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 367, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 367, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(1, 367, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, i); __PYX_ERR(1, 367, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 367, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_mat = values[1];
    __pyx_v_explain_rows = values[2];
    __pyx_v_explain_columns = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.MatrixWithExplanations.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_22MatrixWithExplanations___init__(__pyx_self, __pyx_v_self, __pyx_v_mat, __pyx_v_explain_rows, __pyx_v_explain_columns);

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

static PyObject *__pyx_pf_8SnapPyHP_22MatrixWithExplanations___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mat, PyObject *__pyx_v_explain_rows, PyObject *__pyx_v_explain_columns) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":369
 *     def __init__(self, mat, explain_rows, explain_columns):
 * 
 *         self.matrix = mat             # <<<<<<<<<<<<<<
 *         self.explain_rows = explain_rows
 *         self.explain_columns = explain_columns
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_matrix, __pyx_v_mat) < 0) __PYX_ERR(1, 369, __pyx_L1_error)

  /* "cython/core/basic.pyx":370
 * 
 *         self.matrix = mat
 *         self.explain_rows = explain_rows             # <<<<<<<<<<<<<<
 *         self.explain_columns = explain_columns
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_explain_rows, __pyx_v_explain_rows) < 0) __PYX_ERR(1, 370, __pyx_L1_error)

  /* "cython/core/basic.pyx":371
 *         self.matrix = mat
 *         self.explain_rows = explain_rows
 *         self.explain_columns = explain_columns             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_explain_columns, __pyx_v_explain_columns) < 0) __PYX_ERR(1, 371, __pyx_L1_error)

  /* "cython/core/basic.pyx":367
 * class MatrixWithExplanations():
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 * 
 *         self.matrix = mat
*/

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

/* "cython/core/basic.pyx":373
 *         self.explain_columns = explain_columns
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_22MatrixWithExplanations_3__repr__(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_8SnapPyHP_22MatrixWithExplanations_3__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_22MatrixWithExplanations_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_22MatrixWithExplanations_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v__type_str = 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("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_type_str,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 373, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 373, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 373, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 373, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_MatrixWithExplanations)));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 0, 1, 2, i); __PYX_ERR(1, 373, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 373, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 373, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_MatrixWithExplanations)));
    }
    __pyx_v_self = values[0];
    __pyx_v__type_str = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 373, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.MatrixWithExplanations.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_22MatrixWithExplanations_2__repr__(__pyx_self, __pyx_v_self, __pyx_v__type_str);

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

/* "cython/core/basic.pyx":375
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):
 * 
 *         def format_explain_list(l):             # <<<<<<<<<<<<<<
 *             if len(l) <= 6:
 *                 return repr(l)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_22MatrixWithExplanations_8__repr___1format_explain_list(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_8SnapPyHP_22MatrixWithExplanations_8__repr___1format_explain_list = {"format_explain_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_22MatrixWithExplanations_8__repr___1format_explain_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_22MatrixWithExplanations_8__repr___1format_explain_list(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_l = 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("format_explain_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_l,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 375, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "format_explain_list", 0) < 0) __PYX_ERR(1, 375, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("format_explain_list", 1, 1, 1, i); __PYX_ERR(1, 375, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 375, __pyx_L3_error)
    }
    __pyx_v_l = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format_explain_list", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 375, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.MatrixWithExplanations.__repr__.format_explain_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_22MatrixWithExplanations_8__repr___format_explain_list(__pyx_self, __pyx_v_l);

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

static PyObject *__pyx_pf_8SnapPyHP_22MatrixWithExplanations_8__repr___format_explain_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __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;
  PyObject *__pyx_t_7[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("format_explain_list", 0);

  /* "cython/core/basic.pyx":376
 * 
 *         def format_explain_list(l):
 *             if len(l) <= 6:             # <<<<<<<<<<<<<<
 *                 return repr(l)
 * 
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_l); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 376, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 <= 6);
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":377
 *         def format_explain_list(l):
 *             if len(l) <= 6:
 *                 return repr(l)             # <<<<<<<<<<<<<<
 * 
 *             return "[ %s, ..., %s]" % (
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyObject_Repr(__pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/basic.pyx":376
 * 
 *         def format_explain_list(l):
 *             if len(l) <= 6:             # <<<<<<<<<<<<<<
 *                 return repr(l)
 * 
*/
  }

  /* "cython/core/basic.pyx":379
 *                 return repr(l)
 * 
 *             return "[ %s, ..., %s]" % (             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr, l[:3])),
 *                 ', '.join(map(repr, l[-3:])))
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/basic.pyx":380
 * 
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr, l[:3])),             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr, l[-3:])))
 * 
*/
  __pyx_t_3 = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_l, 0, 3, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 380, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(1, 380, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":381
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr, l[:3])),
 *                 ', '.join(map(repr, l[-3:])))             # <<<<<<<<<<<<<<
 * 
 *         return (
*/
  __pyx_t_4 = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_repr); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_l, -3L, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 381, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 381, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_7[1] = __pyx_t_5;
  __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_7[3] = __pyx_t_6;
  __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u__5;

  /* "cython/core/basic.pyx":379
 *                 return repr(l)
 * 
 *             return "[ %s, ..., %s]" % (             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr, l[:3])),
 *                 ', '.join(map(repr, l[-3:])))
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":375
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):
 * 
 *         def format_explain_list(l):             # <<<<<<<<<<<<<<
 *             if len(l) <= 6:
 *                 return repr(l)
*/

  /* 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("SnapPyHP.MatrixWithExplanations.__repr__.format_explain_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":373
 *         self.explain_columns = explain_columns
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
*/

static PyObject *__pyx_pf_8SnapPyHP_22MatrixWithExplanations_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__type_str) {
  PyObject *__pyx_v_format_explain_list = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[8];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":375
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):
 * 
 *         def format_explain_list(l):             # <<<<<<<<<<<<<<
 *             if len(l) <= 6:
 *                 return repr(l)
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_22MatrixWithExplanations_8__repr___1format_explain_list, 0, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_format_explain_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":383
 *                 ', '.join(map(repr, l[-3:])))
 * 
 *         return (             # <<<<<<<<<<<<<<
 *             "%s(\n"
 *             "  %s,\n"
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/basic.pyx":388
 *             "  explain_columns = %s,\n"
 *             "  explain_rows = %s)") % (
 *                               _type_str,             # <<<<<<<<<<<<<<
 *                               '\n  '.join(repr(self.matrix).split('\n')),
 *                               format_explain_list(self.explain_columns),
*/
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v__type_str), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/basic.pyx":389
 *             "  explain_rows = %s)") % (
 *                               _type_str,
 *                               '\n  '.join(repr(self.matrix).split('\n')),             # <<<<<<<<<<<<<<
 *                               format_explain_list(self.explain_columns),
 *                               format_explain_list(self.explain_rows))
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split");
    __PYX_ERR(1, 389, __pyx_L1_error)
  }
  __pyx_t_2 = PyUnicode_Split(((PyObject*)__pyx_t_3), __Pyx_NoneAsNull(__pyx_mstate_global->__pyx_kp_u_), -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":390
 *                               _type_str,
 *                               '\n  '.join(repr(self.matrix).split('\n')),
 *                               format_explain_list(self.explain_columns),             # <<<<<<<<<<<<<<
 *                               format_explain_list(self.explain_rows))
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_explain_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __pyx_pf_8SnapPyHP_22MatrixWithExplanations_8__repr___format_explain_list(__pyx_v_format_explain_list, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":391
 *                               '\n  '.join(repr(self.matrix).split('\n')),
 *                               format_explain_list(self.explain_columns),
 *                               format_explain_list(self.explain_rows))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_explain_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_pf_8SnapPyHP_22MatrixWithExplanations_8__repr___format_explain_list(__pyx_v_format_explain_list, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6[0] = __pyx_t_1;
  __pyx_t_6[1] = __pyx_mstate_global->__pyx_kp_u__6;
  __pyx_t_6[2] = __pyx_t_3;
  __pyx_t_6[3] = __pyx_mstate_global->__pyx_kp_u_explain_columns_2;
  __pyx_t_6[4] = __pyx_t_2;
  __pyx_t_6[5] = __pyx_mstate_global->__pyx_kp_u_explain_rows_2;
  __pyx_t_6[6] = __pyx_t_4;
  __pyx_t_6[7] = __pyx_mstate_global->__pyx_kp_u__8;

  /* "cython/core/basic.pyx":384
 * 
 *         return (
 *             "%s(\n"             # <<<<<<<<<<<<<<
 *             "  %s,\n"
 *             "  explain_columns = %s,\n"
*/
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 8, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 384, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":373
 *         self.explain_columns = explain_columns
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.MatrixWithExplanations.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format_explain_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":396
 * class NeumannZagierTypeEquations(MatrixWithExplanations):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 *         MatrixWithExplanations.__init__(self,
 *                                         mat, explain_rows, explain_columns)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_26NeumannZagierTypeEquations_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_26NeumannZagierTypeEquations_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_26NeumannZagierTypeEquations_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_26NeumannZagierTypeEquations_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_mat = 0;
  PyObject *__pyx_v_explain_rows = 0;
  PyObject *__pyx_v_explain_columns = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_explain_rows,&__pyx_mstate_global->__pyx_n_u_explain_columns,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 396, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 396, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 396, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 396, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 396, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(1, 396, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, i); __PYX_ERR(1, 396, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 396, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 396, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 396, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 396, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_mat = values[1];
    __pyx_v_explain_rows = values[2];
    __pyx_v_explain_columns = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 396, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.NeumannZagierTypeEquations.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_26NeumannZagierTypeEquations___init__(__pyx_self, __pyx_v_self, __pyx_v_mat, __pyx_v_explain_rows, __pyx_v_explain_columns);

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

static PyObject *__pyx_pf_8SnapPyHP_26NeumannZagierTypeEquations___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mat, PyObject *__pyx_v_explain_rows, PyObject *__pyx_v_explain_columns) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":397
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
 *         MatrixWithExplanations.__init__(self,             # <<<<<<<<<<<<<<
 *                                         mat, explain_rows, explain_columns)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":398
 *     def __init__(self, mat, explain_rows, explain_columns):
 *         MatrixWithExplanations.__init__(self,
 *                                         mat, explain_rows, explain_columns)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_self, __pyx_v_mat, __pyx_v_explain_rows, __pyx_v_explain_columns};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":396
 * class NeumannZagierTypeEquations(MatrixWithExplanations):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 *         MatrixWithExplanations.__init__(self,
 *                                         mat, explain_rows, explain_columns)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.NeumannZagierTypeEquations.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":400
 *                                         mat, explain_rows, explain_columns)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return MatrixWithExplanations.__repr__(self,
 *                                                "NeumannZagierTypeEquations")
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_26NeumannZagierTypeEquations_3__repr__(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_8SnapPyHP_26NeumannZagierTypeEquations_3__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_26NeumannZagierTypeEquations_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_26NeumannZagierTypeEquations_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 400, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 400, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 400, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 400, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 400, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.NeumannZagierTypeEquations.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_26NeumannZagierTypeEquations_2__repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_26NeumannZagierTypeEquations_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":401
 * 
 *     def __repr__(self):
 *         return MatrixWithExplanations.__repr__(self,             # <<<<<<<<<<<<<<
 *                                                "NeumannZagierTypeEquations")
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_repr_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":400
 *                                         mat, explain_rows, explain_columns)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return MatrixWithExplanations.__repr__(self,
 *                                                "NeumannZagierTypeEquations")
*/

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

/* "cython/core/basic.pyx":415
 *     Real2gen = Real2gen_string
 * 
 * cdef Complex2gen(Complex C):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Complex to a pari gen.
*/

static PyObject *__pyx_f_8SnapPyHP_Complex2gen(Complex __pyx_v_C) {
  PyObject *__pyx_v_real_part = 0;
  PyObject *__pyx_v_imag_part = 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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Complex2gen", 0);

  /* "cython/core/basic.pyx":419
 *     Convert a Complex to a pari gen.
 *     """
 *     cdef real_part = Real2gen(C.real)             # <<<<<<<<<<<<<<
 *     cdef imag_part = Real2gen(C.imag)
 *     return pari.complex(real_part, imag_part)
*/
  __pyx_t_1 = __pyx_v_8SnapPyHP_Real2gen(__pyx_v_C.real); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_real_part = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":420
 *     """
 *     cdef real_part = Real2gen(C.real)
 *     cdef imag_part = Real2gen(C.imag)             # <<<<<<<<<<<<<<
 *     return pari.complex(real_part, imag_part)
 * 
*/
  __pyx_t_1 = __pyx_v_8SnapPyHP_Real2gen(__pyx_v_C.imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_imag_part = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":421
 *     cdef real_part = Real2gen(C.real)
 *     cdef imag_part = Real2gen(C.imag)
 *     return pari.complex(real_part, imag_part)             # <<<<<<<<<<<<<<
 * 
 * cdef RealImag2gen(Real R, Real I):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_complex); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_real_part, __pyx_v_imag_part};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":415
 *     Real2gen = Real2gen_string
 * 
 * cdef Complex2gen(Complex C):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Complex to a pari gen.
*/

  /* 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("SnapPyHP.Complex2gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_real_part);
  __Pyx_XDECREF(__pyx_v_imag_part);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":423
 *     return pari.complex(real_part, imag_part)
 * 
 * cdef RealImag2gen(Real R, Real I):             # <<<<<<<<<<<<<<
 *     return pari.complex(Real2gen(R), Real2gen(I))
 * 
*/

static PyObject *__pyx_f_8SnapPyHP_RealImag2gen(__pyx_t_8SnapPyHP_Real __pyx_v_R, __pyx_t_8SnapPyHP_Real __pyx_v_I) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("RealImag2gen", 0);

  /* "cython/core/basic.pyx":424
 * 
 * cdef RealImag2gen(Real R, Real I):
 *     return pari.complex(Real2gen(R), Real2gen(I))             # <<<<<<<<<<<<<<
 * 
 * cdef Complex2complex(Complex C):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_complex); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_v_8SnapPyHP_Real2gen(__pyx_v_R); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __pyx_v_8SnapPyHP_Real2gen(__pyx_v_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":423
 *     return pari.complex(real_part, imag_part)
 * 
 * cdef RealImag2gen(Real R, Real I):             # <<<<<<<<<<<<<<
 *     return pari.complex(Real2gen(R), Real2gen(I))
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.RealImag2gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":426
 *     return pari.complex(Real2gen(R), Real2gen(I))
 * 
 * cdef Complex2complex(Complex C):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Complex to a python complex.
*/

static PyObject *__pyx_f_8SnapPyHP_Complex2complex(Complex __pyx_v_C) {
  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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Complex2complex", 0);

  /* "cython/core/basic.pyx":430
 *     Convert a Complex to a python complex.
 *     """
 *     return complex( float(<double>C.real), float(<double>C.imag) )             # <<<<<<<<<<<<<<
 * 
 * cdef Real2float(Real R):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)(&PyComplex_Type));
  __pyx_t_3 = ((PyObject *)(&PyComplex_Type)); 
  __pyx_t_4 = PyFloat_FromDouble(((double)__pyx_v_C.real)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(((double)__pyx_v_C.imag)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":426
 *     return pari.complex(Real2gen(R), Real2gen(I))
 * 
 * cdef Complex2complex(Complex C):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Complex to a python complex.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Complex2complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":432
 *     return complex( float(<double>C.real), float(<double>C.imag) )
 * 
 * cdef Real2float(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a python float.
*/

static PyObject *__pyx_f_8SnapPyHP_Real2float(__pyx_t_8SnapPyHP_Real __pyx_v_R) {
  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("Real2float", 0);

  /* "cython/core/basic.pyx":436
 *     Convert a Real to a python float.
 *     """
 *     return float(<double>R)             # <<<<<<<<<<<<<<
 * 
 * cdef Complex complex2Complex(complex z):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_R)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":432
 *     return complex( float(<double>C.real), float(<double>C.imag) )
 * 
 * cdef Real2float(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a python float.
*/

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

/* "cython/core/basic.pyx":438
 *     return float(<double>R)
 * 
 * cdef Complex complex2Complex(complex z):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a python complex to a Complex.
*/

static Complex __pyx_f_8SnapPyHP_complex2Complex(__pyx_t_double_complex __pyx_v_z) {
  Complex __pyx_v_result;
  Complex __pyx_r;

  /* "cython/core/basic.pyx":443
 *     """
 *     cdef Complex result
 *     result.real = <Real>z.real             # <<<<<<<<<<<<<<
 *     result.imag = <Real>z.imag
 *     return result
*/
  __pyx_v_result.real = ((__pyx_t_8SnapPyHP_Real)__Pyx_CREAL(__pyx_v_z));

  /* "cython/core/basic.pyx":444
 *     cdef Complex result
 *     result.real = <Real>z.real
 *     result.imag = <Real>z.imag             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
  __pyx_v_result.imag = ((__pyx_t_8SnapPyHP_Real)__Pyx_CIMAG(__pyx_v_z));

  /* "cython/core/basic.pyx":445
 *     result.real = <Real>z.real
 *     result.imag = <Real>z.imag
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef Real Object2Real(obj):
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":438
 *     return float(<double>R)
 * 
 * cdef Complex complex2Complex(complex z):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a python complex to a Complex.
*/

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

/* "cython/core/basic.pyx":447
 *     return result
 * 
 * cdef Real Object2Real(obj):             # <<<<<<<<<<<<<<
 *     cdef char* c_string
 *     try:
*/

static __pyx_t_8SnapPyHP_Real __pyx_f_8SnapPyHP_Object2Real(PyObject *__pyx_v_obj) {
  char *__pyx_v_c_string;
  PyObject *__pyx_v_string = NULL;
  __pyx_t_8SnapPyHP_Real __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  double __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  char *__pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Object2Real", 0);

  /* "cython/core/basic.pyx":449
 * cdef Real Object2Real(obj):
 *     cdef char* c_string
 *     try:             # <<<<<<<<<<<<<<
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         # Pari idiosyncratically formats small and large numbers as,
*/
  {
    __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:*/ {

      /* "cython/core/basic.pyx":450
 *     cdef char* c_string
 *     try:
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)             # <<<<<<<<<<<<<<
 *         # Pari idiosyncratically formats small and large numbers as,
 *         # e.g., "1.0 E-10" (note the space before "E").
*/
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 450, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 450, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        __pyx_t_7 = __pyx_v_obj;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_as_string, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 450, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __pyx_t_4 = __pyx_t_5;
        __pyx_t_5 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 450, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __pyx_t_5;
        __pyx_t_5 = 0;
      }
      __pyx_v_string = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":454
 *         # e.g., "1.0 E-10" (note the space before "E").
 *         # Remove it - otherwise it cannot be parsed.
 *         string = string.replace(' ', '')             # <<<<<<<<<<<<<<
 *         float(string)
 *     except:
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_string, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 454, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 454, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_string, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":455
 *         # Remove it - otherwise it cannot be parsed.
 *         string = string.replace(' ', '')
 *         float(string)             # <<<<<<<<<<<<<<
 *     except:
 *         raise ValueError('Cannot convert %s to a Real.' % type(obj))
*/
      __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_v_string); if (unlikely(__pyx_t_9 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(1, 455, __pyx_L3_error)

      /* "cython/core/basic.pyx":449
 * cdef Real Object2Real(obj):
 *     cdef char* c_string
 *     try:             # <<<<<<<<<<<<<<
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         # Pari idiosyncratically formats small and large numbers as,
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/basic.pyx":456
 *         string = string.replace(' ', '')
 *         float(string)
 *     except:             # <<<<<<<<<<<<<<
 *         raise ValueError('Cannot convert %s to a Real.' % type(obj))
 *     string = to_byte_str(string)
*/
    /*except:*/ {
      __Pyx_AddTraceback("SnapPyHP.Object2Real", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 456, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "cython/core/basic.pyx":457
 *         float(string)
 *     except:
 *         raise ValueError('Cannot convert %s to a Real.' % type(obj))             # <<<<<<<<<<<<<<
 *     string = to_byte_str(string)
 *     c_string = string
*/
      __pyx_t_11 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_12 = __pyx_builtin_ValueError; 
      __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Cannot_convert_s_to_a_Real, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 457, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_8 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_13};
        __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 457, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_ERR(1, 457, __pyx_L5_except_error)
    }

    /* "cython/core/basic.pyx":449
 * cdef Real Object2Real(obj):
 *     cdef char* c_string
 *     try:             # <<<<<<<<<<<<<<
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         # Pari idiosyncratically formats small and large numbers as,
*/
    __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_L8_try_end:;
  }

  /* "cython/core/basic.pyx":458
 *     except:
 *         raise ValueError('Cannot convert %s to a Real.' % type(obj))
 *     string = to_byte_str(string)             # <<<<<<<<<<<<<<
 *     c_string = string
 *     return Real_from_string(c_string)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_string};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __Pyx_DECREF_SET(__pyx_v_string, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "cython/core/basic.pyx":459
 *         raise ValueError('Cannot convert %s to a Real.' % type(obj))
 *     string = to_byte_str(string)
 *     c_string = string             # <<<<<<<<<<<<<<
 *     return Real_from_string(c_string)
 * 
*/
  __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_string); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(1, 459, __pyx_L1_error)
  __pyx_v_c_string = __pyx_t_14;

  /* "cython/core/basic.pyx":460
 *     string = to_byte_str(string)
 *     c_string = string
 *     return Real_from_string(c_string)             # <<<<<<<<<<<<<<
 * 
 * cdef Complex Object2Complex(obj):
*/
  __pyx_r = Real_from_string(__pyx_v_c_string);
  goto __pyx_L0;

  /* "cython/core/basic.pyx":447
 *     return result
 * 
 * cdef Real Object2Real(obj):             # <<<<<<<<<<<<<<
 *     cdef char* c_string
 *     try:
*/

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPyHP.Object2Real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_string);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":462
 *     return Real_from_string(c_string)
 * 
 * cdef Complex Object2Complex(obj):             # <<<<<<<<<<<<<<
 *     cdef Real real, imag
 *     cdef Complex result
*/

static Complex __pyx_f_8SnapPyHP_Object2Complex(PyObject *__pyx_v_obj) {
  __pyx_t_8SnapPyHP_Real __pyx_v_real;
  __pyx_t_8SnapPyHP_Real __pyx_v_imag;
  Complex __pyx_v_result;
  Complex __pyx_r;
  __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;
  double __pyx_t_7;
  __pyx_t_8SnapPyHP_Real __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Object2Complex", 0);

  /* "cython/core/basic.pyx":465
 *     cdef Real real, imag
 *     cdef Complex result
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):             # <<<<<<<<<<<<<<
 *         try:
 *             float(obj.real)
*/
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 465, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 465, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":466
 *     cdef Complex result
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.real)
 *             real = Object2Real(obj.real)
*/
    {
      __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:*/ {

        /* "cython/core/basic.pyx":467
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):
 *         try:
 *             float(obj.real)             # <<<<<<<<<<<<<<
 *             real = Object2Real(obj.real)
 *         except TypeError:  # Probably Sage type
*/
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 467, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_6); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(1, 467, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/basic.pyx":468
 *         try:
 *             float(obj.real)
 *             real = Object2Real(obj.real)             # <<<<<<<<<<<<<<
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())
*/
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 468, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __pyx_f_8SnapPyHP_Object2Real(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 468, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_real = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

        /* "cython/core/basic.pyx":466
 *     cdef Complex result
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.real)
 *             real = Object2Real(obj.real)
*/
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/basic.pyx":469
 *             float(obj.real)
 *             real = Object2Real(obj.real)
 *         except TypeError:  # Probably Sage type             # <<<<<<<<<<<<<<
 *             real = Object2Real(obj.real())
 *         try:
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("SnapPyHP.Object2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(1, 469, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);

        /* "cython/core/basic.pyx":470
 *             real = Object2Real(obj.real)
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())             # <<<<<<<<<<<<<<
 *         try:
 *             float(obj.imag)
*/
        __pyx_t_13 = __pyx_v_obj;
        __Pyx_INCREF(__pyx_t_13);
        __pyx_t_14 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
          __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_real, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 470, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_12);
        }
        __pyx_t_8 = __pyx_f_8SnapPyHP_Object2Real(__pyx_t_12); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 470, __pyx_L8_except_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_real = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;

      /* "cython/core/basic.pyx":466
 *     cdef Complex result
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.real)
 *             real = Object2Real(obj.real)
*/
      __pyx_L8_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_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L11_try_end:;
    }

    /* "cython/core/basic.pyx":471
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.imag)
 *             imag = Object2Real(obj.imag)
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      /*try:*/ {

        /* "cython/core/basic.pyx":472
 *             real = Object2Real(obj.real())
 *         try:
 *             float(obj.imag)             # <<<<<<<<<<<<<<
 *             imag = Object2Real(obj.imag)
 *         except TypeError:  # Probably Sage type
*/
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 472, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_11); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(1, 472, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cython/core/basic.pyx":473
 *         try:
 *             float(obj.imag)
 *             imag = Object2Real(obj.imag)             # <<<<<<<<<<<<<<
 *         except TypeError:  # Probably Sage type
 *             imag = Object2Real(obj.imag())
*/
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 473, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_8 = __pyx_f_8SnapPyHP_Object2Real(__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 473, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_v_imag = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

        /* "cython/core/basic.pyx":471
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.imag)
 *             imag = Object2Real(obj.imag)
*/
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L19_try_end;
      __pyx_L14_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/basic.pyx":474
 *             float(obj.imag)
 *             imag = Object2Real(obj.imag)
 *         except TypeError:  # Probably Sage type             # <<<<<<<<<<<<<<
 *             imag = Object2Real(obj.imag())
 *     else:
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("SnapPyHP.Object2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_6) < 0) __PYX_ERR(1, 474, __pyx_L16_except_error)
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_6);

        /* "cython/core/basic.pyx":475
 *             imag = Object2Real(obj.imag)
 *         except TypeError:  # Probably Sage type
 *             imag = Object2Real(obj.imag())             # <<<<<<<<<<<<<<
 *     else:
 *         real = Object2Real(obj)
*/
        __pyx_t_13 = __pyx_v_obj;
        __Pyx_INCREF(__pyx_t_13);
        __pyx_t_14 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
          __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_imag, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 475, __pyx_L16_except_error)
          __Pyx_GOTREF(__pyx_t_12);
        }
        __pyx_t_8 = __pyx_f_8SnapPyHP_Object2Real(__pyx_t_12); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 475, __pyx_L16_except_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_imag = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L15_exception_handled;
      }
      goto __pyx_L16_except_error;

      /* "cython/core/basic.pyx":471
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.imag)
 *             imag = Object2Real(obj.imag)
*/
      __pyx_L16_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      goto __pyx_L1_error;
      __pyx_L15_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      __pyx_L19_try_end:;
    }

    /* "cython/core/basic.pyx":465
 *     cdef Real real, imag
 *     cdef Complex result
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):             # <<<<<<<<<<<<<<
 *         try:
 *             float(obj.real)
*/
    goto __pyx_L3;
  }

  /* "cython/core/basic.pyx":477
 *             imag = Object2Real(obj.imag())
 *     else:
 *         real = Object2Real(obj)             # <<<<<<<<<<<<<<
 *         imag = <Real>0.0
 *     result.real = real
*/
  /*else*/ {
    __pyx_t_8 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 477, __pyx_L1_error)
    __pyx_v_real = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

    /* "cython/core/basic.pyx":478
 *     else:
 *         real = Object2Real(obj)
 *         imag = <Real>0.0             # <<<<<<<<<<<<<<
 *     result.real = real
 *     result.imag = imag
*/
    __pyx_v_imag = ((__pyx_t_8SnapPyHP_Real)0.0);
  }
  __pyx_L3:;

  /* "cython/core/basic.pyx":479
 *         real = Object2Real(obj)
 *         imag = <Real>0.0
 *     result.real = real             # <<<<<<<<<<<<<<
 *     result.imag = imag
 *     return result
*/
  __pyx_v_result.real = __pyx_v_real;

  /* "cython/core/basic.pyx":480
 *         imag = <Real>0.0
 *     result.real = real
 *     result.imag = imag             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
  __pyx_v_result.imag = __pyx_v_imag;

  /* "cython/core/basic.pyx":481
 *     result.real = real
 *     result.imag = imag
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":462
 *     return Real_from_string(c_string)
 * 
 * cdef Complex Object2Complex(obj):             # <<<<<<<<<<<<<<
 *     cdef Real real, imag
 *     cdef Complex result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPyHP.Object2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":484
 * 
 * 
 * cdef double Real2double(Real R):             # <<<<<<<<<<<<<<
 *     cdef double* quad = <double *>&R
 *     return quad[0]
*/

static double __pyx_f_8SnapPyHP_Real2double(__pyx_t_8SnapPyHP_Real __pyx_v_R) {
  double *__pyx_v_quad;
  double __pyx_r;

  /* "cython/core/basic.pyx":485
 * 
 * cdef double Real2double(Real R):
 *     cdef double* quad = <double *>&R             # <<<<<<<<<<<<<<
 *     return quad[0]
 * 
*/
  __pyx_v_quad = ((double *)(&__pyx_v_R));

  /* "cython/core/basic.pyx":486
 * cdef double Real2double(Real R):
 *     cdef double* quad = <double *>&R
 *     return quad[0]             # <<<<<<<<<<<<<<
 * 
 * cdef B2B(Boolean B):
*/
  __pyx_r = (__pyx_v_quad[0]);
  goto __pyx_L0;

  /* "cython/core/basic.pyx":484
 * 
 * 
 * cdef double Real2double(Real R):             # <<<<<<<<<<<<<<
 *     cdef double* quad = <double *>&R
 *     return quad[0]
*/

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

/* "cython/core/basic.pyx":488
 *     return quad[0]
 * 
 * cdef B2B(Boolean B):             # <<<<<<<<<<<<<<
 *     return B != 0
 * 
*/

static PyObject *__pyx_f_8SnapPyHP_B2B(Boolean __pyx_v_B) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("B2B", 0);

  /* "cython/core/basic.pyx":489
 * 
 * cdef B2B(Boolean B):
 *     return B != 0             # <<<<<<<<<<<<<<
 * 
 * # Infos are immutable containers which hold information about SnapPy
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_B != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":488
 *     return quad[0]
 * 
 * cdef B2B(Boolean B):             # <<<<<<<<<<<<<<
 *     return B != 0
 * 
*/

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

/* "cython/core/basic.pyx":503
 *     Initialize with keyword arguments, or **dict.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_4Info_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_4Info_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_4Info_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_4Info_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kwargs = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 503, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 503, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < 0) __PYX_ERR(1, 503, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 503, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 503, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 503, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("SnapPyHP.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_4Info___init__(__pyx_self, __pyx_v_self, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_8SnapPyHP_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_content = NULL;
  PyObject *__pyx_v_old = NULL;
  PyObject *__pyx_v_new = 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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":505
 *     def __init__(self, **kwargs):
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)             # <<<<<<<<<<<<<<
 *         for old, new in self._obsolete.items():
 *             try:
*/
  __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_content = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":506
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():             # <<<<<<<<<<<<<<
 *             try:
 *                 content[old] = content[new]
*/
  __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_obsolete); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(1, 506, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":507
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 content[old] = content[new]
 *             except KeyError:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "cython/core/basic.pyx":508
 *         for old, new in self._obsolete.items():
 *             try:
 *                 content[old] = content[new]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 pass
*/
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_content, __pyx_v_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 508, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely((PyDict_SetItem(__pyx_v_content, __pyx_v_old, __pyx_t_5) < 0))) __PYX_ERR(1, 508, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cython/core/basic.pyx":507
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 content[old] = content[new]
 *             except KeyError:
*/
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/basic.pyx":509
 *             try:
 *                 content[old] = content[new]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 pass
 *         super(Info, self).__init__(content)
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_7) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;

      /* "cython/core/basic.pyx":507
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 content[old] = content[new]
 *             except KeyError:
*/
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __pyx_L12_try_end:;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":511
 *             except KeyError:
 *                 pass
 *         super(Info, self).__init__(content)             # <<<<<<<<<<<<<<
 *         self.__dict__.update(kwargs)
 * 
*/
  __pyx_t_11 = NULL;
  __Pyx_INCREF(__pyx_builtin_super);
  __pyx_t_12 = __pyx_builtin_super; 
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Info); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_13, __pyx_v_self};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_5 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_14 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_content};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":512
 *                 pass
 *         super(Info, self).__init__(content)
 *         self.__dict__.update(kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def _immutable(self, *args):
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_14 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":503
 *     Initialize with keyword arguments, or **dict.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPyHP.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_content);
  __Pyx_XDECREF(__pyx_v_old);
  __Pyx_XDECREF(__pyx_v_new);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":514
 *         self.__dict__.update(kwargs)
 * 
 *     def _immutable(self, *args):             # <<<<<<<<<<<<<<
 *         raise AttributeError('Info objects are immutable.')
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_4Info_3_immutable(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_8SnapPyHP_4Info_3_immutable = {"_immutable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_4Info_3_immutable, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_4Info_3_immutable(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 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("_immutable (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs);
  if (unlikely(!__pyx_v_args)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_v_args);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 514, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 514, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, used_pos_args, __pyx_kwds_len, "_immutable", 0) < 0) __PYX_ERR(1, 514, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_immutable", 0, 1, 1, i); __PYX_ERR(1, 514, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs < 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 514, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_immutable", 0, 1, 1, __pyx_nargs); __PYX_ERR(1, 514, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("SnapPyHP.Info._immutable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_4Info_2_immutable(__pyx_self, __pyx_v_self, __pyx_v_args);

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

static PyObject *__pyx_pf_8SnapPyHP_4Info_2_immutable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_immutable", 0);

  /* "cython/core/basic.pyx":515
 * 
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')             # <<<<<<<<<<<<<<
 * 
 *     def keys(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_AttributeError);
  __pyx_t_3 = __pyx_builtin_AttributeError; 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Info_objects_are_immutable};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 515, __pyx_L1_error)

  /* "cython/core/basic.pyx":514
 *         self.__dict__.update(kwargs)
 * 
 *     def _immutable(self, *args):             # <<<<<<<<<<<<<<
 *         raise AttributeError('Info objects are immutable.')
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.Info._immutable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":517
 *         raise AttributeError('Info objects are immutable.')
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return self.__dict__.keys()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_4Info_5keys(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_8SnapPyHP_4Info_5keys = {"keys", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_4Info_5keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_4Info_5keys(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keys (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 517, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "keys", 0) < 0) __PYX_ERR(1, 517, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("keys", 1, 1, 1, i); __PYX_ERR(1, 517, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 517, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("keys", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 517, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Info.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_4Info_4keys(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_4Info_4keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("keys", 0);

  /* "cython/core/basic.pyx":518
 * 
 *     def keys(self):
 *         return self.__dict__.keys()             # <<<<<<<<<<<<<<
 * 
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_keys, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":517
 *         raise AttributeError('Info objects are immutable.')
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return self.__dict__.keys()
 * 
*/

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

/* "cython/core/basic.pyx":526
 * 
 * class CuspInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_complete:
 *             if 'shape' in self:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8CuspInfo_1__repr__(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_8SnapPyHP_8CuspInfo_1__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8CuspInfo_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8CuspInfo_1__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 526, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 526, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 526, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 526, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 526, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 526, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CuspInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8CuspInfo___repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_8CuspInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[6];
  PyObject *__pyx_t_7[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":527
 * class CuspInfo(Info):
 *     def __repr__(self):
 *         if self.is_complete:             # <<<<<<<<<<<<<<
 *             if 'shape' in self:
 *                 return ('Cusp %-2d: complete %s of shape %s' %
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_is_complete); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 527, __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(1, 527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":528
 *     def __repr__(self):
 *         if self.is_complete:
 *             if 'shape' in self:             # <<<<<<<<<<<<<<
 *                 return ('Cusp %-2d: complete %s of shape %s' %
 *                         (self.index, self.topology, self.shape) )
*/
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_shape, __pyx_v_self, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 528, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":529
 *         if self.is_complete:
 *             if 'shape' in self:
 *                 return ('Cusp %-2d: complete %s of shape %s' %             # <<<<<<<<<<<<<<
 *                         (self.index, self.topology, self.shape) )
 *             else:
*/
      __Pyx_XDECREF(__pyx_r);

      /* "cython/core/basic.pyx":530
 *             if 'shape' in self:
 *                 return ('Cusp %-2d: complete %s of shape %s' %
 *                         (self.index, self.topology, self.shape) )             # <<<<<<<<<<<<<<
 *             else:
 *                 return ('Cusp %-2d: %s, not filled'%
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_kp_u_2d); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_topology); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cusp;
      __pyx_t_6[1] = __pyx_t_3;
      __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_complete;
      __pyx_t_6[3] = __pyx_t_4;
      __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_of_shape;
      __pyx_t_6[5] = __pyx_t_5;

      /* "cython/core/basic.pyx":529
 *         if self.is_complete:
 *             if 'shape' in self:
 *                 return ('Cusp %-2d: complete %s of shape %s' %             # <<<<<<<<<<<<<<
 *                         (self.index, self.topology, self.shape) )
 *             else:
*/
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 6, 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 529, __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_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cython/core/basic.pyx":528
 *     def __repr__(self):
 *         if self.is_complete:
 *             if 'shape' in self:             # <<<<<<<<<<<<<<
 *                 return ('Cusp %-2d: complete %s of shape %s' %
 *                         (self.index, self.topology, self.shape) )
*/
    }

    /* "cython/core/basic.pyx":532
 *                         (self.index, self.topology, self.shape) )
 *             else:
 *                 return ('Cusp %-2d: %s, not filled'%             # <<<<<<<<<<<<<<
 *                         (self.index, self.topology) )
 *         else:
*/
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);

      /* "cython/core/basic.pyx":533
 *             else:
 *                 return ('Cusp %-2d: %s, not filled'%
 *                         (self.index, self.topology) )             # <<<<<<<<<<<<<<
 *         else:
 *             return ('Cusp %-2d: %s with Dehn filling coefficients (M, L) = %s'%
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_kp_u_2d); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_topology); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Cusp;
      __pyx_t_7[1] = __pyx_t_5;
      __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__11;
      __pyx_t_7[3] = __pyx_t_4;
      __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_not_filled;

      /* "cython/core/basic.pyx":532
 *                         (self.index, self.topology, self.shape) )
 *             else:
 *                 return ('Cusp %-2d: %s, not filled'%             # <<<<<<<<<<<<<<
 *                         (self.index, self.topology) )
 *         else:
*/
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 12, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cython/core/basic.pyx":527
 * class CuspInfo(Info):
 *     def __repr__(self):
 *         if self.is_complete:             # <<<<<<<<<<<<<<
 *             if 'shape' in self:
 *                 return ('Cusp %-2d: complete %s of shape %s' %
*/
  }

  /* "cython/core/basic.pyx":535
 *                         (self.index, self.topology) )
 *         else:
 *             return ('Cusp %-2d: %s with Dehn filling coefficients (M, L) = %s'%             # <<<<<<<<<<<<<<
 *                     (self.index, self.topology, self.filling) )
 *     _obsolete = {'complete?'          : 'is_complete',
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/basic.pyx":536
 *         else:
 *             return ('Cusp %-2d: %s with Dehn filling coefficients (M, L) = %s'%
 *                     (self.index, self.topology, self.filling) )             # <<<<<<<<<<<<<<
 *     _obsolete = {'complete?'          : 'is_complete',
 *                  'holonomy precision' : 'holonomy_accuracy',
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_kp_u_2d); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_topology); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_filling); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cusp;
    __pyx_t_6[1] = __pyx_t_4;
    __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__11;
    __pyx_t_6[3] = __pyx_t_5;
    __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_with_Dehn_filling_coefficients;
    __pyx_t_6[5] = __pyx_t_3;

    /* "cython/core/basic.pyx":535
 *                         (self.index, self.topology) )
 *         else:
 *             return ('Cusp %-2d: %s with Dehn filling coefficients (M, L) = %s'%             # <<<<<<<<<<<<<<
 *                     (self.index, self.topology, self.filling) )
 *     _obsolete = {'complete?'          : 'is_complete',
*/
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 6, 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 41 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/basic.pyx":526
 * 
 * class CuspInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_complete:
 *             if 'shape' in self:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CuspInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":543
 * 
 * class DualCurveInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('%3d: %s curve of length %s'%
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13DualCurveInfo_1__repr__(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_8SnapPyHP_13DualCurveInfo_1__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13DualCurveInfo_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13DualCurveInfo_1__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 543, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 543, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 543, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 543, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 543, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 543, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.DualCurveInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13DualCurveInfo___repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_13DualCurveInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":544
 * class DualCurveInfo(Info):
 *     def __repr__(self):
 *         return ('%3d: %s curve of length %s'%             # <<<<<<<<<<<<<<
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
 *     _obsolete = {'complete length' : 'complete_length',
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/basic.pyx":545
 *     def __repr__(self):
 *         return ('%3d: %s curve of length %s'%
 *                 (self.index, MatrixParity[self.parity], self.filled_length))             # <<<<<<<<<<<<<<
 *     _obsolete = {'complete length' : 'complete_length',
 *                  'filled length' : 'filled_length'}
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_kp_u_3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MatrixParity); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_parity); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_filled_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5[0] = __pyx_t_2;
  __pyx_t_5[1] = __pyx_mstate_global->__pyx_kp_u__11;
  __pyx_t_5[2] = __pyx_t_3;
  __pyx_t_5[3] = __pyx_mstate_global->__pyx_kp_u_curve_of_length;
  __pyx_t_5[4] = __pyx_t_1;

  /* "cython/core/basic.pyx":544
 * class DualCurveInfo(Info):
 *     def __repr__(self):
 *         return ('%3d: %s curve of length %s'%             # <<<<<<<<<<<<<<
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
 *     _obsolete = {'complete length' : 'complete_length',
*/
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 544, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":543
 * 
 * class DualCurveInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('%3d: %s curve of length %s'%
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
*/

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

/* "cython/core/basic.pyx":550
 * 
 * 
 * def _StrLongestLen(l):             # <<<<<<<<<<<<<<
 *     return str(max(len(e) for e in l))
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_25_StrLongestLen(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_8SnapPyHP_25_StrLongestLen = {"_StrLongestLen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_25_StrLongestLen, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_25_StrLongestLen(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_l = 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("_StrLongestLen (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_l,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 550, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 550, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_StrLongestLen", 0) < 0) __PYX_ERR(1, 550, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_StrLongestLen", 1, 1, 1, i); __PYX_ERR(1, 550, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 550, __pyx_L3_error)
    }
    __pyx_v_l = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_StrLongestLen", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 550, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP._StrLongestLen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_24_StrLongestLen(__pyx_self, __pyx_v_l);

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

/* "cython/core/basic.pyx":551
 * 
 * def _StrLongestLen(l):
 *     return str(max(len(e) for e in l))             # <<<<<<<<<<<<<<
 * 
 * 
*/

static PyObject *__pyx_pf_8SnapPyHP_14_StrLongestLen_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct__genexpr *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 551, __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_8SnapPyHP_14_StrLongestLen_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_StrLongestLen_locals_genexpr, __pyx_mstate_global->__pyx_n_u_SnapPyHP); if (unlikely(!gen)) __PYX_ERR(1, 551, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPyHP._StrLongestLen.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_8SnapPyHP_14_StrLongestLen_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___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;
  Py_ssize_t __pyx_t_5;
  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 != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(1, 551, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(1, 551, __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(1, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 551, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 551, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 551, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 551, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 551, __pyx_L1_error)
          PyErr_Clear();
        }
        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 = PyObject_Length(__pyx_cur_scope->__pyx_v_e); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 551, __pyx_L1_error)
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 551, __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(1, 551, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __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;
}

/* "cython/core/basic.pyx":550
 * 
 * 
 * def _StrLongestLen(l):             # <<<<<<<<<<<<<<
 *     return str(max(len(e) for e in l))
 * 
*/

static PyObject *__pyx_pf_8SnapPyHP_24_StrLongestLen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l) {
  PyObject *__pyx_gb_8SnapPyHP_14_StrLongestLen_2generator = 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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_StrLongestLen", 0);

  /* "cython/core/basic.pyx":551
 * 
 * def _StrLongestLen(l):
 *     return str(max(len(e) for e in l))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_max);
  __pyx_t_3 = __pyx_builtin_max; 
  __pyx_t_4 = __pyx_pf_8SnapPyHP_14_StrLongestLen_genexpr(NULL, __pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 551, __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;

  /* "cython/core/basic.pyx":550
 * 
 * 
 * def _StrLongestLen(l):             # <<<<<<<<<<<<<<
 *     return str(max(len(e) for e in l))
 * 
*/

  /* 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("SnapPyHP._StrLongestLen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_8SnapPyHP_14_StrLongestLen_2generator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":572
 * 
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         lenStr = "%17.14f" % self.length.real()
 *         absImag = abs(self.length.imag())
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18LengthSpectrumInfo_1__repr__(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_8SnapPyHP_18LengthSpectrumInfo_1__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18LengthSpectrumInfo_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_18LengthSpectrumInfo_1__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 572, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 572, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 572, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 572, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 572, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 572, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.LengthSpectrumInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_18LengthSpectrumInfo___repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_18LengthSpectrumInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_lenStr = NULL;
  PyObject *__pyx_v_absImag = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":573
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):
 *         lenStr = "%17.14f" % self.length.real()             # <<<<<<<<<<<<<<
 *         absImag = abs(self.length.imag())
 *         if absImag > 1e-9:
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_real, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_17_14f, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_lenStr = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":574
 *     def __repr__(self):
 *         lenStr = "%17.14f" % self.length.real()
 *         absImag = abs(self.length.imag())             # <<<<<<<<<<<<<<
 *         if absImag > 1e-9:
 *             if self.length.imag() > 0:
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_imag, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_absImag = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":575
 *         lenStr = "%17.14f" % self.length.real()
 *         absImag = abs(self.length.imag())
 *         if absImag > 1e-9:             # <<<<<<<<<<<<<<
 *             if self.length.imag() > 0:
 *                 lenStr += " + "
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_absImag, __pyx_mstate_global->__pyx_float_1eneg_9, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "cython/core/basic.pyx":576
 *         absImag = abs(self.length.imag())
 *         if absImag > 1e-9:
 *             if self.length.imag() > 0:             # <<<<<<<<<<<<<<
 *                 lenStr += " + "
 *             else:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_imag, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {

      /* "cython/core/basic.pyx":577
 *         if absImag > 1e-9:
 *             if self.length.imag() > 0:
 *                 lenStr += " + "             # <<<<<<<<<<<<<<
 *             else:
 *                 lenStr += " - "
*/
      __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_lenStr, __pyx_mstate_global->__pyx_kp_u__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_lenStr, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":576
 *         absImag = abs(self.length.imag())
 *         if absImag > 1e-9:
 *             if self.length.imag() > 0:             # <<<<<<<<<<<<<<
 *                 lenStr += " + "
 *             else:
*/
      goto __pyx_L4;
    }

    /* "cython/core/basic.pyx":579
 *                 lenStr += " + "
 *             else:
 *                 lenStr += " - "             # <<<<<<<<<<<<<<
 *             lenStr += "%16.14f*I" % absImag
 * 
*/
    /*else*/ {
      __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_lenStr, __pyx_mstate_global->__pyx_kp_u__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_lenStr, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;
    }
    __pyx_L4:;

    /* "cython/core/basic.pyx":580
 *             else:
 *                 lenStr += " - "
 *             lenStr += "%16.14f*I" % absImag             # <<<<<<<<<<<<<<
 * 
 *         if 'word' in self:
*/
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_16_14f_I, __pyx_v_absImag); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_lenStr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_lenStr, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":575
 *         lenStr = "%17.14f" % self.length.real()
 *         absImag = abs(self.length.imag())
 *         if absImag > 1e-9:             # <<<<<<<<<<<<<<
 *             if self.length.imag() > 0:
 *                 lenStr += " + "
*/
  }

  /* "cython/core/basic.pyx":582
 *             lenStr += "%16.14f*I" % absImag
 * 
 *         if 'word' in self:             # <<<<<<<<<<<<<<
 *             return LengthSpectrumFormatStringWithWord % (
 *                 self.multiplicity,
*/
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_word, __pyx_v_self, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 582, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "cython/core/basic.pyx":583
 * 
 *         if 'word' in self:
 *             return LengthSpectrumFormatStringWithWord % (             # <<<<<<<<<<<<<<
 *                 self.multiplicity,
 *                 lenStr,
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatStringWithWo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/basic.pyx":584
 *         if 'word' in self:
 *             return LengthSpectrumFormatStringWithWord % (
 *                 self.multiplicity,             # <<<<<<<<<<<<<<
 *                 lenStr,
 *                 self.topology,
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multiplicity); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/basic.pyx":586
 *                 self.multiplicity,
 *                 lenStr,
 *                 self.topology,             # <<<<<<<<<<<<<<
 *                 ShortMatrixParity[self.parity],
 *                 self.word)
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_topology); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/basic.pyx":587
 *                 lenStr,
 *                 self.topology,
 *                 ShortMatrixParity[self.parity],             # <<<<<<<<<<<<<<
 *                 self.word)
 *         else:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ShortMatrixParity); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_parity); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/basic.pyx":588
 *                 self.topology,
 *                 ShortMatrixParity[self.parity],
 *                 self.word)             # <<<<<<<<<<<<<<
 *         else:
 *             return LengthSpectrumFormatString % (
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_word); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cython/core/basic.pyx":584
 *         if 'word' in self:
 *             return LengthSpectrumFormatStringWithWord % (
 *                 self.multiplicity,             # <<<<<<<<<<<<<<
 *                 lenStr,
 *                 self.topology,
*/
    __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 584, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_lenStr);
    __Pyx_GIVEREF(__pyx_v_lenStr);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_lenStr) != (0)) __PYX_ERR(1, 584, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 584, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_8) != (0)) __PYX_ERR(1, 584, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_7) != (0)) __PYX_ERR(1, 584, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;

    /* "cython/core/basic.pyx":583
 * 
 *         if 'word' in self:
 *             return LengthSpectrumFormatStringWithWord % (             # <<<<<<<<<<<<<<
 *                 self.multiplicity,
 *                 lenStr,
*/
    __pyx_t_7 = PyNumber_Remainder(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "cython/core/basic.pyx":582
 *             lenStr += "%16.14f*I" % absImag
 * 
 *         if 'word' in self:             # <<<<<<<<<<<<<<
 *             return LengthSpectrumFormatStringWithWord % (
 *                 self.multiplicity,
*/
  }

  /* "cython/core/basic.pyx":590
 *                 self.word)
 *         else:
 *             return LengthSpectrumFormatString % (             # <<<<<<<<<<<<<<
 *                 self.multiplicity,
 *                 lenStr,
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatString); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cython/core/basic.pyx":591
 *         else:
 *             return LengthSpectrumFormatString % (
 *                 self.multiplicity,             # <<<<<<<<<<<<<<
 *                 lenStr,
 *                 self.topology,
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multiplicity); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "cython/core/basic.pyx":593
 *                 self.multiplicity,
 *                 lenStr,
 *                 self.topology,             # <<<<<<<<<<<<<<
 *                 ShortMatrixParity[self.parity] )
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_topology); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/basic.pyx":594
 *                 lenStr,
 *                 self.topology,
 *                 ShortMatrixParity[self.parity] )             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ShortMatrixParity); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_parity); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/basic.pyx":591
 *         else:
 *             return LengthSpectrumFormatString % (
 *                 self.multiplicity,             # <<<<<<<<<<<<<<
 *                 lenStr,
 *                 self.topology,
*/
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __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) != (0)) __PYX_ERR(1, 591, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_lenStr);
    __Pyx_GIVEREF(__pyx_v_lenStr);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_lenStr) != (0)) __PYX_ERR(1, 591, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 591, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1) != (0)) __PYX_ERR(1, 591, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":590
 *                 self.word)
 *         else:
 *             return LengthSpectrumFormatString % (             # <<<<<<<<<<<<<<
 *                 self.multiplicity,
 *                 lenStr,
*/
    __pyx_t_1 = PyNumber_Remainder(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/basic.pyx":572
 * 
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         lenStr = "%17.14f" % self.length.real()
 *         absImag = abs(self.length.imag())
*/

  /* 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_8);
  __Pyx_AddTraceback("SnapPyHP.LengthSpectrumInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lenStr);
  __Pyx_XDECREF(__pyx_v_absImag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":600
 *     _obsolete = {'precision' : 'accuracies'}
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.__dict__)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_9ShapeInfo_1__repr__(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_8SnapPyHP_9ShapeInfo_1__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_9ShapeInfo_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_9ShapeInfo_1__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 600, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 600, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 600, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 600, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 600, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 600, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ShapeInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_9ShapeInfo___repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_9ShapeInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":601
 * 
 *     def __repr__(self):
 *         return repr(self.__dict__)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 601, __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;

  /* "cython/core/basic.pyx":600
 *     _obsolete = {'precision' : 'accuracies'}
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.__dict__)
 * 
*/

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

/* "cython/core/basic.pyx":605
 * 
 * class NormalSurfaceInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
 *         sided = 'two-sided' if self.two_sided else 'one-sided'
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17NormalSurfaceInfo_1__repr__(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_8SnapPyHP_17NormalSurfaceInfo_1__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17NormalSurfaceInfo_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17NormalSurfaceInfo_1__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 605, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 605, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 605, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 605, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 605, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 605, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.NormalSurfaceInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17NormalSurfaceInfo___repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_17NormalSurfaceInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_orient = NULL;
  PyObject *__pyx_v_sided = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":606
 * class NormalSurfaceInfo(Info):
 *     def __repr__(self):
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'             # <<<<<<<<<<<<<<
 *         sided = 'two-sided' if self.two_sided else 'one-sided'
 *         return '%s %s with euler = %s' % (orient, sided, self.euler)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_orientable); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 606, __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(1, 606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Orientable);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_Orientable;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Non_orientable);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u_Non_orientable;
  }
  __pyx_v_orient = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":607
 *     def __repr__(self):
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
 *         sided = 'two-sided' if self.two_sided else 'one-sided'             # <<<<<<<<<<<<<<
 *         return '%s %s with euler = %s' % (orient, sided, self.euler)
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_two_sided); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __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(1, 607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_two_sided_2);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u_two_sided_2;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_one_sided);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u_one_sided;
  }
  __pyx_v_sided = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":608
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
 *         sided = 'two-sided' if self.two_sided else 'one-sided'
 *         return '%s %s with euler = %s' % (orient, sided, self.euler)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_orient); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_sided); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_euler); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6[0] = __pyx_t_1;
  __pyx_t_6[1] = __pyx_mstate_global->__pyx_kp_u__9;
  __pyx_t_6[2] = __pyx_t_2;
  __pyx_t_6[3] = __pyx_mstate_global->__pyx_kp_u_with_euler;
  __pyx_t_6[4] = __pyx_t_5;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 608, __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_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":605
 * 
 * class NormalSurfaceInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
 *         sided = 'two-sided' if self.two_sided else 'one-sided'
*/

  /* 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_AddTraceback("SnapPyHP.NormalSurfaceInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_orient);
  __Pyx_XDECREF(__pyx_v_sided);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":612
 * 
 * class LengthSpectrum(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if len(self) > 0 and 'word' in self[0]:
 *             base = LengthSpectrumFormatStringWithWord % (
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14LengthSpectrum_1__repr__(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_8SnapPyHP_14LengthSpectrum_1__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14LengthSpectrum_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14LengthSpectrum_1__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 612, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 612, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 612, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 612, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 612, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 612, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.LengthSpectrum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14LengthSpectrum___repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_14LengthSpectrum___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_base = NULL;
  PyObject *__pyx_8genexpr6__pyx_v_s = 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":613
 * class LengthSpectrum(list):
 *     def __repr__(self):
 *         if len(self) > 0 and 'word' in self[0]:             # <<<<<<<<<<<<<<
 *             base = LengthSpectrumFormatStringWithWord % (
 *                 'mult', ' length', 'topology', 'parity', 'word')
*/
  __pyx_t_2 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 613, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_word, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 613, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":614
 *     def __repr__(self):
 *         if len(self) > 0 and 'word' in self[0]:
 *             base = LengthSpectrumFormatStringWithWord % (             # <<<<<<<<<<<<<<
 *                 'mult', ' length', 'topology', 'parity', 'word')
 *         else:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatStringWithWo); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/basic.pyx":615
 *         if len(self) > 0 and 'word' in self[0]:
 *             base = LengthSpectrumFormatStringWithWord % (
 *                 'mult', ' length', 'topology', 'parity', 'word')             # <<<<<<<<<<<<<<
 *         else:
 *             base = LengthSpectrumFormatString % (
*/
    __pyx_t_5 = PyNumber_Remainder(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_base = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":613
 * class LengthSpectrum(list):
 *     def __repr__(self):
 *         if len(self) > 0 and 'word' in self[0]:             # <<<<<<<<<<<<<<
 *             base = LengthSpectrumFormatStringWithWord % (
 *                 'mult', ' length', 'topology', 'parity', 'word')
*/
    goto __pyx_L3;
  }

  /* "cython/core/basic.pyx":617
 *                 'mult', ' length', 'topology', 'parity', 'word')
 *         else:
 *             base = LengthSpectrumFormatString % (             # <<<<<<<<<<<<<<
 *                 'mult', ' length', 'topology', 'parity')
 *         return '\n'.join([base] + [repr(s) for s in self])
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatString); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "cython/core/basic.pyx":618
 *         else:
 *             base = LengthSpectrumFormatString % (
 *                 'mult', ' length', 'topology', 'parity')             # <<<<<<<<<<<<<<
 *         return '\n'.join([base] + [repr(s) for s in self])
 * 
*/
    __pyx_t_4 = PyNumber_Remainder(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_base = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "cython/core/basic.pyx":619
 *             base = LengthSpectrumFormatString % (
 *                 'mult', ' length', 'topology', 'parity')
 *         return '\n'.join([base] + [repr(s) for s in self])             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_base);
  __Pyx_GIVEREF(__pyx_v_base);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_base) != (0)) __PYX_ERR(1, 619, __pyx_L1_error);
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 619, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_v_self)) || PyTuple_CheckExact(__pyx_v_self)) {
      __pyx_t_6 = __pyx_v_self; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_2 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 619, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 619, __pyx_L8_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 619, __pyx_L8_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2);
          ++__pyx_t_2;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 619, __pyx_L8_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2));
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2);
          #endif
          ++__pyx_t_2;
        }
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 619, __pyx_L8_error)
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_6);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 619, __pyx_L8_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_s, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Repr(__pyx_8genexpr6__pyx_v_s); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 619, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(1, 619, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_s); __pyx_8genexpr6__pyx_v_s = 0;
    goto __pyx_L12_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_s); __pyx_8genexpr6__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L12_exit_scope:;
  } /* exit inner scope */
  __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u_, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":612
 * 
 * class LengthSpectrum(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if len(self) > 0 and 'word' in self[0]:
 *             base = LengthSpectrumFormatStringWithWord % (
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.LengthSpectrum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":623
 * 
 * class ListOnePerLine(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14ListOnePerLine_1__repr__(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_8SnapPyHP_14ListOnePerLine_1__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14ListOnePerLine_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14ListOnePerLine_1__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 623, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 623, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 623, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 623, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 623, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 623, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ListOnePerLine.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14ListOnePerLine___repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_14ListOnePerLine___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_8genexpr7__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":624
 * class ListOnePerLine(list):
 *     def __repr__(self):
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_self)) || PyTuple_CheckExact(__pyx_v_self)) {
      __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 624, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 624, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 624, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 624, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 624, __pyx_L5_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 624, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Repr(__pyx_8genexpr7__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 624, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 624, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__15, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__14, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 624, __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;

  /* "cython/core/basic.pyx":623
 * 
 * class ListOnePerLine(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
 * 
*/

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

/* "cython/core/basic.pyx":629
 * # Isometry
 * 
 * def format_two_by_two(mat):             # <<<<<<<<<<<<<<
 *     a,b,c,d = ['%d' % x for x in [mat[0,0], mat[0,1], mat[1,0], mat[1,1]]]
 *     w0 = max(len(a), len(c))
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_27format_two_by_two(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_8SnapPyHP_27format_two_by_two = {"format_two_by_two", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_27format_two_by_two, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_27format_two_by_two(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_mat = 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("format_two_by_two (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 629, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 629, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "format_two_by_two", 0) < 0) __PYX_ERR(1, 629, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("format_two_by_two", 1, 1, 1, i); __PYX_ERR(1, 629, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 629, __pyx_L3_error)
    }
    __pyx_v_mat = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format_two_by_two", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 629, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.format_two_by_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_26format_two_by_two(__pyx_self, __pyx_v_mat);

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

static PyObject *__pyx_pf_8SnapPyHP_26format_two_by_two(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mat) {
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_w0 = NULL;
  PyObject *__pyx_v_w1 = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_x = 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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("format_two_by_two", 0);

  /* "cython/core/basic.pyx":630
 * 
 * def format_two_by_two(mat):
 *     a,b,c,d = ['%d' % x for x in [mat[0,0], mat[0,1], mat[1,0], mat[1,1]]]             # <<<<<<<<<<<<<<
 *     w0 = max(len(a), len(c))
 *     w1 = max(len(b), len(d))
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 630, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 630, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_mstate_global->__pyx_tuple[4]); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 630, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_mstate_global->__pyx_tuple[5]); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 630, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_mstate_global->__pyx_tuple[6]); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 630, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 630, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 630, __pyx_L5_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 630, __pyx_L5_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 630, __pyx_L5_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5) != (0)) __PYX_ERR(1, 630, __pyx_L5_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_7 >= 4) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7));
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7);
      #endif
      ++__pyx_t_7;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 630, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_x, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d, __pyx_8genexpr8__pyx_v_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 630, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 630, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_x); __pyx_8genexpr8__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_x); __pyx_8genexpr8__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  if (1) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PyList_GET_SIZE(sequence);
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(1, 630, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_XGOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_XGOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 2);
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_XGOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 3);
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_XGOTREF(__pyx_t_3);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_4,&__pyx_t_3};
      for (i=0; i < 4; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 630, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_a = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_b = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_c = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_d = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":631
 * def format_two_by_two(mat):
 *     a,b,c,d = ['%d' % x for x in [mat[0,0], mat[0,1], mat[1,0], mat[1,1]]]
 *     w0 = max(len(a), len(c))             # <<<<<<<<<<<<<<
 *     w1 = max(len(b), len(d))
 *     return ('[' + a.rjust(w0) + ' ' + b.rjust(w1) + ']',
*/
  __pyx_t_7 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 631, __pyx_L1_error)
  __pyx_t_8 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 631, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_7 > __pyx_t_8);
  if (__pyx_t_10) {
    __pyx_t_9 = __pyx_t_7;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_w0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":632
 *     a,b,c,d = ['%d' % x for x in [mat[0,0], mat[0,1], mat[1,0], mat[1,1]]]
 *     w0 = max(len(a), len(c))
 *     w1 = max(len(b), len(d))             # <<<<<<<<<<<<<<
 *     return ('[' + a.rjust(w0) + ' ' + b.rjust(w1) + ']',
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')
*/
  __pyx_t_9 = PyObject_Length(__pyx_v_d); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 632, __pyx_L1_error)
  __pyx_t_7 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 632, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_9 > __pyx_t_7);
  if (__pyx_t_10) {
    __pyx_t_8 = __pyx_t_9;
  } else {
    __pyx_t_8 = __pyx_t_7;
  }
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_w1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":633
 *     w0 = max(len(a), len(c))
 *     w1 = max(len(b), len(d))
 *     return ('[' + a.rjust(w0) + ' ' + b.rjust(w1) + ']',             # <<<<<<<<<<<<<<
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_v_a;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_w0};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_rjust, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u__14, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_v_b;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_w1};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_rjust, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":634
 *     w1 = max(len(b), len(d))
 *     return ('[' + a.rjust(w0) + ' ' + b.rjust(w1) + ']',
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_v_c;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_w0};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_rjust, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_1 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u__14, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_v_d;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_w1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_rjust, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":633
 *     w0 = max(len(a), len(c))
 *     w1 = max(len(b), len(d))
 *     return ('[' + a.rjust(w0) + ' ' + b.rjust(w1) + ']',             # <<<<<<<<<<<<<<
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')
 * 
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 633, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 633, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":629
 * # Isometry
 * 
 * def format_two_by_two(mat):             # <<<<<<<<<<<<<<
 *     a,b,c,d = ['%d' % x for x in [mat[0,0], mat[0,1], mat[1,0], mat[1,1]]]
 *     w0 = max(len(a), len(c))
*/

  /* 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("SnapPyHP.format_two_by_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_w0);
  __Pyx_XDECREF(__pyx_v_w1);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":641
 *     Represents an isometry from one manifold to another.
 *     """
 *     def __init__(self, cusp_images, cusp_maps, extends_to_link):             # <<<<<<<<<<<<<<
 *         self._cusp_images, self._cusp_maps = cusp_images, cusp_maps
 *         self._extends_to_link = extends_to_link
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Isometry_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Isometry_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cusp_images = 0;
  PyObject *__pyx_v_cusp_maps = 0;
  PyObject *__pyx_v_extends_to_link = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_cusp_images,&__pyx_mstate_global->__pyx_n_u_cusp_maps,&__pyx_mstate_global->__pyx_n_u_extends_to_link,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 641, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 641, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 641, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 641, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 641, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(1, 641, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, i); __PYX_ERR(1, 641, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 641, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 641, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 641, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 641, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_cusp_images = values[1];
    __pyx_v_cusp_maps = values[2];
    __pyx_v_extends_to_link = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 641, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Isometry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Isometry___init__(__pyx_self, __pyx_v_self, __pyx_v_cusp_images, __pyx_v_cusp_maps, __pyx_v_extends_to_link);

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

static PyObject *__pyx_pf_8SnapPyHP_8Isometry___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cusp_images, PyObject *__pyx_v_cusp_maps, PyObject *__pyx_v_extends_to_link) {
  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("__init__", 0);

  /* "cython/core/basic.pyx":642
 *     """
 *     def __init__(self, cusp_images, cusp_maps, extends_to_link):
 *         self._cusp_images, self._cusp_maps = cusp_images, cusp_maps             # <<<<<<<<<<<<<<
 *         self._extends_to_link = extends_to_link
 * 
*/
  __pyx_t_1 = __pyx_v_cusp_images;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_cusp_maps;
  __Pyx_INCREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cusp_images_2, __pyx_t_1) < 0) __PYX_ERR(1, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cusp_maps_2, __pyx_t_2) < 0) __PYX_ERR(1, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":643
 *     def __init__(self, cusp_images, cusp_maps, extends_to_link):
 *         self._cusp_images, self._cusp_maps = cusp_images, cusp_maps
 *         self._extends_to_link = extends_to_link             # <<<<<<<<<<<<<<
 * 
 *     def cusp_images(self):
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_extends_to_link_2, __pyx_v_extends_to_link) < 0) __PYX_ERR(1, 643, __pyx_L1_error)

  /* "cython/core/basic.pyx":641
 *     Represents an isometry from one manifold to another.
 *     """
 *     def __init__(self, cusp_images, cusp_maps, extends_to_link):             # <<<<<<<<<<<<<<
 *         self._cusp_images, self._cusp_maps = cusp_images, cusp_maps
 *         self._extends_to_link = extends_to_link
*/

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

/* "cython/core/basic.pyx":645
 *         self._extends_to_link = extends_to_link
 * 
 *     def cusp_images(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_images
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_3cusp_images(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_8SnapPyHP_8Isometry_3cusp_images = {"cusp_images", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Isometry_3cusp_images, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_3cusp_images(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cusp_images (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 645, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cusp_images", 0) < 0) __PYX_ERR(1, 645, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cusp_images", 1, 1, 1, i); __PYX_ERR(1, 645, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 645, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cusp_images", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 645, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Isometry.cusp_images", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Isometry_2cusp_images(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_8Isometry_2cusp_images(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("cusp_images", 0);

  /* "cython/core/basic.pyx":646
 * 
 *     def cusp_images(self):
 *         return self._cusp_images             # <<<<<<<<<<<<<<
 * 
 *     def cusp_maps(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cusp_images_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":645
 *         self._extends_to_link = extends_to_link
 * 
 *     def cusp_images(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_images
 * 
*/

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

/* "cython/core/basic.pyx":648
 *         return self._cusp_images
 * 
 *     def cusp_maps(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_maps
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_5cusp_maps(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_8SnapPyHP_8Isometry_5cusp_maps = {"cusp_maps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Isometry_5cusp_maps, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_5cusp_maps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cusp_maps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 648, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 648, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cusp_maps", 0) < 0) __PYX_ERR(1, 648, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cusp_maps", 1, 1, 1, i); __PYX_ERR(1, 648, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 648, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cusp_maps", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 648, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Isometry.cusp_maps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Isometry_4cusp_maps(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_8Isometry_4cusp_maps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("cusp_maps", 0);

  /* "cython/core/basic.pyx":649
 * 
 *     def cusp_maps(self):
 *         return self._cusp_maps             # <<<<<<<<<<<<<<
 * 
 *     def extends_to_link(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cusp_maps_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":648
 *         return self._cusp_images
 * 
 *     def cusp_maps(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_maps
 * 
*/

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

/* "cython/core/basic.pyx":651
 *         return self._cusp_maps
 * 
 *     def extends_to_link(self):             # <<<<<<<<<<<<<<
 *         return self._extends_to_link
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_7extends_to_link(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_8SnapPyHP_8Isometry_7extends_to_link = {"extends_to_link", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Isometry_7extends_to_link, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_7extends_to_link(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extends_to_link (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 651, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "extends_to_link", 0) < 0) __PYX_ERR(1, 651, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("extends_to_link", 1, 1, 1, i); __PYX_ERR(1, 651, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 651, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extends_to_link", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 651, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Isometry.extends_to_link", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Isometry_6extends_to_link(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_8Isometry_6extends_to_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("extends_to_link", 0);

  /* "cython/core/basic.pyx":652
 * 
 *     def extends_to_link(self):
 *         return self._extends_to_link             # <<<<<<<<<<<<<<
 * 
 *     def num_cusps(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_extends_to_link_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":651
 *         return self._cusp_maps
 * 
 *     def extends_to_link(self):             # <<<<<<<<<<<<<<
 *         return self._extends_to_link
 * 
*/

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

/* "cython/core/basic.pyx":654
 *         return self._extends_to_link
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         return len(self.cusp_images())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_9num_cusps(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_8SnapPyHP_8Isometry_9num_cusps = {"num_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Isometry_9num_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_9num_cusps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_cusps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 654, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 654, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "num_cusps", 0) < 0) __PYX_ERR(1, 654, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("num_cusps", 1, 1, 1, i); __PYX_ERR(1, 654, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 654, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("num_cusps", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 654, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Isometry.num_cusps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Isometry_8num_cusps(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_8Isometry_8num_cusps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_cusps", 0);

  /* "cython/core/basic.pyx":655
 * 
 *     def num_cusps(self):
 *         return len(self.cusp_images())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_images, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 655, __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(1, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":654
 *         return self._extends_to_link
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         return len(self.cusp_images())
 * 
*/

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

/* "cython/core/basic.pyx":657
 *         return len(self.cusp_images())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_11__repr__(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_8SnapPyHP_8Isometry_11__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Isometry_11__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Isometry_11__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 657, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 657, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(1, 657, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(1, 657, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 657, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 657, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Isometry.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Isometry_10__repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_8Isometry_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_images = NULL;
  PyObject *__pyx_v_maps = NULL;
  PyObject *__pyx_v_line0 = NULL;
  PyObject *__pyx_v_line1 = NULL;
  PyObject *__pyx_v_line2 = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_l0 = NULL;
  PyObject *__pyx_v_l1 = NULL;
  PyObject *__pyx_v_l2 = NULL;
  Py_ssize_t __pyx_v_L;
  PyObject *__pyx_v_line3 = NULL;
  PyObject *__pyx_8genexpr9__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9[3];
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":658
 * 
 *     def __repr__(self):
 *         images = self.cusp_images()             # <<<<<<<<<<<<<<
 *         maps = self.cusp_maps()
 *         line0, line1, line2 = [], [], []
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_images, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_images = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":659
 *     def __repr__(self):
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()             # <<<<<<<<<<<<<<
 *         line0, line1, line2 = [], [], []
 *         for i in range(self.num_cusps()):
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_maps, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_maps = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":660
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()
 *         line0, line1, line2 = [], [], []             # <<<<<<<<<<<<<<
 *         for i in range(self.num_cusps()):
 *             l0 = '%d -> %d' % (i, images[i])
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_line0 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_line1 = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_line2 = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":661
 *         maps = self.cusp_maps()
 *         line0, line1, line2 = [], [], []
 *         for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *             l0 = '%d -> %d' % (i, images[i])
 *             l1, l2 = format_two_by_two(maps[i])
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_1 = __pyx_builtin_range; 
  __pyx_t_6 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  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_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 661, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 661, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 661, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 661, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 661, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/basic.pyx":662
 *         line0, line1, line2 = [], [], []
 *         for i in range(self.num_cusps()):
 *             l0 = '%d -> %d' % (i, images[i])             # <<<<<<<<<<<<<<
 *             l1, l2 = format_two_by_two(maps[i])
 *             L = max(len(l0), len(l1), len(l2))
*/
    __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_i), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_images, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9[0] = __pyx_t_4;
    __pyx_t_9[1] = __pyx_mstate_global->__pyx_kp_u__16;
    __pyx_t_9[2] = __pyx_t_2;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_l0, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":663
 *         for i in range(self.num_cusps()):
 *             l0 = '%d -> %d' % (i, images[i])
 *             l1, l2 = format_two_by_two(maps[i])             # <<<<<<<<<<<<<<
 *             L = max(len(l0), len(l1), len(l2))
 *             line0.append(l0.ljust(L))
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_format_two_by_two); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_maps, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 663, __pyx_L1_error)
      __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(1, 663, __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_INCREF(__pyx_t_4);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 663, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 663, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
      index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_6 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_2), 2) < 0) __PYX_ERR(1, 663, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 663, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_l1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_l2, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":664
 *             l0 = '%d -> %d' % (i, images[i])
 *             l1, l2 = format_two_by_two(maps[i])
 *             L = max(len(l0), len(l1), len(l2))             # <<<<<<<<<<<<<<
 *             line0.append(l0.ljust(L))
 *             line1.append(l1.ljust(L))
*/
    __pyx_t_11 = PyObject_Length(__pyx_v_l1); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(1, 664, __pyx_L1_error)
    __pyx_t_12 = PyObject_Length(__pyx_v_l2); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 664, __pyx_L1_error)
    __pyx_t_13 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_l0); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(1, 664, __pyx_L1_error)
    __pyx_t_15 = (__pyx_t_11 > __pyx_t_13);
    if (__pyx_t_15) {
      __pyx_t_14 = __pyx_t_11;
    } else {
      __pyx_t_14 = __pyx_t_13;
    }
    __pyx_t_13 = __pyx_t_14;
    __pyx_t_15 = (__pyx_t_12 > __pyx_t_13);
    if (__pyx_t_15) {
      __pyx_t_14 = __pyx_t_12;
    } else {
      __pyx_t_14 = __pyx_t_13;
    }
    __pyx_v_L = __pyx_t_14;

    /* "cython/core/basic.pyx":665
 *             l1, l2 = format_two_by_two(maps[i])
 *             L = max(len(l0), len(l1), len(l2))
 *             line0.append(l0.ljust(L))             # <<<<<<<<<<<<<<
 *             line1.append(l1.ljust(L))
 *             line2.append(l2.ljust(L))
*/
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_L); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__ljust, __pyx_v_l0, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_line0, __pyx_t_6); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(1, 665, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":666
 *             L = max(len(l0), len(l1), len(l2))
 *             line0.append(l0.ljust(L))
 *             line1.append(l1.ljust(L))             # <<<<<<<<<<<<<<
 *             line2.append(l2.ljust(L))
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
*/
    __pyx_t_5 = __pyx_v_l1;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_L); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ljust, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_line1, __pyx_t_6); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":667
 *             line0.append(l0.ljust(L))
 *             line1.append(l1.ljust(L))
 *             line2.append(l2.ljust(L))             # <<<<<<<<<<<<<<
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
 *         return '\n'.join(['  '.join(l).strip()
*/
    __pyx_t_4 = __pyx_v_l2;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_L); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ljust, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_line2, __pyx_t_6); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":661
 *         maps = self.cusp_maps()
 *         line0, line1, line2 = [], [], []
 *         for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *             l0 = '%d -> %d' % (i, images[i])
 *             l1, l2 = format_two_by_two(maps[i])
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":668
 *             line1.append(l1.ljust(L))
 *             line2.append(l2.ljust(L))
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'             # <<<<<<<<<<<<<<
 *         return '\n'.join(['  '.join(l).strip()
 *                           for l in [line0, line1, line2]] + [line3])
*/
  __pyx_t_5 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extends_to_link, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(1, 668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_15) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Extends_to_link);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u_Extends_to_link;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Does_not_extend_to_link);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u_Does_not_extend_to_link;
  }
  __pyx_v_line3 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":669
 *             line2.append(l2.ljust(L))
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
 *         return '\n'.join(['  '.join(l).strip()             # <<<<<<<<<<<<<<
 *                           for l in [line0, line1, line2]] + [line3])
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 669, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/basic.pyx":670
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
 *         return '\n'.join(['  '.join(l).strip()
 *                           for l in [line0, line1, line2]] + [line3])             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 670, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_line0);
    __Pyx_GIVEREF(__pyx_v_line0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_line0) != (0)) __PYX_ERR(1, 670, __pyx_L10_error);
    __Pyx_INCREF(__pyx_v_line1);
    __Pyx_GIVEREF(__pyx_v_line1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_line1) != (0)) __PYX_ERR(1, 670, __pyx_L10_error);
    __Pyx_INCREF(__pyx_v_line2);
    __Pyx_GIVEREF(__pyx_v_line2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_line2) != (0)) __PYX_ERR(1, 670, __pyx_L10_error);
    __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_7 >= 3) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7));
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7);
      #endif
      ++__pyx_t_7;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 670, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_l, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "cython/core/basic.pyx":669
 *             line2.append(l2.ljust(L))
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
 *         return '\n'.join(['  '.join(l).strip()             # <<<<<<<<<<<<<<
 *                           for l in [line0, line1, line2]] + [line3])
 * 
*/
      __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__17, __pyx_8genexpr9__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 669, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 669, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 669, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/basic.pyx":670
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
 *         return '\n'.join(['  '.join(l).strip()
 *                           for l in [line0, line1, line2]] + [line3])             # <<<<<<<<<<<<<<
 * 
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_l); __pyx_8genexpr9__pyx_v_l = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_l); __pyx_8genexpr9__pyx_v_l = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_line3);
  __Pyx_GIVEREF(__pyx_v_line3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_line3) != (0)) __PYX_ERR(1, 670, __pyx_L1_error);
  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":669
 *             line2.append(l2.ljust(L))
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
 *         return '\n'.join(['  '.join(l).strip()             # <<<<<<<<<<<<<<
 *                           for l in [line0, line1, line2]] + [line3])
 * 
*/
  __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u_, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":657
 *         return len(self.cusp_images())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()
*/

  /* 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("SnapPyHP.Isometry.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_images);
  __Pyx_XDECREF(__pyx_v_maps);
  __Pyx_XDECREF(__pyx_v_line0);
  __Pyx_XDECREF(__pyx_v_line1);
  __Pyx_XDECREF(__pyx_v_line2);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_l0);
  __Pyx_XDECREF(__pyx_v_l1);
  __Pyx_XDECREF(__pyx_v_l2);
  __Pyx_XDECREF(__pyx_v_line3);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":673
 * 
 * 
 * cdef IsometryListToIsometries(IsometryList *isometries):             # <<<<<<<<<<<<<<
 *     cdef int n, c, i = 0, j = 0, c_cusp_image
 *     cdef MatrixInt22  c_cusp_map
*/

static PyObject *__pyx_f_8SnapPyHP_IsometryListToIsometries(IsometryList *__pyx_v_isometries) {
  int __pyx_v_n;
  int __pyx_v_c;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_c_cusp_image;
  MatrixInt22 __pyx_v_c_cusp_map;
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_v_cusp_images = NULL;
  PyObject *__pyx_v_cusp_maps = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  size_t __pyx_t_15;
  Boolean __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("IsometryListToIsometries", 0);

  /* "cython/core/basic.pyx":674
 * 
 * cdef IsometryListToIsometries(IsometryList *isometries):
 *     cdef int n, c, i = 0, j = 0, c_cusp_image             # <<<<<<<<<<<<<<
 *     cdef MatrixInt22  c_cusp_map
 *     n = isometry_list_size(isometries)
*/
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "cython/core/basic.pyx":676
 *     cdef int n, c, i = 0, j = 0, c_cusp_image
 *     cdef MatrixInt22  c_cusp_map
 *     n = isometry_list_size(isometries)             # <<<<<<<<<<<<<<
 *     c = isometry_list_num_cusps(isometries)
 * 
*/
  __pyx_t_1 = isometry_list_size(__pyx_v_isometries); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 676, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "cython/core/basic.pyx":677
 *     cdef MatrixInt22  c_cusp_map
 *     n = isometry_list_size(isometries)
 *     c = isometry_list_num_cusps(isometries)             # <<<<<<<<<<<<<<
 * 
 *     ans = []
*/
  __pyx_t_1 = isometry_list_num_cusps(__pyx_v_isometries); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 677, __pyx_L1_error)
  __pyx_v_c = __pyx_t_1;

  /* "cython/core/basic.pyx":679
 *     c = isometry_list_num_cusps(isometries)
 * 
 *     ans = []             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         cusp_images = []
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":680
 * 
 *     ans = []
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         cusp_images = []
 *         cusp_maps = []
*/
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_3 = __pyx_t_1;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "cython/core/basic.pyx":681
 *     ans = []
 *     for i in range(n):
 *         cusp_images = []             # <<<<<<<<<<<<<<
 *         cusp_maps = []
 *         for j in range(c):
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_cusp_images, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":682
 *     for i in range(n):
 *         cusp_images = []
 *         cusp_maps = []             # <<<<<<<<<<<<<<
 *         for j in range(c):
 *             isometry_list_cusp_action(isometries, i, j, &c_cusp_image, c_cusp_map)
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_cusp_maps, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":683
 *         cusp_images = []
 *         cusp_maps = []
 *         for j in range(c):             # <<<<<<<<<<<<<<
 *             isometry_list_cusp_action(isometries, i, j, &c_cusp_image, c_cusp_map)
 *             cusp_images.append(c_cusp_image)
*/
    __pyx_t_5 = __pyx_v_c;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_j = __pyx_t_7;

      /* "cython/core/basic.pyx":684
 *         cusp_maps = []
 *         for j in range(c):
 *             isometry_list_cusp_action(isometries, i, j, &c_cusp_image, c_cusp_map)             # <<<<<<<<<<<<<<
 *             cusp_images.append(c_cusp_image)
 *             cusp_maps.append(matrix(
*/
      isometry_list_cusp_action(__pyx_v_isometries, __pyx_v_i, __pyx_v_j, (&__pyx_v_c_cusp_image), __pyx_v_c_cusp_map); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 684, __pyx_L1_error)

      /* "cython/core/basic.pyx":685
 *         for j in range(c):
 *             isometry_list_cusp_action(isometries, i, j, &c_cusp_image, c_cusp_map)
 *             cusp_images.append(c_cusp_image)             # <<<<<<<<<<<<<<
 *             cusp_maps.append(matrix(
 *                 [ [c_cusp_map[0][0], c_cusp_map[0][1]],
*/
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_c_cusp_image); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cusp_images, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":686
 *             isometry_list_cusp_action(isometries, i, j, &c_cusp_image, c_cusp_map)
 *             cusp_images.append(c_cusp_image)
 *             cusp_maps.append(matrix(             # <<<<<<<<<<<<<<
 *                 [ [c_cusp_map[0][0], c_cusp_map[0][1]],
 *                   [c_cusp_map[1][0], c_cusp_map[1][1]]] ))
*/
      __pyx_t_9 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "cython/core/basic.pyx":687
 *             cusp_images.append(c_cusp_image)
 *             cusp_maps.append(matrix(
 *                 [ [c_cusp_map[0][0], c_cusp_map[0][1]],             # <<<<<<<<<<<<<<
 *                   [c_cusp_map[1][0], c_cusp_map[1][1]]] ))
 * 
*/
      __pyx_t_11 = __Pyx_PyLong_From_int(((__pyx_v_c_cusp_map[0])[0])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyLong_From_int(((__pyx_v_c_cusp_map[0])[1])); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = PyList_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_11) != (0)) __PYX_ERR(1, 687, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 1, __pyx_t_12) != (0)) __PYX_ERR(1, 687, __pyx_L1_error);
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;

      /* "cython/core/basic.pyx":688
 *             cusp_maps.append(matrix(
 *                 [ [c_cusp_map[0][0], c_cusp_map[0][1]],
 *                   [c_cusp_map[1][0], c_cusp_map[1][1]]] ))             # <<<<<<<<<<<<<<
 * 
 *         ans.append(Isometry(cusp_images, cusp_maps, B2B(isometry_extends_to_link(isometries, i))))
*/
      __pyx_t_12 = __Pyx_PyLong_From_int(((__pyx_v_c_cusp_map[1])[0])); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = __Pyx_PyLong_From_int(((__pyx_v_c_cusp_map[1])[1])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_12) != (0)) __PYX_ERR(1, 688, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_11) != (0)) __PYX_ERR(1, 688, __pyx_L1_error);
      __pyx_t_12 = 0;
      __pyx_t_11 = 0;

      /* "cython/core/basic.pyx":687
 *             cusp_images.append(c_cusp_image)
 *             cusp_maps.append(matrix(
 *                 [ [c_cusp_map[0][0], c_cusp_map[0][1]],             # <<<<<<<<<<<<<<
 *                   [c_cusp_map[1][0], c_cusp_map[1][1]]] ))
 * 
*/
      __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_13) != (0)) __PYX_ERR(1, 687, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_14) != (0)) __PYX_ERR(1, 687, __pyx_L1_error);
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_15 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
        assert(__pyx_t_9);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
        __pyx_t_15 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 686, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }

      /* "cython/core/basic.pyx":686
 *             isometry_list_cusp_action(isometries, i, j, &c_cusp_image, c_cusp_map)
 *             cusp_images.append(c_cusp_image)
 *             cusp_maps.append(matrix(             # <<<<<<<<<<<<<<
 *                 [ [c_cusp_map[0][0], c_cusp_map[0][1]],
 *                   [c_cusp_map[1][0], c_cusp_map[1][1]]] ))
*/
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cusp_maps, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "cython/core/basic.pyx":690
 *                   [c_cusp_map[1][0], c_cusp_map[1][1]]] ))
 * 
 *         ans.append(Isometry(cusp_images, cusp_maps, B2B(isometry_extends_to_link(isometries, i))))             # <<<<<<<<<<<<<<
 * 
 *     return ans
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Isometry); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_16 = isometry_extends_to_link(__pyx_v_isometries, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 690, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_8SnapPyHP_B2B(__pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_15 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_15 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_cusp_images, __pyx_v_cusp_maps, __pyx_t_9};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_15, (4-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ans, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 690, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/basic.pyx":692
 *         ans.append(Isometry(cusp_images, cusp_maps, B2B(isometry_extends_to_link(isometries, i))))
 * 
 *     return ans             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":673
 * 
 * 
 * cdef IsometryListToIsometries(IsometryList *isometries):             # <<<<<<<<<<<<<<
 *     cdef int n, c, i = 0, j = 0, c_cusp_image
 *     cdef MatrixInt22  c_cusp_map
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.IsometryListToIsometries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XDECREF(__pyx_v_cusp_images);
  __Pyx_XDECREF(__pyx_v_cusp_maps);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":697
 * # PLink communication
 * 
 * def _plink_callback(LE):             # <<<<<<<<<<<<<<
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_29_plink_callback(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_8SnapPyHP_29_plink_callback = {"_plink_callback", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_29_plink_callback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_29_plink_callback(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_LE = 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("_plink_callback (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_LE,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 697, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_plink_callback", 0) < 0) __PYX_ERR(1, 697, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_plink_callback", 1, 1, 1, i); __PYX_ERR(1, 697, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 697, __pyx_L3_error)
    }
    __pyx_v_LE = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_plink_callback", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 697, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP._plink_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_28_plink_callback(__pyx_self, __pyx_v_LE);

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

static PyObject *__pyx_pf_8SnapPyHP_28_plink_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_LE) {
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_manifold = 0;
  Triangulation *__pyx_v_c_triangulation;
  PyObject *__pyx_v_klp = 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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Triangulation *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_plink_callback", 0);

  /* "cython/core/basic.pyx":699
 * def _plink_callback(LE):
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *     if LE.manifold is None:
 *         LE.manifold = _manifold_class('empty')
*/
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/basic.pyx":700
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
 *     if LE.manifold is None:             # <<<<<<<<<<<<<<
 *         LE.manifold = _manifold_class('empty')
 *     manifold = LE.manifold
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_LE, __pyx_mstate_global->__pyx_n_u_manifold); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":701
 *     cdef c_Triangulation* c_triangulation = NULL
 *     if LE.manifold is None:
 *         LE.manifold = _manifold_class('empty')             # <<<<<<<<<<<<<<
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_manifold_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_LE, __pyx_mstate_global->__pyx_n_u_manifold, __pyx_t_1) < 0) __PYX_ERR(1, 701, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":700
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
 *     if LE.manifold is None:             # <<<<<<<<<<<<<<
 *         LE.manifold = _manifold_class('empty')
 *     manifold = LE.manifold
*/
  }

  /* "cython/core/basic.pyx":702
 *     if LE.manifold is None:
 *         LE.manifold = _manifold_class('empty')
 *     manifold = LE.manifold             # <<<<<<<<<<<<<<
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is None:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_LE, __pyx_mstate_global->__pyx_n_u_manifold); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(1, 702, __pyx_L1_error)
  __pyx_v_manifold = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":703
 *         LE.manifold = _manifold_class('empty')
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()             # <<<<<<<<<<<<<<
 *     if klp is None:
 *         raise RuntimeError('Communication with PLink failed.')
*/
  __pyx_t_4 = __pyx_v_LE;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_SnapPea_KLPProjection, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_klp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":704
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is None:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Communication with PLink failed.')
 *     elif klp == (0, 0, 0, []):
*/
  __pyx_t_2 = (__pyx_v_klp == Py_None);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/basic.pyx":705
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is None:
 *         raise RuntimeError('Communication with PLink failed.')             # <<<<<<<<<<<<<<
 *     elif klp == (0, 0, 0, []):
 *         msg_stream.write('\nGot the empty link from PLink and so not changing the triangulation.\n')
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Communication_with_PLink_failed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 705, __pyx_L1_error)

    /* "cython/core/basic.pyx":704
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is None:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Communication with PLink failed.')
 *     elif klp == (0, 0, 0, []):
*/
  }

  /* "cython/core/basic.pyx":706
 *     if klp is None:
 *         raise RuntimeError('Communication with PLink failed.')
 *     elif klp == (0, 0, 0, []):             # <<<<<<<<<<<<<<
 *         msg_stream.write('\nGot the empty link from PLink and so not changing the triangulation.\n')
 *     else:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 706, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 706, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 706, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1) != (0)) __PYX_ERR(1, 706, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_klp, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":707
 *         raise RuntimeError('Communication with PLink failed.')
 *     elif klp == (0, 0, 0, []):
 *         msg_stream.write('\nGot the empty link from PLink and so not changing the triangulation.\n')             # <<<<<<<<<<<<<<
 *     else:
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_msg_stream); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Got_the_empty_link_from_PLink_a};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":706
 *     if klp is None:
 *         raise RuntimeError('Communication with PLink failed.')
 *     elif klp == (0, 0, 0, []):             # <<<<<<<<<<<<<<
 *         msg_stream.write('\nGot the empty link from PLink and so not changing the triangulation.\n')
 *     else:
*/
    goto __pyx_L4;
  }

  /* "cython/core/basic.pyx":709
 *         msg_stream.write('\nGot the empty link from PLink and so not changing the triangulation.\n')
 *     else:
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))             # <<<<<<<<<<<<<<
 *         manifold._set_PDcode(LE.PD_code())
 *         c_triangulation = get_triangulation_from_PythonKLP(klp)
*/
  /*else*/ {
    __pyx_t_6 = ((PyObject *)__pyx_v_manifold);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_v_LE;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_DTcode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":710
 *     else:
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))
 *         manifold._set_PDcode(LE.PD_code())             # <<<<<<<<<<<<<<
 *         c_triangulation = get_triangulation_from_PythonKLP(klp)
 *         if c_triangulation is not NULL:
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_manifold);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = __pyx_v_LE;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_PD_code, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_PDcode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":711
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))
 *         manifold._set_PDcode(LE.PD_code())
 *         c_triangulation = get_triangulation_from_PythonKLP(klp)             # <<<<<<<<<<<<<<
 *         if c_triangulation is not NULL:
 *             find_complete_hyperbolic_structure(c_triangulation)
*/
    __pyx_t_8 = __pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(__pyx_v_klp, NULL); if (unlikely(__pyx_t_8 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(1, 711, __pyx_L1_error)
    __pyx_v_c_triangulation = __pyx_t_8;

    /* "cython/core/basic.pyx":712
 *         manifold._set_PDcode(LE.PD_code())
 *         c_triangulation = get_triangulation_from_PythonKLP(klp)
 *         if c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             find_complete_hyperbolic_structure(c_triangulation)
 *         if manifold.c_triangulation is not NULL:
*/
    __pyx_t_2 = (__pyx_v_c_triangulation != NULL);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":713
 *         c_triangulation = get_triangulation_from_PythonKLP(klp)
 *         if c_triangulation is not NULL:
 *             find_complete_hyperbolic_structure(c_triangulation)             # <<<<<<<<<<<<<<
 *         if manifold.c_triangulation is not NULL:
 *             free_triangulation(manifold.c_triangulation)
*/
      find_complete_hyperbolic_structure(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 713, __pyx_L1_error)

      /* "cython/core/basic.pyx":712
 *         manifold._set_PDcode(LE.PD_code())
 *         c_triangulation = get_triangulation_from_PythonKLP(klp)
 *         if c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             find_complete_hyperbolic_structure(c_triangulation)
 *         if manifold.c_triangulation is not NULL:
*/
    }

    /* "cython/core/basic.pyx":714
 *         if c_triangulation is not NULL:
 *             find_complete_hyperbolic_structure(c_triangulation)
 *         if manifold.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(manifold.c_triangulation)
 *         manifold.set_c_triangulation(c_triangulation)
*/
    __pyx_t_2 = (__pyx_v_manifold->__pyx_base.c_triangulation != NULL);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":715
 *             find_complete_hyperbolic_structure(c_triangulation)
 *         if manifold.c_triangulation is not NULL:
 *             free_triangulation(manifold.c_triangulation)             # <<<<<<<<<<<<<<
 *         manifold.set_c_triangulation(c_triangulation)
 *         manifold._cache.clear(message='plink_callback')
*/
      free_triangulation(__pyx_v_manifold->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 715, __pyx_L1_error)

      /* "cython/core/basic.pyx":714
 *         if c_triangulation is not NULL:
 *             find_complete_hyperbolic_structure(c_triangulation)
 *         if manifold.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(manifold.c_triangulation)
 *         manifold.set_c_triangulation(c_triangulation)
*/
    }

    /* "cython/core/basic.pyx":716
 *         if manifold.c_triangulation is not NULL:
 *             free_triangulation(manifold.c_triangulation)
 *         manifold.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         manifold._cache.clear(message='plink_callback')
 *         msg_stream.write('\nNew triangulation received from PLink!\n')
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_manifold->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_manifold), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":717
 *             free_triangulation(manifold.c_triangulation)
 *         manifold.set_c_triangulation(c_triangulation)
 *         manifold._cache.clear(message='plink_callback')             # <<<<<<<<<<<<<<
 *         msg_stream.write('\nNew triangulation received from PLink!\n')
 * 
*/
    __pyx_t_6 = __pyx_v_manifold->__pyx_base._cache;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, NULL};
      __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_n_u_plink_callback, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(1, 717, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":718
 *         manifold.set_c_triangulation(c_triangulation)
 *         manifold._cache.clear(message='plink_callback')
 *         msg_stream.write('\nNew triangulation received from PLink!\n')             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_msg_stream); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_New_triangulation_received_from};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "cython/core/basic.pyx":697
 * # PLink communication
 * 
 * def _plink_callback(LE):             # <<<<<<<<<<<<<<
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP._plink_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_manifold);
  __Pyx_XDECREF(__pyx_v_klp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":723
 * # Conversion functions Manifold <-> Triangulation
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,             # <<<<<<<<<<<<<<
 *                                 manifold_class=None):
 *     cdef c_Triangulation *c_triangulation
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_31Manifold_from_Triangulation(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_8SnapPyHP_31Manifold_from_Triangulation = {"Manifold_from_Triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_31Manifold_from_Triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_31Manifold_from_Triangulation(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
) {
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_T = 0;
  PyObject *__pyx_v_recompute = 0;
  PyObject *__pyx_v_manifold_class = 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("Manifold_from_Triangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_T,&__pyx_mstate_global->__pyx_n_u_recompute,&__pyx_mstate_global->__pyx_n_u_manifold_class_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 723, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Manifold_from_Triangulation", 0) < 0) __PYX_ERR(1, 723, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));

      /* "cython/core/basic.pyx":724
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,
 *                                 manifold_class=None):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Manifold M
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Manifold_from_Triangulation", 0, 1, 3, i); __PYX_ERR(1, 723, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 723, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_T = ((struct __pyx_obj_8SnapPyHP_Triangulation *)values[0]);
    __pyx_v_recompute = values[1];
    __pyx_v_manifold_class = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Manifold_from_Triangulation", 0, 1, 3, __pyx_nargs); __PYX_ERR(1, 723, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold_from_Triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, 1, "T", 0))) __PYX_ERR(1, 723, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_30Manifold_from_Triangulation(__pyx_self, __pyx_v_T, __pyx_v_recompute, __pyx_v_manifold_class);

  /* "cython/core/basic.pyx":723
 * # Conversion functions Manifold <-> Triangulation
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,             # <<<<<<<<<<<<<<
 *                                 manifold_class=None):
 *     cdef c_Triangulation *c_triangulation
*/

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

static PyObject *__pyx_pf_8SnapPyHP_30Manifold_from_Triangulation(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_T, PyObject *__pyx_v_recompute, PyObject *__pyx_v_manifold_class) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M = 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Manifold_from_Triangulation", 0);

  /* "cython/core/basic.pyx":728
 *     cdef Manifold M
 * 
 *     M = _manifold_class('empty') if manifold_class is None else manifold_class('empty')             # <<<<<<<<<<<<<<
 *     if T.c_triangulation is NULL:
 *         return M
*/
  __pyx_t_2 = (__pyx_v_manifold_class == Py_None);
  if (__pyx_t_2) {
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_manifold_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(1, 728, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_manifold_class);
    __pyx_t_4 = __pyx_v_manifold_class; 
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(1, 728, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_M = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":729
 * 
 *     M = _manifold_class('empty') if manifold_class is None else manifold_class('empty')
 *     if T.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *         return M
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
*/
  __pyx_t_2 = (__pyx_v_T->c_triangulation == NULL);
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":730
 *     M = _manifold_class('empty') if manifold_class is None else manifold_class('empty')
 *     if T.c_triangulation is NULL:
 *         return M             # <<<<<<<<<<<<<<
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
 *     M.set_c_triangulation(c_triangulation)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_M);
    __pyx_r = ((PyObject *)__pyx_v_M);
    goto __pyx_L0;

    /* "cython/core/basic.pyx":729
 * 
 *     M = _manifold_class('empty') if manifold_class is None else manifold_class('empty')
 *     if T.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *         return M
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
*/
  }

  /* "cython/core/basic.pyx":731
 *     if T.c_triangulation is NULL:
 *         return M
 *     copy_triangulation(T.c_triangulation, &c_triangulation)             # <<<<<<<<<<<<<<
 *     M.set_c_triangulation(c_triangulation)
 *     if recompute:
*/
  copy_triangulation(__pyx_v_T->c_triangulation, (&__pyx_v_c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 731, __pyx_L1_error)

  /* "cython/core/basic.pyx":732
 *         return M
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
 *     M.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *     if recompute:
 *         # Need to remove any finite vertices to be able to find a
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_M->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_M), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":733
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
 *     M.set_c_triangulation(c_triangulation)
 *     if recompute:             # <<<<<<<<<<<<<<
 *         # Need to remove any finite vertices to be able to find a
 *         # hyperbolic structure.
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_recompute); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":736
 *         # Need to remove any finite vertices to be able to find a
 *         # hyperbolic structure.
 *         count_cusps(c_triangulation)             # <<<<<<<<<<<<<<
 *         if get_num_fake_cusps(c_triangulation) > 0:
 *             remove_finite_vertices(c_triangulation)
*/
    count_cusps(__pyx_v_c_triangulation);

    /* "cython/core/basic.pyx":737
 *         # hyperbolic structure.
 *         count_cusps(c_triangulation)
 *         if get_num_fake_cusps(c_triangulation) > 0:             # <<<<<<<<<<<<<<
 *             remove_finite_vertices(c_triangulation)
 *             count_cusps(c_triangulation)
*/
    __pyx_t_7 = get_num_fake_cusps(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 > 0);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":738
 *         count_cusps(c_triangulation)
 *         if get_num_fake_cusps(c_triangulation) > 0:
 *             remove_finite_vertices(c_triangulation)             # <<<<<<<<<<<<<<
 *             count_cusps(c_triangulation)
 * 
*/
      remove_finite_vertices(__pyx_v_c_triangulation);

      /* "cython/core/basic.pyx":739
 *         if get_num_fake_cusps(c_triangulation) > 0:
 *             remove_finite_vertices(c_triangulation)
 *             count_cusps(c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         find_complete_hyperbolic_structure(c_triangulation)
*/
      count_cusps(__pyx_v_c_triangulation);

      /* "cython/core/basic.pyx":737
 *         # hyperbolic structure.
 *         count_cusps(c_triangulation)
 *         if get_num_fake_cusps(c_triangulation) > 0:             # <<<<<<<<<<<<<<
 *             remove_finite_vertices(c_triangulation)
 *             count_cusps(c_triangulation)
*/
    }

    /* "cython/core/basic.pyx":741
 *             count_cusps(c_triangulation)
 * 
 *         find_complete_hyperbolic_structure(c_triangulation)             # <<<<<<<<<<<<<<
 *         do_Dehn_filling(c_triangulation)
 * 
*/
    find_complete_hyperbolic_structure(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 741, __pyx_L1_error)

    /* "cython/core/basic.pyx":742
 * 
 *         find_complete_hyperbolic_structure(c_triangulation)
 *         do_Dehn_filling(c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     M.set_name(T.name())
*/
    do_Dehn_filling(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 742, __pyx_L1_error)

    /* "cython/core/basic.pyx":733
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
 *     M.set_c_triangulation(c_triangulation)
 *     if recompute:             # <<<<<<<<<<<<<<
 *         # Need to remove any finite vertices to be able to find a
 *         # hyperbolic structure.
*/
  }

  /* "cython/core/basic.pyx":744
 *         do_Dehn_filling(c_triangulation)
 * 
 *     M.set_name(T.name())             # <<<<<<<<<<<<<<
 *     M._cover_info = T._cover_info
 *     return M
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_M);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = ((PyObject *)__pyx_v_T);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":745
 * 
 *     M.set_name(T.name())
 *     M._cover_info = T._cover_info             # <<<<<<<<<<<<<<
 *     return M
 * 
*/
  __pyx_t_1 = __pyx_v_T->_cover_info;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_M->__pyx_base._cover_info);
  __Pyx_DECREF(__pyx_v_M->__pyx_base._cover_info);
  __pyx_v_M->__pyx_base._cover_info = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":746
 *     M.set_name(T.name())
 *     M._cover_info = T._cover_info
 *     return M             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_M);
  __pyx_r = ((PyObject *)__pyx_v_M);
  goto __pyx_L0;

  /* "cython/core/basic.pyx":723
 * # Conversion functions Manifold <-> Triangulation
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,             # <<<<<<<<<<<<<<
 *                                 manifold_class=None):
 *     cdef c_Triangulation *c_triangulation
*/

  /* 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("SnapPyHP.Manifold_from_Triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_M);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":749
 * 
 * 
 * def Triangulation_from_Manifold(Manifold M):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Triangulation T
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_33Triangulation_from_Manifold(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_8SnapPyHP_33Triangulation_from_Manifold = {"Triangulation_from_Manifold", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_33Triangulation_from_Manifold, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_33Triangulation_from_Manifold(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
) {
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M = 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("Triangulation_from_Manifold (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_M,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 749, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Triangulation_from_Manifold", 0) < 0) __PYX_ERR(1, 749, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Triangulation_from_Manifold", 1, 1, 1, i); __PYX_ERR(1, 749, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 749, __pyx_L3_error)
    }
    __pyx_v_M = ((struct __pyx_obj_8SnapPyHP_Manifold *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Triangulation_from_Manifold", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 749, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation_from_Manifold", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_M), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, 1, "M", 0))) __PYX_ERR(1, 749, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_32Triangulation_from_Manifold(__pyx_self, __pyx_v_M);

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

static PyObject *__pyx_pf_8SnapPyHP_32Triangulation_from_Manifold(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_T = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Triangulation_from_Manifold", 0);

  /* "cython/core/basic.pyx":753
 *     cdef Triangulation T
 * 
 *     if M.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *         return _triangulation_class('empty')
 * 
*/
  __pyx_t_1 = (__pyx_v_M->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":754
 * 
 *     if M.c_triangulation is NULL:
 *         return _triangulation_class('empty')             # <<<<<<<<<<<<<<
 * 
 *     copy_triangulation(M.c_triangulation, &c_triangulation)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_triangulation_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/basic.pyx":753
 *     cdef Triangulation T
 * 
 *     if M.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *         return _triangulation_class('empty')
 * 
*/
  }

  /* "cython/core/basic.pyx":756
 *         return _triangulation_class('empty')
 * 
 *     copy_triangulation(M.c_triangulation, &c_triangulation)             # <<<<<<<<<<<<<<
 *     remove_hyperbolic_structures(c_triangulation)
 *     T = _triangulation_class('empty')
*/
  copy_triangulation(__pyx_v_M->__pyx_base.c_triangulation, (&__pyx_v_c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)

  /* "cython/core/basic.pyx":757
 * 
 *     copy_triangulation(M.c_triangulation, &c_triangulation)
 *     remove_hyperbolic_structures(c_triangulation)             # <<<<<<<<<<<<<<
 *     T = _triangulation_class('empty')
 *     T.set_c_triangulation(c_triangulation)
*/
  remove_hyperbolic_structures(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)

  /* "cython/core/basic.pyx":758
 *     copy_triangulation(M.c_triangulation, &c_triangulation)
 *     remove_hyperbolic_structures(c_triangulation)
 *     T = _triangulation_class('empty')             # <<<<<<<<<<<<<<
 *     T.set_c_triangulation(c_triangulation)
 *     T.set_name(M.name())
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_triangulation_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(1, 758, __pyx_L1_error)
  __pyx_v_T = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":759
 *     remove_hyperbolic_structures(c_triangulation)
 *     T = _triangulation_class('empty')
 *     T.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *     T.set_name(M.name())
 *     T._cover_info = M._cover_info
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_T->__pyx_vtab)->set_c_triangulation(__pyx_v_T, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":760
 *     T = _triangulation_class('empty')
 *     T.set_c_triangulation(c_triangulation)
 *     T.set_name(M.name())             # <<<<<<<<<<<<<<
 *     T._cover_info = M._cover_info
 *     return T
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_T);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_6 = ((PyObject *)__pyx_v_M);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":761
 *     T.set_c_triangulation(c_triangulation)
 *     T.set_name(M.name())
 *     T._cover_info = M._cover_info             # <<<<<<<<<<<<<<
 *     return T
*/
  __pyx_t_2 = __pyx_v_M->__pyx_base._cover_info;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_T->_cover_info);
  __Pyx_DECREF(__pyx_v_T->_cover_info);
  __pyx_v_T->_cover_info = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":762
 *     T.set_name(M.name())
 *     T._cover_info = M._cover_info
 *     return T             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_T);
  __pyx_r = ((PyObject *)__pyx_v_T);
  goto __pyx_L0;

  /* "cython/core/basic.pyx":749
 * 
 * 
 * def Triangulation_from_Manifold(Manifold M):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Triangulation T
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Triangulation_from_Manifold", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_T);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":79
 *     cdef hyperbolic_structure_initialized
 * 
 *     def __cinit__(self, spec=None, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         if UI_callback is not None:
 *             uLongComputationBegins('Constructing a manifold', 1)
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_13Triangulation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_13Triangulation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_remove_finite_vertices = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_spec,&__pyx_mstate_global->__pyx_n_u_remove_finite_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 79, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 79, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 79, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(4, 79, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 79, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 79, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_spec = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, __pyx_nargs); __PYX_ERR(4, 79, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation___cinit__(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_spec, __pyx_v_remove_finite_vertices);

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

static int __pyx_pf_8SnapPyHP_13Triangulation___cinit__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_remove_finite_vertices) {
  PyObject *__pyx_v_attr = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_spec);

  /* "cython/core/triangulation.pyx":80
 * 
 *     def __cinit__(self, spec=None, remove_finite_vertices=True):
 *         if UI_callback is not None:             # <<<<<<<<<<<<<<
 *             uLongComputationBegins('Constructing a manifold', 1)
 *             UI_callback()
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":81
 *     def __cinit__(self, spec=None, remove_finite_vertices=True):
 *         if UI_callback is not None:
 *             uLongComputationBegins('Constructing a manifold', 1)             # <<<<<<<<<<<<<<
 *             UI_callback()
 *             uLongComputationEnds()
*/
    uLongComputationBegins(((const char*)"Constructing a manifold"), 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 81, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":82
 *         if UI_callback is not None:
 *             uLongComputationBegins('Constructing a manifold', 1)
 *             UI_callback()             # <<<<<<<<<<<<<<
 *             uLongComputationEnds()
 *         # Answers to potentially hard computations are cached
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 82, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":83
 *             uLongComputationBegins('Constructing a manifold', 1)
 *             UI_callback()
 *             uLongComputationEnds()             # <<<<<<<<<<<<<<
 *         # Answers to potentially hard computations are cached
 *         self.c_triangulation = NULL
*/
    uLongComputationEnds(); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 83, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":80
 * 
 *     def __cinit__(self, spec=None, remove_finite_vertices=True):
 *         if UI_callback is not None:             # <<<<<<<<<<<<<<
 *             uLongComputationBegins('Constructing a manifold', 1)
 *             UI_callback()
*/
  }

  /* "cython/core/triangulation.pyx":85
 *             uLongComputationEnds()
 *         # Answers to potentially hard computations are cached
 *         self.c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         self._cache = SnapPyCache()
 *         self._DTcode = None
*/
  __pyx_v_self->c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":86
 *         # Answers to potentially hard computations are cached
 *         self.c_triangulation = NULL
 *         self._cache = SnapPyCache()             # <<<<<<<<<<<<<<
 *         self._DTcode = None
 *         self._PDcode = None
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SnapPyCache); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_cache);
  __Pyx_DECREF(__pyx_v_self->_cache);
  __pyx_v_self->_cache = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":87
 *         self.c_triangulation = NULL
 *         self._cache = SnapPyCache()
 *         self._DTcode = None             # <<<<<<<<<<<<<<
 *         self._PDcode = None
 *         self._cover_info = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_DTcode);
  __Pyx_DECREF(__pyx_v_self->_DTcode);
  __pyx_v_self->_DTcode = Py_None;

  /* "cython/core/triangulation.pyx":88
 *         self._cache = SnapPyCache()
 *         self._DTcode = None
 *         self._PDcode = None             # <<<<<<<<<<<<<<
 *         self._cover_info = None
 *         self.LE = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_PDcode);
  __Pyx_DECREF(__pyx_v_self->_PDcode);
  __pyx_v_self->_PDcode = Py_None;

  /* "cython/core/triangulation.pyx":89
 *         self._DTcode = None
 *         self._PDcode = None
 *         self._cover_info = None             # <<<<<<<<<<<<<<
 *         self.LE = None
 *         self.hyperbolic_structure_initialized = False
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_cover_info);
  __Pyx_DECREF(__pyx_v_self->_cover_info);
  __pyx_v_self->_cover_info = Py_None;

  /* "cython/core/triangulation.pyx":90
 *         self._PDcode = None
 *         self._cover_info = None
 *         self.LE = None             # <<<<<<<<<<<<<<
 *         self.hyperbolic_structure_initialized = False
 *         self._link_file_full_path = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->LE);
  __Pyx_DECREF(__pyx_v_self->LE);
  __pyx_v_self->LE = Py_None;

  /* "cython/core/triangulation.pyx":91
 *         self._cover_info = None
 *         self.LE = None
 *         self.hyperbolic_structure_initialized = False             # <<<<<<<<<<<<<<
 *         self._link_file_full_path = None
 * 
*/
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->hyperbolic_structure_initialized);
  __Pyx_DECREF(__pyx_v_self->hyperbolic_structure_initialized);
  __pyx_v_self->hyperbolic_structure_initialized = Py_False;

  /* "cython/core/triangulation.pyx":92
 *         self.LE = None
 *         self.hyperbolic_structure_initialized = False
 *         self._link_file_full_path = None             # <<<<<<<<<<<<<<
 * 
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_link_file_full_path);
  __Pyx_DECREF(__pyx_v_self->_link_file_full_path);
  __pyx_v_self->_link_file_full_path = Py_None;

  /* "cython/core/triangulation.pyx":94
 *         self._link_file_full_path = None
 * 
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:             # <<<<<<<<<<<<<<
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()
*/
  __pyx_t_1 = __pyx_mstate_global->__pyx_tuple[7]; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= 3) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6);
    #endif
    ++__pyx_t_6;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_attr, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":95
 * 
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 *             if hasattr(spec, attr):             # <<<<<<<<<<<<<<
 *                 spec = getattr(spec, attr)()
 *                 break
*/
    __pyx_t_2 = __Pyx_HasAttr(__pyx_v_spec, __pyx_v_attr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 95, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "cython/core/triangulation.pyx":96
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
      __pyx_t_4 = NULL;
      __pyx_t_7 = __Pyx_GetAttr(__pyx_v_spec, __pyx_v_attr); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 96, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF_SET(__pyx_v_spec, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":97
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if spec is None:
*/
      goto __pyx_L5_break;

      /* "cython/core/triangulation.pyx":95
 * 
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 *             if hasattr(spec, attr):             # <<<<<<<<<<<<<<
 *                 spec = getattr(spec, attr)()
 *                 break
*/
    }

    /* "cython/core/triangulation.pyx":94
 *         self._link_file_full_path = None
 * 
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:             # <<<<<<<<<<<<<<
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L7_for_end;
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L7_for_end;
  __pyx_L7_for_end:;

  /* "cython/core/triangulation.pyx":99
 *                 break
 * 
 *         if spec is None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink()
 *         elif spec == 'empty':
*/
  __pyx_t_2 = (__pyx_v_spec == Py_None);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":100
 * 
 *         if spec is None:
 *             self.get_from_new_plink()             # <<<<<<<<<<<<<<
 *         elif spec == 'empty':
 *             pass
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_new_plink(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":99
 *                 break
 * 
 *         if spec is None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink()
 *         elif spec == 'empty':
*/
    goto __pyx_L8;
  }

  /* "cython/core/triangulation.pyx":101
 *         if spec is None:
 *             self.get_from_new_plink()
 *         elif spec == 'empty':             # <<<<<<<<<<<<<<
 *             pass
 *         else:
*/
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_spec, __pyx_mstate_global->__pyx_n_u_empty, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 101, __pyx_L1_error)
  if (__pyx_t_2) {
    goto __pyx_L8;
  }

  /* "cython/core/triangulation.pyx":104
 *             pass
 *         else:
 *             if not isinstance(spec, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError(triangulation_help %
 *                                 self.__class__.__name__)
*/
  /*else*/ {
    __pyx_t_8 = PyUnicode_Check(__pyx_v_spec); 
    if (!__pyx_t_8) {
    } else {
      __pyx_t_2 = __pyx_t_8;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_8 = PyBytes_Check(__pyx_v_spec); 
    __pyx_t_2 = __pyx_t_8;
    __pyx_L10_bool_binop_done:;
    __pyx_t_8 = (!__pyx_t_2);
    if (unlikely(__pyx_t_8)) {

      /* "cython/core/triangulation.pyx":105
 *         else:
 *             if not isinstance(spec, (str, bytes)):
 *                 raise TypeError(triangulation_help %             # <<<<<<<<<<<<<<
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_TypeError);
      __pyx_t_7 = __pyx_builtin_TypeError; 
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_triangulation_help); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "cython/core/triangulation.pyx":106
 *             if not isinstance(spec, (str, bytes)):
 *                 raise TypeError(triangulation_help %
 *                                 self.__class__.__name__)             # <<<<<<<<<<<<<<
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:
*/
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/triangulation.pyx":105
 *         else:
 *             if not isinstance(spec, (str, bytes)):
 *                 raise TypeError(triangulation_help %             # <<<<<<<<<<<<<<
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
*/
      __pyx_t_9 = PyNumber_Remainder(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 105, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(4, 105, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":104
 *             pass
 *         else:
 *             if not isinstance(spec, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError(triangulation_help %
 *                                 self.__class__.__name__)
*/
    }

    /* "cython/core/triangulation.pyx":107
 *                 raise TypeError(triangulation_help %
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)             # <<<<<<<<<<<<<<
 *             if self.c_triangulation == NULL:
 *                 raise RuntimeError('An empty triangulation was generated.')
*/
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.remove_finite_vertices = __pyx_v_remove_finite_vertices;
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_triangulation(__pyx_v_self, __pyx_v_spec, &__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":108
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('An empty triangulation was generated.')
 * 
*/
    __pyx_t_8 = (__pyx_v_self->c_triangulation == NULL);
    if (unlikely(__pyx_t_8)) {

      /* "cython/core/triangulation.pyx":109
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:
 *                 raise RuntimeError('An empty triangulation was generated.')             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation != NULL and not self.hyperbolic_structure_initialized:
*/
      __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_builtin_RuntimeError);
      __pyx_t_9 = __pyx_builtin_RuntimeError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_An_empty_triangulation_was_gener};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 109, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(4, 109, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":108
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('An empty triangulation was generated.')
 * 
*/
    }
  }
  __pyx_L8:;

  /* "cython/core/triangulation.pyx":111
 *                 raise RuntimeError('An empty triangulation was generated.')
 * 
 *         if self.c_triangulation != NULL and not self.hyperbolic_structure_initialized:             # <<<<<<<<<<<<<<
 *             remove_hyperbolic_structures(self.c_triangulation)
 * 
*/
  __pyx_t_2 = (__pyx_v_self->c_triangulation != NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_8 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->hyperbolic_structure_initialized); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 111, __pyx_L1_error)
  __pyx_t_12 = (!__pyx_t_2);
  __pyx_t_8 = __pyx_t_12;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_8) {

    /* "cython/core/triangulation.pyx":112
 * 
 *         if self.c_triangulation != NULL and not self.hyperbolic_structure_initialized:
 *             remove_hyperbolic_structures(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     cdef get_from_new_plink(self, file_name=None):
*/
    remove_hyperbolic_structures(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 112, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":111
 *                 raise RuntimeError('An empty triangulation was generated.')
 * 
 *         if self.c_triangulation != NULL and not self.hyperbolic_structure_initialized:             # <<<<<<<<<<<<<<
 *             remove_hyperbolic_structures(self.c_triangulation)
 * 
*/
  }

  /* "cython/core/triangulation.pyx":79
 *     cdef hyperbolic_structure_initialized
 * 
 *     def __cinit__(self, spec=None, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         if UI_callback is not None:
 *             uLongComputationBegins('Constructing a manifold', 1)
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attr);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":114
 *             remove_hyperbolic_structures(self.c_triangulation)
 * 
 *     cdef get_from_new_plink(self, file_name=None):             # <<<<<<<<<<<<<<
 *         if LinkEditor is None:
 *             raise RuntimeError('PLink was not imported.')
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_from_new_plink(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_new_plink *__pyx_optional_args) {
  PyObject *__pyx_v_file_name = ((PyObject *)Py_None);
  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;
  size_t __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("get_from_new_plink", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_file_name = __pyx_optional_args->file_name;
    }
  }

  /* "cython/core/triangulation.pyx":115
 * 
 *     cdef get_from_new_plink(self, file_name=None):
 *         if LinkEditor is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('PLink was not imported.')
 *         self.LE = LinkEditor(no_arcs=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_LinkEditor); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/triangulation.pyx":116
 *     cdef get_from_new_plink(self, file_name=None):
 *         if LinkEditor is None:
 *             raise RuntimeError('PLink was not imported.')             # <<<<<<<<<<<<<<
 *         self.LE = LinkEditor(no_arcs=True,
 *                              callback=_plink_callback,
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_4 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PLink_was_not_imported};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 116, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":115
 * 
 *     cdef get_from_new_plink(self, file_name=None):
 *         if LinkEditor is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('PLink was not imported.')
 *         self.LE = LinkEditor(no_arcs=True,
*/
  }

  /* "cython/core/triangulation.pyx":117
 *         if LinkEditor is None:
 *             raise RuntimeError('PLink was not imported.')
 *         self.LE = LinkEditor(no_arcs=True,             # <<<<<<<<<<<<<<
 *                              callback=_plink_callback,
 *                              cb_menu='Send to SnapPy',
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LinkEditor); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/triangulation.pyx":118
 *             raise RuntimeError('PLink was not imported.')
 *         self.LE = LinkEditor(no_arcs=True,
 *                              callback=_plink_callback,             # <<<<<<<<<<<<<<
 *                              cb_menu='Send to SnapPy',
 *                              file_name=file_name,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_plink_callback_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/triangulation.pyx":121
 *                              cb_menu='Send to SnapPy',
 *                              file_name=file_name,
 *                              manifold=self)             # <<<<<<<<<<<<<<
 *         print('Starting the link editor.\n'
 *               'Select Tools->Send to SnapPy to load the '
*/
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_no_arcs, Py_True, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 117, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_callback, __pyx_t_6, __pyx_t_7, __pyx_callargs+1, 1) < 0) __PYX_ERR(4, 117, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cb_menu, __pyx_mstate_global->__pyx_kp_u_Send_to_SnapPy, __pyx_t_7, __pyx_callargs+1, 2) < 0) __PYX_ERR(4, 117, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_file_name, __pyx_v_file_name, __pyx_t_7, __pyx_callargs+1, 3) < 0) __PYX_ERR(4, 117, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_manifold, ((PyObject *)__pyx_v_self), __pyx_t_7, __pyx_callargs+1, 4) < 0) __PYX_ERR(4, 117, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "cython/core/triangulation.pyx":117
 *         if LinkEditor is None:
 *             raise RuntimeError('PLink was not imported.')
 *         self.LE = LinkEditor(no_arcs=True,             # <<<<<<<<<<<<<<
 *                              callback=_plink_callback,
 *                              cb_menu='Send to SnapPy',
*/
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->LE);
  __Pyx_DECREF(__pyx_v_self->LE);
  __pyx_v_self->LE = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":122
 *                              file_name=file_name,
 *                              manifold=self)
 *         print('Starting the link editor.\n'             # <<<<<<<<<<<<<<
 *               'Select Tools->Send to SnapPy to load the '
 *               'link complement.')
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_builtin_print);
  __pyx_t_7 = __pyx_builtin_print; 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Starting_the_link_editor_Select};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":114
 *             remove_hyperbolic_structures(self.c_triangulation)
 * 
 *     cdef get_from_new_plink(self, file_name=None):             # <<<<<<<<<<<<<<
 *         if LinkEditor is None:
 *             raise RuntimeError('PLink was not imported.')
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.get_from_new_plink", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":126
 *               'link complement.')
 * 
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_spec, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation *__pyx_optional_args) {
  PyObject *__pyx_v_remove_finite_vertices = ((PyObject *)Py_True);
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_fillings = 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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation_from_name __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_triangulation", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_remove_finite_vertices = __pyx_optional_args->remove_finite_vertices;
    }
  }

  /* "cython/core/triangulation.pyx":128
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):             # <<<<<<<<<<<<<<
 *             self._from_pickle(spec, remove_finite_vertices)
 *             return
*/
  __pyx_t_2 = PyBytes_Check(__pyx_v_spec); 
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __pyx_v_spec;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_b_pickle};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 128, __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(4, 128, __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) {

    /* "cython/core/triangulation.pyx":129
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):
 *             self._from_pickle(spec, remove_finite_vertices)             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_spec, __pyx_v_remove_finite_vertices};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_pickle, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":130
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):
 *             self._from_pickle(spec, remove_finite_vertices)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if ( isinstance(spec, str) and spec.startswith('% Triangulation') or
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":128
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):             # <<<<<<<<<<<<<<
 *             self._from_pickle(spec, remove_finite_vertices)
 *             return
*/
  }

  /* "cython/core/triangulation.pyx":132
 *             return
 * 
 *         if ( isinstance(spec, str) and spec.startswith('% Triangulation') or             # <<<<<<<<<<<<<<
 *              isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             self._from_string(spec, remove_finite_vertices)
*/
  __pyx_t_2 = PyUnicode_Check(__pyx_v_spec); 
  if (!__pyx_t_2) {
    goto __pyx_L8_next_or;
  } else {
  }
  __pyx_t_4 = __pyx_v_spec;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Triangulation};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 132, __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(4, 132, __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_L7_bool_binop_done;
  }
  __pyx_L8_next_or:;

  /* "cython/core/triangulation.pyx":133
 * 
 *         if ( isinstance(spec, str) and spec.startswith('% Triangulation') or
 *              isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):             # <<<<<<<<<<<<<<
 *             self._from_string(spec, remove_finite_vertices)
 *             return
*/
  __pyx_t_2 = PyBytes_Check(__pyx_v_spec); 
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_4 = __pyx_v_spec;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_b_Triangulation};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 133, __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(4, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;

  /* "cython/core/triangulation.pyx":132
 *             return
 * 
 *         if ( isinstance(spec, str) and spec.startswith('% Triangulation') or             # <<<<<<<<<<<<<<
 *              isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             self._from_string(spec, remove_finite_vertices)
*/
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":134
 *         if ( isinstance(spec, str) and spec.startswith('% Triangulation') or
 *              isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             self._from_string(spec, remove_finite_vertices)             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_spec, __pyx_v_remove_finite_vertices};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_string, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":135
 *              isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             self._from_string(spec, remove_finite_vertices)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Get fillings, if any
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":132
 *             return
 * 
 *         if ( isinstance(spec, str) and spec.startswith('% Triangulation') or             # <<<<<<<<<<<<<<
 *              isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             self._from_string(spec, remove_finite_vertices)
*/
  }

  /* "cython/core/triangulation.pyx":138
 * 
 *         # Get fillings, if any
 *         m = split_filling_info.match(spec)             # <<<<<<<<<<<<<<
 *         name = m.group(1)
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_split_filling_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_spec};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_m = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":139
 *         # Get fillings, if any
 *         m = split_filling_info.match(spec)
 *         name = m.group(1)             # <<<<<<<<<<<<<<
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})
 * 
*/
  __pyx_t_7 = __pyx_v_m;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_1};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":140
 *         m = split_filling_info.match(spec)
 *         name = m.group(1)
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})             # <<<<<<<<<<<<<<
 * 
 *         self.get_triangulation_from_name(name, remove_finite_vertices)
*/
  __pyx_t_7 = NULL;
  __Pyx_INCREF(__pyx_builtin_eval);
  __pyx_t_4 = __pyx_builtin_eval; 
  __pyx_t_8 = __pyx_v_m;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_int_2};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[8], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u__14, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_8};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_fillings = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":142
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})
 * 
 *         self.get_triangulation_from_name(name, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *         # Set the dehn fillings
*/
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.remove_finite_vertices = __pyx_v_remove_finite_vertices;
  __pyx_t_3 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_triangulation_from_name(__pyx_v_self, __pyx_v_name, &__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":145
 * 
 *         # Set the dehn fillings
 *         Triangulation.dehn_fill(self, fillings)             # <<<<<<<<<<<<<<
 * 
 *     cdef get_triangulation_from_name(self, name, remove_finite_vertices=True):
*/
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_fillings};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":126
 *               'link complement.')
 * 
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.get_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_fillings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":147
 *         Triangulation.dehn_fill(self, fillings)
 * 
 *     cdef get_triangulation_from_name(self, name, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 * 
 *         # Step 1. The easy databases.
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_triangulation_from_name(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_name, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation_from_name *__pyx_optional_args) {
  PyObject *__pyx_v_remove_finite_vertices = ((PyObject *)Py_True);
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_regex = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_rolfsen_name = NULL;
  PyObject *__pyx_v_word = NULL;
  PyObject *__pyx_v_num_strands = NULL;
  PyObject *__pyx_v_code = NULL;
  PyObject *__pyx_v_knot = NULL;
  PyObject *__pyx_v_klp = NULL;
  PyObject *__pyx_v_shortened_name = NULL;
  PyObject *__pyx_v_mb = NULL;
  PyObject *__pyx_v_ms = NULL;
  PyObject *__pyx_9genexpr10__pyx_v_x = 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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *(*__pyx_t_21)(PyObject *);
  PyObject *__pyx_t_22[5];
  PyObject *__pyx_t_23[3];
  Triangulation *__pyx_t_24;
  int __pyx_t_25;
  struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP __pyx_t_26;
  struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_file __pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_triangulation_from_name", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_remove_finite_vertices = __pyx_optional_args->remove_finite_vertices;
    }
  }

  /* "cython/core/triangulation.pyx":150
 * 
 *         # Step 1. The easy databases.
 *         for db in database.__all_tables__.values():             # <<<<<<<<<<<<<<
 *             try:
 *                 db._one_manifold(name, self)
*/
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_all_tables); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_6 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(4, 150, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __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, NULL, &__pyx_t_5, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(4, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_db, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":151
 *         # Step 1. The easy databases.
 *         for db in database.__all_tables__.values():
 *             try:             # <<<<<<<<<<<<<<
 *                 db._one_manifold(name, self)
 *                 return
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "cython/core/triangulation.pyx":152
 *         for db in database.__all_tables__.values():
 *             try:
 *                 db._one_manifold(name, self)             # <<<<<<<<<<<<<<
 *                 return
 *             except KeyError:
*/
        __pyx_t_6 = __pyx_v_db;
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_name, ((PyObject *)__pyx_v_self)};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_one_manifold, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 152, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":153
 *             try:
 *                 db._one_manifold(name, self)
 *                 return             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 # Whenever possible, we want knots to come from
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L9_try_return;

        /* "cython/core/triangulation.pyx":151
 *         # Step 1. The easy databases.
 *         for db in database.__all_tables__.values():
 *             try:             # <<<<<<<<<<<<<<
 *                 db._one_manifold(name, self)
 *                 return
*/
      }
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":154
 *                 db._one_manifold(name, self)
 *                 return
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 # Whenever possible, we want knots to come from
 *                 # HTLinkExteriors rather than (Non)AlternatingKnots as
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("SnapPyHP.Triangulation.get_triangulation_from_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(4, 154, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_12);

        /* "cython/core/triangulation.pyx":159
 *                 # the latter only have DT codes and so return many
 *                 # different triangulations.
 *                 if is_HT_knot.match(name):             # <<<<<<<<<<<<<<
 *                     try:
 *                         db._one_manifold('K' + name, self)
*/
        __pyx_t_14 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_is_HT_knot); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 159, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 159, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_16))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16);
          assert(__pyx_t_14);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_name};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 159, __pyx_L7_except_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 159, __pyx_L7_except_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_17) {

          /* "cython/core/triangulation.pyx":160
 *                 # different triangulations.
 *                 if is_HT_knot.match(name):
 *                     try:             # <<<<<<<<<<<<<<
 *                         db._one_manifold('K' + name, self)
 *                         self.set_name(name)
*/
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            /*try:*/ {

              /* "cython/core/triangulation.pyx":161
 *                 if is_HT_knot.match(name):
 *                     try:
 *                         db._one_manifold('K' + name, self)             # <<<<<<<<<<<<<<
 *                         self.set_name(name)
 *                         return
*/
              __pyx_t_16 = __pyx_v_db;
              __Pyx_INCREF(__pyx_t_16);
              __pyx_t_14 = PyNumber_Add(__pyx_mstate_global->__pyx_n_u_K, __pyx_v_name); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 161, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_11 = 0;
              {
                PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_14, ((PyObject *)__pyx_v_self)};
                __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_one_manifold, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 161, __pyx_L16_error)
                __Pyx_GOTREF(__pyx_t_13);
              }
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

              /* "cython/core/triangulation.pyx":162
 *                     try:
 *                         db._one_manifold('K' + name, self)
 *                         self.set_name(name)             # <<<<<<<<<<<<<<
 *                         return
 *                     except:
*/
              __pyx_t_14 = ((PyObject *)__pyx_v_self);
              __Pyx_INCREF(__pyx_t_14);
              __pyx_t_11 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_name};
                __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 162, __pyx_L16_error)
                __Pyx_GOTREF(__pyx_t_13);
              }
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

              /* "cython/core/triangulation.pyx":163
 *                         db._one_manifold('K' + name, self)
 *                         self.set_name(name)
 *                         return             # <<<<<<<<<<<<<<
 *                     except:
 *                         pass
*/
              __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_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              goto __pyx_L20_try_return;

              /* "cython/core/triangulation.pyx":160
 *                 # different triangulations.
 *                 if is_HT_knot.match(name):
 *                     try:             # <<<<<<<<<<<<<<
 *                         db._one_manifold('K' + name, self)
 *                         self.set_name(name)
*/
            }
            __pyx_L16_error:;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;

            /* "cython/core/triangulation.pyx":164
 *                         self.set_name(name)
 *                         return
 *                     except:             # <<<<<<<<<<<<<<
 *                         pass
 * 
*/
            /*except:*/ {
              __Pyx_ErrRestore(0,0,0);
              goto __pyx_L17_exception_handled;
            }

            /* "cython/core/triangulation.pyx":160
 *                 # different triangulations.
 *                 if is_HT_knot.match(name):
 *                     try:             # <<<<<<<<<<<<<<
 *                         db._one_manifold('K' + name, self)
 *                         self.set_name(name)
*/
            __pyx_L20_try_return:;
            __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);
            goto __pyx_L8_except_return;
            __pyx_L17_exception_handled:;
            __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);
          }

          /* "cython/core/triangulation.pyx":159
 *                 # the latter only have DT codes and so return many
 *                 # different triangulations.
 *                 if is_HT_knot.match(name):             # <<<<<<<<<<<<<<
 *                     try:
 *                         db._one_manifold('K' + name, self)
*/
        }
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;

      /* "cython/core/triangulation.pyx":151
 *         # Step 1. The easy databases.
 *         for db in database.__all_tables__.values():
 *             try:             # <<<<<<<<<<<<<<
 *                 db._one_manifold(name, self)
 *                 return
*/
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L9_try_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L0;
      __pyx_L8_except_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L0;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":168
 * 
 *         # Step 2. Alternate names for the Rolfsen links
 *         for regex in rolfsen_link_regexs:             # <<<<<<<<<<<<<<
 *             m = regex.match(name)
 *             if m:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_rolfsen_link_regexs); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_12 = __pyx_t_1; __Pyx_INCREF(__pyx_t_12);
    __pyx_t_3 = 0;
    __pyx_t_21 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_21 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 168, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_21)) {
      if (likely(PyList_CheckExact(__pyx_t_12))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 168, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_3);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 168, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_3));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 168, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_21(__pyx_t_12);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 168, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_regex, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":169
 *         # Step 2. Alternate names for the Rolfsen links
 *         for regex in rolfsen_link_regexs:
 *             m = regex.match(name)             # <<<<<<<<<<<<<<
 *             if m:
 *                 if int(m.group('components')) > 1:
*/
    __pyx_t_6 = __pyx_v_regex;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_name};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":170
 *         for regex in rolfsen_link_regexs:
 *             m = regex.match(name)
 *             if m:             # <<<<<<<<<<<<<<
 *                 if int(m.group('components')) > 1:
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
*/
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 170, __pyx_L1_error)
    if (__pyx_t_17) {

      /* "cython/core/triangulation.pyx":171
 *             m = regex.match(name)
 *             if m:
 *                 if int(m.group('components')) > 1:             # <<<<<<<<<<<<<<
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
 *                                                  int(m.group('components')),
*/
      __pyx_t_6 = __pyx_v_m;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_components};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 171, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 171, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_17) {

        /* "cython/core/triangulation.pyx":172
 *             if m:
 *                 if int(m.group('components')) > 1:
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),             # <<<<<<<<<<<<<<
 *                                                  int(m.group('components')),
 *                                                  int(m.group('index')))
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[9], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cython/core/triangulation.pyx":173
 *                 if int(m.group('components')) > 1:
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
 *                                                  int(m.group('components')),             # <<<<<<<<<<<<<<
 *                                                  int(m.group('index')))
 *                 else:
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 173, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[10], NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 173, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 173, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 173, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cython/core/triangulation.pyx":174
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
 *                                                  int(m.group('components')),
 *                                                  int(m.group('index')))             # <<<<<<<<<<<<<<
 *                 else:
 *                     rolfsen_name = '%d_%d' % (int(m.group('crossings')),
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[11], NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_22[0] = __pyx_t_6;
        __pyx_t_22[1] = __pyx_mstate_global->__pyx_kp_u__20;
        __pyx_t_22[2] = __pyx_t_5;
        __pyx_t_22[3] = __pyx_mstate_global->__pyx_n_u__21;
        __pyx_t_22[4] = __pyx_t_13;

        /* "cython/core/triangulation.pyx":172
 *             if m:
 *                 if int(m.group('components')) > 1:
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),             # <<<<<<<<<<<<<<
 *                                                  int(m.group('components')),
 *                                                  int(m.group('index')))
*/
        __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_22, 5, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_rolfsen_name = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;

        /* "cython/core/triangulation.pyx":171
 *             m = regex.match(name)
 *             if m:
 *                 if int(m.group('components')) > 1:             # <<<<<<<<<<<<<<
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
 *                                                  int(m.group('components')),
*/
        goto __pyx_L29;
      }

      /* "cython/core/triangulation.pyx":176
 *                                                  int(m.group('index')))
 *                 else:
 *                     rolfsen_name = '%d_%d' % (int(m.group('crossings')),             # <<<<<<<<<<<<<<
 *                                               int(m.group('index')))
 *                 database.LinkExteriors._one_manifold(rolfsen_name, self)
*/
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[9], NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cython/core/triangulation.pyx":177
 *                 else:
 *                     rolfsen_name = '%d_%d' % (int(m.group('crossings')),
 *                                               int(m.group('index')))             # <<<<<<<<<<<<<<
 *                 database.LinkExteriors._one_manifold(rolfsen_name, self)
 *                 return
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[11], NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_23[0] = __pyx_t_13;
        __pyx_t_23[1] = __pyx_mstate_global->__pyx_n_u__21;
        __pyx_t_23[2] = __pyx_t_5;

        /* "cython/core/triangulation.pyx":176
 *                                                  int(m.group('index')))
 *                 else:
 *                     rolfsen_name = '%d_%d' % (int(m.group('crossings')),             # <<<<<<<<<<<<<<
 *                                               int(m.group('index')))
 *                 database.LinkExteriors._one_manifold(rolfsen_name, self)
*/
        __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_23, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_rolfsen_name = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
      }
      __pyx_L29:;

      /* "cython/core/triangulation.pyx":178
 *                     rolfsen_name = '%d_%d' % (int(m.group('crossings')),
 *                                               int(m.group('index')))
 *                 database.LinkExteriors._one_manifold(rolfsen_name, self)             # <<<<<<<<<<<<<<
 *                 return
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_LinkExteriors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_5 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_rolfsen_name, ((PyObject *)__pyx_v_self)};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_one_manifold, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 178, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/triangulation.pyx":179
 *                                               int(m.group('index')))
 *                 database.LinkExteriors._one_manifold(rolfsen_name, self)
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         # Step 3. Hoste-Thistlethwaite knots
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":170
 *         for regex in rolfsen_link_regexs:
 *             m = regex.match(name)
 *             if m:             # <<<<<<<<<<<<<<
 *                 if int(m.group('components')) > 1:
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
*/
    }

    /* "cython/core/triangulation.pyx":168
 * 
 *         # Step 2. Alternate names for the Rolfsen links
 *         for regex in rolfsen_link_regexs:             # <<<<<<<<<<<<<<
 *             m = regex.match(name)
 *             if m:
*/
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "cython/core/triangulation.pyx":182
 * 
 *         # Step 3. Hoste-Thistlethwaite knots
 *         m = is_HT_knot.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_HT_knot); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_name};
    __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
  }
  __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_12);
  __pyx_t_12 = 0;

  /* "cython/core/triangulation.pyx":183
 *         # Step 3. Hoste-Thistlethwaite knots
 *         m = is_HT_knot.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),
 *                              int(m.group('index')), remove_finite_vertices)
*/
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 183, __pyx_L1_error)
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":184
 *         m = is_HT_knot.match(name)
 *         if m:
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),             # <<<<<<<<<<<<<<
 *                              int(m.group('index')), remove_finite_vertices)
 *             return
*/
    __pyx_t_5 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_crossings};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_1 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_n_u_alternation};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }

    /* "cython/core/triangulation.pyx":185
 *         if m:
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),
 *                              int(m.group('index')), remove_finite_vertices)             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_6 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_index};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":184
 *         m = is_HT_knot.match(name)
 *         if m:
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),             # <<<<<<<<<<<<<<
 *                              int(m.group('index')), remove_finite_vertices)
 *             return
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_HT_knot(__pyx_v_self, __pyx_t_5, __pyx_t_12, __pyx_t_6, __pyx_v_remove_finite_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":186
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),
 *                              int(m.group('index')), remove_finite_vertices)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Step 4. Once-punctured torus bundles
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":183
 *         # Step 3. Hoste-Thistlethwaite knots
 *         m = is_HT_knot.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),
 *                              int(m.group('index')), remove_finite_vertices)
*/
  }

  /* "cython/core/triangulation.pyx":189
 * 
 *         # Step 4. Once-punctured torus bundles
 *         m = is_torus_bundle.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             self.get_punctured_torus_bundle(m)
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_is_torus_bundle); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":190
 *         # Step 4. Once-punctured torus bundles
 *         m = is_torus_bundle.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             self.get_punctured_torus_bundle(m)
 *             if self.c_triangulation != NULL:
*/
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 190, __pyx_L1_error)
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":191
 *         m = is_torus_bundle.match(name)
 *         if m:
 *             self.get_punctured_torus_bundle(m)             # <<<<<<<<<<<<<<
 *             if self.c_triangulation != NULL:
 *                 return
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_punctured_torus_bundle(__pyx_v_self, __pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":192
 *         if m:
 *             self.get_punctured_torus_bundle(m)
 *             if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *                 return
 * 
*/
    __pyx_t_17 = (__pyx_v_self->c_triangulation != NULL);
    if (__pyx_t_17) {

      /* "cython/core/triangulation.pyx":193
 *             self.get_punctured_torus_bundle(m)
 *             if self.c_triangulation != NULL:
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         # Step 5. (fibered) braid complements
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":192
 *         if m:
 *             self.get_punctured_torus_bundle(m)
 *             if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *                 return
 * 
*/
    }

    /* "cython/core/triangulation.pyx":190
 *         # Step 4. Once-punctured torus bundles
 *         m = is_torus_bundle.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             self.get_punctured_torus_bundle(m)
 *             if self.c_triangulation != NULL:
*/
  }

  /* "cython/core/triangulation.pyx":196
 * 
 *         # Step 5. (fibered) braid complements
 *         m = is_braid_complement.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             word = eval(m.group(1), {})
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_braid_complement); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":197
 *         # Step 5. (fibered) braid complements
 *         m = is_braid_complement.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             word = eval(m.group(1), {})
 *             num_strands = max([abs(x) for x in word]) + 1
*/
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 197, __pyx_L1_error)
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":198
 *         m = is_braid_complement.match(name)
 *         if m:
 *             word = eval(m.group(1), {})             # <<<<<<<<<<<<<<
 *             num_strands = max([abs(x) for x in word]) + 1
 *             self.set_c_triangulation(get_fibered_manifold_associated_to_braid(num_strands, word))
*/
    __pyx_t_12 = NULL;
    __Pyx_INCREF(__pyx_builtin_eval);
    __pyx_t_5 = __pyx_builtin_eval; 
    __pyx_t_13 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_13 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_6, __pyx_t_13};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_word = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":199
 *         if m:
 *             word = eval(m.group(1), {})
 *             num_strands = max([abs(x) for x in word]) + 1             # <<<<<<<<<<<<<<
 *             self.set_c_triangulation(get_fibered_manifold_associated_to_braid(num_strands, word))
 *             return
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_max);
    __pyx_t_13 = __pyx_builtin_max; 
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 199, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (likely(PyList_CheckExact(__pyx_v_word)) || PyTuple_CheckExact(__pyx_v_word)) {
        __pyx_t_12 = __pyx_v_word; __Pyx_INCREF(__pyx_t_12);
        __pyx_t_3 = 0;
        __pyx_t_21 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_word); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 199, __pyx_L37_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_21 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 199, __pyx_L37_error)
      }
      for (;;) {
        if (likely(!__pyx_t_21)) {
          if (likely(PyList_CheckExact(__pyx_t_12))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 199, __pyx_L37_error)
              #endif
              if (__pyx_t_3 >= __pyx_temp) break;
            }
            __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_3);
            ++__pyx_t_3;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 199, __pyx_L37_error)
              #endif
              if (__pyx_t_3 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_14 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_3));
            #else
            __pyx_t_14 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_3);
            #endif
            ++__pyx_t_3;
          }
          if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 199, __pyx_L37_error)
        } else {
          __pyx_t_14 = __pyx_t_21(__pyx_t_12);
          if (unlikely(!__pyx_t_14)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 199, __pyx_L37_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_x, __pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyNumber_Absolute(__pyx_9genexpr10__pyx_v_x); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 199, __pyx_L37_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_14))) __PYX_ERR(4, 199, __pyx_L37_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_x); __pyx_9genexpr10__pyx_v_x = 0;
      goto __pyx_L41_exit_scope;
      __pyx_L37_error:;
      __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_x); __pyx_9genexpr10__pyx_v_x = 0;
      goto __pyx_L1_error;
      __pyx_L41_exit_scope:;
    } /* exit inner scope */
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_13 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_num_strands = __pyx_t_13;
    __pyx_t_13 = 0;

    /* "cython/core/triangulation.pyx":200
 *             word = eval(m.group(1), {})
 *             num_strands = max([abs(x) for x in word]) + 1
 *             self.set_c_triangulation(get_fibered_manifold_associated_to_braid(num_strands, word))             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_24 = __pyx_f_8SnapPyHP_get_fibered_manifold_associated_to_braid(__pyx_v_num_strands, __pyx_v_word); if (unlikely(__pyx_t_24 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 200, __pyx_L1_error)
    __pyx_t_13 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_24); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cython/core/triangulation.pyx":201
 *             num_strands = max([abs(x) for x in word]) + 1
 *             self.set_c_triangulation(get_fibered_manifold_associated_to_braid(num_strands, word))
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Step 6. Dowker-Thistlethwaite codes
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":197
 *         # Step 5. (fibered) braid complements
 *         m = is_braid_complement.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             word = eval(m.group(1), {})
 *             num_strands = max([abs(x) for x in word]) + 1
*/
  }

  /* "cython/core/triangulation.pyx":204
 * 
 *         # Step 6. Dowker-Thistlethwaite codes
 *         m = is_int_DT_exterior.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             code = eval(m.group(1), {})
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_int_DT_exterior); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_name};
    __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
  }
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_13);
  __pyx_t_13 = 0;

  /* "cython/core/triangulation.pyx":205
 *         # Step 6. Dowker-Thistlethwaite codes
 *         m = is_int_DT_exterior.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             code = eval(m.group(1), {})
 *             if isinstance(code, tuple):
*/
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 205, __pyx_L1_error)
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":206
 *         m = is_int_DT_exterior.match(name)
 *         if m:
 *             code = eval(m.group(1), {})             # <<<<<<<<<<<<<<
 *             if isinstance(code, tuple):
 *                 knot = spherogram.DTcodec(*code)
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_eval);
    __pyx_t_1 = __pyx_builtin_eval; 
    __pyx_t_12 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_12 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_12};
      __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
    }
    __pyx_v_code = __pyx_t_13;
    __pyx_t_13 = 0;

    /* "cython/core/triangulation.pyx":207
 *         if m:
 *             code = eval(m.group(1), {})
 *             if isinstance(code, tuple):             # <<<<<<<<<<<<<<
 *                 knot = spherogram.DTcodec(*code)
 *             elif isinstance(code, list) and isinstance(code[0], int):
*/
    __pyx_t_17 = PyTuple_Check(__pyx_v_code); 
    if (__pyx_t_17) {

      /* "cython/core/triangulation.pyx":208
 *             code = eval(m.group(1), {})
 *             if isinstance(code, tuple):
 *                 knot = spherogram.DTcodec(*code)             # <<<<<<<<<<<<<<
 *             elif isinstance(code, list) and isinstance(code[0], int):
 *                 knot = spherogram.DTcodec([tuple(code)])
*/
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PySequence_Tuple(__pyx_v_code); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_v_knot = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "cython/core/triangulation.pyx":207
 *         if m:
 *             code = eval(m.group(1), {})
 *             if isinstance(code, tuple):             # <<<<<<<<<<<<<<
 *                 knot = spherogram.DTcodec(*code)
 *             elif isinstance(code, list) and isinstance(code[0], int):
*/
      goto __pyx_L43;
    }

    /* "cython/core/triangulation.pyx":209
 *             if isinstance(code, tuple):
 *                 knot = spherogram.DTcodec(*code)
 *             elif isinstance(code, list) and isinstance(code[0], int):             # <<<<<<<<<<<<<<
 *                 knot = spherogram.DTcodec([tuple(code)])
 *             else:
*/
    __pyx_t_25 = PyList_Check(__pyx_v_code); 
    if (__pyx_t_25) {
    } else {
      __pyx_t_17 = __pyx_t_25;
      goto __pyx_L44_bool_binop_done;
    }
    __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_code, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_25 = PyLong_Check(__pyx_t_12); 
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_17 = __pyx_t_25;
    __pyx_L44_bool_binop_done:;
    if (__pyx_t_17) {

      /* "cython/core/triangulation.pyx":210
 *                 knot = spherogram.DTcodec(*code)
 *             elif isinstance(code, list) and isinstance(code[0], int):
 *                 knot = spherogram.DTcodec([tuple(code)])             # <<<<<<<<<<<<<<
 *             else:
 *                 knot = spherogram.DTcodec(code)
*/
      __pyx_t_13 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_1) != (0)) __PYX_ERR(4, 210, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_13);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_5};
        __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_v_knot = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "cython/core/triangulation.pyx":209
 *             if isinstance(code, tuple):
 *                 knot = spherogram.DTcodec(*code)
 *             elif isinstance(code, list) and isinstance(code[0], int):             # <<<<<<<<<<<<<<
 *                 knot = spherogram.DTcodec([tuple(code)])
 *             else:
*/
      goto __pyx_L43;
    }

    /* "cython/core/triangulation.pyx":212
 *                 knot = spherogram.DTcodec([tuple(code)])
 *             else:
 *                 knot = spherogram.DTcodec(code)             # <<<<<<<<<<<<<<
 *             klp = knot.KLPProjection()
 *             self.set_c_triangulation(
*/
    /*else*/ {
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_code};
        __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_v_knot = __pyx_t_12;
      __pyx_t_12 = 0;
    }
    __pyx_L43:;

    /* "cython/core/triangulation.pyx":213
 *             else:
 *                 knot = spherogram.DTcodec(code)
 *             klp = knot.KLPProjection()             # <<<<<<<<<<<<<<
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
*/
    __pyx_t_13 = __pyx_v_knot;
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_KLPProjection, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_v_klp = __pyx_t_12;
    __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":215
 *             klp = knot.KLPProjection()
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))             # <<<<<<<<<<<<<<
 *             self.set_name(name)
 *             self._set_DTcode(knot)
*/
    __pyx_t_26.__pyx_n = 1;
    __pyx_t_26.remove_finite_vertices = __pyx_v_remove_finite_vertices;
    __pyx_t_24 = __pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(__pyx_v_klp, &__pyx_t_26); if (unlikely(__pyx_t_24 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 215, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":214
 *                 knot = spherogram.DTcodec(code)
 *             klp = knot.KLPProjection()
 *             self.set_c_triangulation(             # <<<<<<<<<<<<<<
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)
*/
    __pyx_t_12 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_24); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":216
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)             # <<<<<<<<<<<<<<
 *             self._set_DTcode(knot)
 *             return
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_name};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":217
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)
 *             self._set_DTcode(knot)             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_knot};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_DTcode, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":218
 *             self.set_name(name)
 *             self._set_DTcode(knot)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         m = is_alpha_DT_exterior.match(name)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":205
 *         # Step 6. Dowker-Thistlethwaite codes
 *         m = is_int_DT_exterior.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             code = eval(m.group(1), {})
 *             if isinstance(code, tuple):
*/
  }

  /* "cython/core/triangulation.pyx":220
 *             return
 * 
 *         m = is_alpha_DT_exterior.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             knot = spherogram.DTcodec(m.group(1))
*/
  __pyx_t_13 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_alpha_DT_exterior); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_13);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_13);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_name};
    __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
  }
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_12);
  __pyx_t_12 = 0;

  /* "cython/core/triangulation.pyx":221
 * 
 *         m = is_alpha_DT_exterior.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             knot = spherogram.DTcodec(m.group(1))
 *             klp=knot.KLPProjection()
*/
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 221, __pyx_L1_error)
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":222
 *         m = is_alpha_DT_exterior.match(name)
 *         if m:
 *             knot = spherogram.DTcodec(m.group(1))             # <<<<<<<<<<<<<<
 *             klp=knot.KLPProjection()
 *             self.set_c_triangulation(
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_1 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
    }
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_13};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_v_knot = __pyx_t_12;
    __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":223
 *         if m:
 *             knot = spherogram.DTcodec(m.group(1))
 *             klp=knot.KLPProjection()             # <<<<<<<<<<<<<<
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
*/
    __pyx_t_6 = __pyx_v_knot;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_KLPProjection, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_v_klp = __pyx_t_12;
    __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":225
 *             klp=knot.KLPProjection()
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))             # <<<<<<<<<<<<<<
 *             self.set_name(name)
 *             self._set_DTcode(knot)
*/
    __pyx_t_26.__pyx_n = 1;
    __pyx_t_26.remove_finite_vertices = __pyx_v_remove_finite_vertices;
    __pyx_t_24 = __pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(__pyx_v_klp, &__pyx_t_26); if (unlikely(__pyx_t_24 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 225, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":224
 *             knot = spherogram.DTcodec(m.group(1))
 *             klp=knot.KLPProjection()
 *             self.set_c_triangulation(             # <<<<<<<<<<<<<<
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)
*/
    __pyx_t_12 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_24); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":226
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)             # <<<<<<<<<<<<<<
 *             self._set_DTcode(knot)
 *             return
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_name};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":227
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)
 *             self._set_DTcode(knot)             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_knot};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_DTcode, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":228
 *             self.set_name(name)
 *             self._set_DTcode(knot)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Step 7.  Bundle or splitting is given in Twister's notation
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":221
 * 
 *         m = is_alpha_DT_exterior.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             knot = spherogram.DTcodec(m.group(1))
 *             klp=knot.KLPProjection()
*/
  }

  /* "cython/core/triangulation.pyx":231
 * 
 *         # Step 7.  Bundle or splitting is given in Twister's notation
 *         shortened_name = name.replace(' ', '')             # <<<<<<<<<<<<<<
 *         mb = is_twister_bundle.match(shortened_name)
 *         if mb:
*/
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_shortened_name = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":232
 *         # Step 7.  Bundle or splitting is given in Twister's notation
 *         shortened_name = name.replace(' ', '')
 *         mb = is_twister_bundle.match(shortened_name)             # <<<<<<<<<<<<<<
 *         if mb:
 *             self._from_string(
*/
  __pyx_t_12 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_is_twister_bundle); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_12);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_12);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_shortened_name};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_mb = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":233
 *         shortened_name = name.replace(' ', '')
 *         mb = is_twister_bundle.match(shortened_name)
 *         if mb:             # <<<<<<<<<<<<<<
 *             self._from_string(
 *                 bundle_from_string(shortened_name), remove_finite_vertices)
*/
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_mb); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 233, __pyx_L1_error)
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":234
 *         mb = is_twister_bundle.match(shortened_name)
 *         if mb:
 *             self._from_string(             # <<<<<<<<<<<<<<
 *                 bundle_from_string(shortened_name), remove_finite_vertices)
 *             return
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);

    /* "cython/core/triangulation.pyx":235
 *         if mb:
 *             self._from_string(
 *                 bundle_from_string(shortened_name), remove_finite_vertices)             # <<<<<<<<<<<<<<
 *             return
 *         ms = is_twister_splitting.match(shortened_name)
*/
    __pyx_t_13 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_bundle_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_13);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_shortened_name};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_12, __pyx_v_remove_finite_vertices};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_string, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":236
 *             self._from_string(
 *                 bundle_from_string(shortened_name), remove_finite_vertices)
 *             return             # <<<<<<<<<<<<<<
 *         ms = is_twister_splitting.match(shortened_name)
 *         if ms:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":233
 *         shortened_name = name.replace(' ', '')
 *         mb = is_twister_bundle.match(shortened_name)
 *         if mb:             # <<<<<<<<<<<<<<
 *             self._from_string(
 *                 bundle_from_string(shortened_name), remove_finite_vertices)
*/
  }

  /* "cython/core/triangulation.pyx":237
 *                 bundle_from_string(shortened_name), remove_finite_vertices)
 *             return
 *         ms = is_twister_splitting.match(shortened_name)             # <<<<<<<<<<<<<<
 *         if ms:
 *             self._from_string(
*/
  __pyx_t_12 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_is_twister_splitting); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_12);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_12);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_shortened_name};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_ms = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":238
 *             return
 *         ms = is_twister_splitting.match(shortened_name)
 *         if ms:             # <<<<<<<<<<<<<<
 *             self._from_string(
 *                 splitting_from_string(shortened_name), remove_finite_vertices)
*/
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_ms); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(4, 238, __pyx_L1_error)
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":239
 *         ms = is_twister_splitting.match(shortened_name)
 *         if ms:
 *             self._from_string(             # <<<<<<<<<<<<<<
 *                 splitting_from_string(shortened_name), remove_finite_vertices)
 *             return
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);

    /* "cython/core/triangulation.pyx":240
 *         if ms:
 *             self._from_string(
 *                 splitting_from_string(shortened_name), remove_finite_vertices)             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_splitting_from_string); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_13);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_shortened_name};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_12, __pyx_v_remove_finite_vertices};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_string, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 239, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":241
 *             self._from_string(
 *                 splitting_from_string(shortened_name), remove_finite_vertices)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Step 8. Regina/Burton isomorphism signatures.
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":238
 *             return
 *         ms = is_twister_splitting.match(shortened_name)
 *         if ms:             # <<<<<<<<<<<<<<
 *             self._from_string(
 *                 splitting_from_string(shortened_name), remove_finite_vertices)
*/
  }

  /* "cython/core/triangulation.pyx":244
 * 
 *         # Step 8. Regina/Burton isomorphism signatures.
 *         self._from_isosig(name, remove_finite_vertices)             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             return
*/
  __pyx_t_12 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_12);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_name, __pyx_v_remove_finite_vertices};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_isosig, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":245
 *         # Step 8. Regina/Burton isomorphism signatures.
 *         self._from_isosig(name, remove_finite_vertices)
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_17 = (__pyx_v_self->c_triangulation != NULL);
  if (__pyx_t_17) {

    /* "cython/core/triangulation.pyx":246
 *         self._from_isosig(name, remove_finite_vertices)
 *         if self.c_triangulation != NULL:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Step 9. If all else fails, try to load a manifold from a file.
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":245
 *         # Step 8. Regina/Burton isomorphism signatures.
 *         self._from_isosig(name, remove_finite_vertices)
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "cython/core/triangulation.pyx":249
 * 
 *         # Step 9. If all else fails, try to load a manifold from a file.
 *         self.get_from_file(name, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *     cdef get_HT_knot(self, crossings, alternation, index, remove_finite_vertices):
*/
  __pyx_t_27.__pyx_n = 1;
  __pyx_t_27.remove_finite_vertices = __pyx_v_remove_finite_vertices;
  __pyx_t_6 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_file(__pyx_v_self, __pyx_v_name, &__pyx_t_27); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":147
 *         Triangulation.dehn_fill(self, fillings)
 * 
 *     cdef get_triangulation_from_name(self, name, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 * 
 *         # Step 1. The easy databases.
*/

  /* 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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.get_triangulation_from_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_regex);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_rolfsen_name);
  __Pyx_XDECREF(__pyx_v_word);
  __Pyx_XDECREF(__pyx_v_num_strands);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_knot);
  __Pyx_XDECREF(__pyx_v_klp);
  __Pyx_XDECREF(__pyx_v_shortened_name);
  __Pyx_XDECREF(__pyx_v_mb);
  __Pyx_XDECREF(__pyx_v_ms);
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":251
 *         self.get_from_file(name, remove_finite_vertices)
 * 
 *     cdef get_HT_knot(self, crossings, alternation, index, remove_finite_vertices):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         DT = [get_HT_knot_DT(crossings, alternation, index)]
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_HT_knot(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_crossings, PyObject *__pyx_v_alternation, PyObject *__pyx_v_index, PyObject *__pyx_v_remove_finite_vertices) {
  Triangulation *__pyx_v_c_triangulation;
  PyObject *__pyx_v_DT = NULL;
  PyObject *__pyx_v_knot = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Triangulation *__pyx_t_6;
  struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  char *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_HT_knot", 0);

  /* "cython/core/triangulation.pyx":253
 *     cdef get_HT_knot(self, crossings, alternation, index, remove_finite_vertices):
 *         cdef c_Triangulation* c_triangulation
 *         DT = [get_HT_knot_DT(crossings, alternation, index)]             # <<<<<<<<<<<<<<
 *         knot = spherogram.DTcodec(DT)
 *         c_triangulation = get_triangulation_from_PythonKLP(
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_HT_knot_DT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_crossings, __pyx_v_alternation, __pyx_v_index};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(4, 253, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_v_DT = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":254
 *         cdef c_Triangulation* c_triangulation
 *         DT = [get_HT_knot_DT(crossings, alternation, index)]
 *         knot = spherogram.DTcodec(DT)             # <<<<<<<<<<<<<<
 *         c_triangulation = get_triangulation_from_PythonKLP(
 *             knot.KLPProjection(), remove_finite_vertices)
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_DT};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_knot = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":256
 *         knot = spherogram.DTcodec(DT)
 *         c_triangulation = get_triangulation_from_PythonKLP(
 *             knot.KLPProjection(), remove_finite_vertices)             # <<<<<<<<<<<<<<
 *         name = to_byte_str('%d' % crossings + alternation + '%d' % index)
 *         set_triangulation_name(c_triangulation, name)
*/
  __pyx_t_5 = __pyx_v_knot;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_KLPProjection, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }

  /* "cython/core/triangulation.pyx":255
 *         DT = [get_HT_knot_DT(crossings, alternation, index)]
 *         knot = spherogram.DTcodec(DT)
 *         c_triangulation = get_triangulation_from_PythonKLP(             # <<<<<<<<<<<<<<
 *             knot.KLPProjection(), remove_finite_vertices)
 *         name = to_byte_str('%d' % crossings + alternation + '%d' % index)
*/
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.remove_finite_vertices = __pyx_v_remove_finite_vertices;
  __pyx_t_6 = __pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(__pyx_t_3, &__pyx_t_7); if (unlikely(__pyx_t_6 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_c_triangulation = __pyx_t_6;

  /* "cython/core/triangulation.pyx":257
 *         c_triangulation = get_triangulation_from_PythonKLP(
 *             knot.KLPProjection(), remove_finite_vertices)
 *         name = to_byte_str('%d' % crossings + alternation + '%d' % index)             # <<<<<<<<<<<<<<
 *         set_triangulation_name(c_triangulation, name)
 *         self._set_DTcode(knot)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d, __pyx_v_crossings); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_v_alternation); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":258
 *             knot.KLPProjection(), remove_finite_vertices)
 *         name = to_byte_str('%d' % crossings + alternation + '%d' % index)
 *         set_triangulation_name(c_triangulation, name)             # <<<<<<<<<<<<<<
 *         self._set_DTcode(knot)
 *         self.set_c_triangulation(c_triangulation)
*/
  __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(4, 258, __pyx_L1_error)
  set_triangulation_name(__pyx_v_c_triangulation, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 258, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":259
 *         name = to_byte_str('%d' % crossings + alternation + '%d' % index)
 *         set_triangulation_name(c_triangulation, name)
 *         self._set_DTcode(knot)             # <<<<<<<<<<<<<<
 *         self.set_c_triangulation(c_triangulation)
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_knot};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_DTcode, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":260
 *         set_triangulation_name(c_triangulation, name)
 *         self._set_DTcode(knot)
 *         self.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     cdef get_punctured_torus_bundle(self, match):
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":251
 *         self.get_from_file(name, remove_finite_vertices)
 * 
 *     cdef get_HT_knot(self, crossings, alternation, index, remove_finite_vertices):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         DT = [get_HT_knot_DT(crossings, alternation, index)]
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.get_HT_knot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_DT);
  __Pyx_XDECREF(__pyx_v_knot);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":262
 *         self.set_c_triangulation(c_triangulation)
 * 
 *     cdef get_punctured_torus_bundle(self, match):             # <<<<<<<<<<<<<<
 *         cdef LRFactorization* gluing
 *         cdef size_t LRlength, i
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_punctured_torus_bundle(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_match) {
  LRFactorization *__pyx_v_gluing;
  size_t __pyx_v_LRlength;
  size_t __pyx_v_i;
  char *__pyx_v_LRstring;
  PyObject *__pyx_v_LRpart = 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;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  char *__pyx_t_10;
  LRFactorization *__pyx_t_11;
  Boolean __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  Triangulation *__pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_punctured_torus_bundle", 0);

  /* "cython/core/triangulation.pyx":267
 *         cdef char* LRstring
 * 
 *         LRpart = to_byte_str(match.group(3).upper())             # <<<<<<<<<<<<<<
 *         LRlength = len(LRpart)
 *         LRstring = LRpart
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __pyx_v_match;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_3};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_5 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __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(4, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_LRpart = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":268
 * 
 *         LRpart = to_byte_str(match.group(3).upper())
 *         LRlength = len(LRpart)             # <<<<<<<<<<<<<<
 *         LRstring = LRpart
 *         gluing = alloc_LR_factorization(<int>LRlength)
*/
  __pyx_t_9 = PyObject_Length(__pyx_v_LRpart); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(4, 268, __pyx_L1_error)
  __pyx_v_LRlength = __pyx_t_9;

  /* "cython/core/triangulation.pyx":269
 *         LRpart = to_byte_str(match.group(3).upper())
 *         LRlength = len(LRpart)
 *         LRstring = LRpart             # <<<<<<<<<<<<<<
 *         gluing = alloc_LR_factorization(<int>LRlength)
 *         gluing.is_available = True
*/
  __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_v_LRpart); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(4, 269, __pyx_L1_error)
  __pyx_v_LRstring = __pyx_t_10;

  /* "cython/core/triangulation.pyx":270
 *         LRlength = len(LRpart)
 *         LRstring = LRpart
 *         gluing = alloc_LR_factorization(<int>LRlength)             # <<<<<<<<<<<<<<
 *         gluing.is_available = True
 *         gluing.negative_determinant = 1 if match.group(1) in ['-', 'n'] else 0
*/
  __pyx_t_11 = alloc_LR_factorization(((int)__pyx_v_LRlength)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 270, __pyx_L1_error)
  __pyx_v_gluing = __pyx_t_11;

  /* "cython/core/triangulation.pyx":271
 *         LRstring = LRpart
 *         gluing = alloc_LR_factorization(<int>LRlength)
 *         gluing.is_available = True             # <<<<<<<<<<<<<<
 *         gluing.negative_determinant = 1 if match.group(1) in ['-', 'n'] else 0
 *         gluing.negative_trace = 0 if match.group(2) == '+' else 1
*/
  __pyx_v_gluing->is_available = 1;

  /* "cython/core/triangulation.pyx":272
 *         gluing = alloc_LR_factorization(<int>LRlength)
 *         gluing.is_available = True
 *         gluing.negative_determinant = 1 if match.group(1) in ['-', 'n'] else 0             # <<<<<<<<<<<<<<
 *         gluing.negative_trace = 0 if match.group(2) == '+' else 1
 *         for i from 0 <= i < LRlength:
*/
  __pyx_t_3 = __pyx_v_match;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__22, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(4, 272, __pyx_L1_error)
  if (!__pyx_t_14) {
  } else {
    __pyx_t_13 = __pyx_t_14;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_n, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(4, 272, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_14;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __pyx_t_13;
  if (__pyx_t_14) {
    __pyx_t_12 = 1;
  } else {
    __pyx_t_12 = 0;
  }
  __pyx_v_gluing->negative_determinant = __pyx_t_12;

  /* "cython/core/triangulation.pyx":273
 *         gluing.is_available = True
 *         gluing.negative_determinant = 1 if match.group(1) in ['-', 'n'] else 0
 *         gluing.negative_trace = 0 if match.group(2) == '+' else 1             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < LRlength:
 *             gluing.LR_factors[i] = LRstring[i]
*/
  __pyx_t_3 = __pyx_v_match;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_2};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__23, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(4, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_14) {
    __pyx_t_12 = 0;
  } else {
    __pyx_t_12 = 1;
  }
  __pyx_v_gluing->negative_trace = __pyx_t_12;

  /* "cython/core/triangulation.pyx":274
 *         gluing.negative_determinant = 1 if match.group(1) in ['-', 'n'] else 0
 *         gluing.negative_trace = 0 if match.group(2) == '+' else 1
 *         for i from 0 <= i < LRlength:             # <<<<<<<<<<<<<<
 *             gluing.LR_factors[i] = LRstring[i]
 *         self.set_c_triangulation(triangulate_punctured_torus_bundle(gluing))
*/
  __pyx_t_8 = __pyx_v_LRlength;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":275
 *         gluing.negative_trace = 0 if match.group(2) == '+' else 1
 *         for i from 0 <= i < LRlength:
 *             gluing.LR_factors[i] = LRstring[i]             # <<<<<<<<<<<<<<
 *         self.set_c_triangulation(triangulate_punctured_torus_bundle(gluing))
 *         free_LR_factorization(gluing)
*/
    (__pyx_v_gluing->LR_factors[__pyx_v_i]) = (__pyx_v_LRstring[__pyx_v_i]);
  }

  /* "cython/core/triangulation.pyx":276
 *         for i from 0 <= i < LRlength:
 *             gluing.LR_factors[i] = LRstring[i]
 *         self.set_c_triangulation(triangulate_punctured_torus_bundle(gluing))             # <<<<<<<<<<<<<<
 *         free_LR_factorization(gluing)
 * 
*/
  __pyx_t_15 = triangulate_punctured_torus_bundle(__pyx_v_gluing); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 276, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":277
 *             gluing.LR_factors[i] = LRstring[i]
 *         self.set_c_triangulation(triangulate_punctured_torus_bundle(gluing))
 *         free_LR_factorization(gluing)             # <<<<<<<<<<<<<<
 * 
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):
*/
  free_LR_factorization(__pyx_v_gluing); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 277, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":262
 *         self.set_c_triangulation(c_triangulation)
 * 
 *     cdef get_punctured_torus_bundle(self, match):             # <<<<<<<<<<<<<<
 *         cdef LRFactorization* gluing
 *         cdef size_t LRlength, i
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.get_punctured_torus_bundle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_LRpart);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":279
 *         free_LR_factorization(gluing)
 * 
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_3_get_from_link_data(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_3_get_from_link_data = {"_get_from_link_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_3_get_from_link_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_3_get_from_link_data(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_data = 0;
  PyObject *__pyx_v_remove_finite_vertices = 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_from_link_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_remove_finite_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 279, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_from_link_data", 0) < 0) __PYX_ERR(4, 279, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_from_link_data", 0, 1, 2, i); __PYX_ERR(4, 279, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 279, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_data = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_from_link_data", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 279, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._get_from_link_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_2_get_from_link_data(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_data, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_2_get_from_link_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_remove_finite_vertices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Triangulation *__pyx_t_2;
  struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_from_link_data", 0);

  /* "cython/core/triangulation.pyx":280
 * 
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         self.c_triangulation = get_triangulation_from_PythonKLP(data, remove_finite_vertices)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":281
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         self.c_triangulation = get_triangulation_from_PythonKLP(data, remove_finite_vertices)
 * 
*/
    free_triangulation(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 281, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":280
 * 
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         self.c_triangulation = get_triangulation_from_PythonKLP(data, remove_finite_vertices)
*/
  }

  /* "cython/core/triangulation.pyx":282
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
 *         self.c_triangulation = get_triangulation_from_PythonKLP(data, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):
*/
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.remove_finite_vertices = __pyx_v_remove_finite_vertices;
  __pyx_t_2 = __pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(__pyx_v_data, &__pyx_t_3); if (unlikely(__pyx_t_2 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 282, __pyx_L1_error)
  __pyx_v_self->c_triangulation = __pyx_t_2;

  /* "cython/core/triangulation.pyx":279
 *         free_LR_factorization(gluing)
 * 
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/

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

/* "cython/core/triangulation.pyx":284
 *         self.c_triangulation = get_triangulation_from_PythonKLP(data, remove_finite_vertices)
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         try:
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_get_from_file(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_name, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_file *__pyx_optional_args) {
  PyObject *__pyx_v_remove_finite_vertices = ((PyObject *)Py_True);
  PyObject *__pyx_v_locations = NULL;
  PyObject *__pyx_v_location = NULL;
  PyObject *__pyx_v_pathname = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_first_line = NULL;
  PyObject *__pyx_v_LM = NULL;
  PyObject *__pyx_v_klp = 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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  size_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Triangulation *__pyx_t_16;
  struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP __pyx_t_17;
  char *__pyx_t_18;
  PyObject *__pyx_t_19[4];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_from_file", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_remove_finite_vertices = __pyx_optional_args->remove_finite_vertices;
    }
  }

  /* "cython/core/triangulation.pyx":285
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):
 *         try:             # <<<<<<<<<<<<<<
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/triangulation.pyx":286
 *     cdef get_from_file(self, name, remove_finite_vertices=True):
 *         try:
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             locations = [os.curdir]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 286, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_curdir); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 286, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 286, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_environ); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 286, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SNAPPEA_MANIFOLD_DIRECTORY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 286, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 286, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5) != (0)) __PYX_ERR(4, 286, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(4, 286, __pyx_L3_error);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_v_locations = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":285
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):
 *         try:             # <<<<<<<<<<<<<<
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":287
 *         try:
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             locations = [os.curdir]
 *         for location in locations:
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("SnapPyHP.Triangulation.get_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(4, 287, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "cython/core/triangulation.pyx":288
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:
 *             locations = [os.curdir]             # <<<<<<<<<<<<<<
 *         for location in locations:
 *             pathname = os.path.join(location, name)
*/
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 288, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_curdir); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 288, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 288, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_9) != (0)) __PYX_ERR(4, 288, __pyx_L5_except_error);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_locations, ((PyObject*)__pyx_t_8));
      __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "cython/core/triangulation.pyx":285
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):
 *         try:             # <<<<<<<<<<<<<<
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "cython/core/triangulation.pyx":289
 *         except KeyError:
 *             locations = [os.curdir]
 *         for location in locations:             # <<<<<<<<<<<<<<
 *             pathname = os.path.join(location, name)
 *             if os.path.isfile(pathname):
*/
  __pyx_t_5 = __pyx_v_locations; __Pyx_INCREF(__pyx_t_5);
  __pyx_t_10 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 289, __pyx_L1_error)
      #endif
      if (__pyx_t_10 >= __pyx_temp) break;
    }
    __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_10);
    ++__pyx_t_10;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_location, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":290
 *             locations = [os.curdir]
 *         for location in locations:
 *             pathname = os.path.join(location, name)             # <<<<<<<<<<<<<<
 *             if os.path.isfile(pathname):
 *                 file = open(pathname, 'r')
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_location, __pyx_v_name};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_pathname, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":291
 *         for location in locations:
 *             pathname = os.path.join(location, name)
 *             if os.path.isfile(pathname):             # <<<<<<<<<<<<<<
 *                 file = open(pathname, 'r')
 *                 first_line = file.readline()[:-1]
*/
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_pathname};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_isfile, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 291, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_12) {

      /* "cython/core/triangulation.pyx":292
 *             pathname = os.path.join(location, name)
 *             if os.path.isfile(pathname):
 *                 file = open(pathname, 'r')             # <<<<<<<<<<<<<<
 *                 first_line = file.readline()[:-1]
 *                 file.close()
*/
      __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_builtin_open);
      __pyx_t_9 = __pyx_builtin_open; 
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_pathname, __pyx_mstate_global->__pyx_n_u_r};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":293
 *             if os.path.isfile(pathname):
 *                 file = open(pathname, 'r')
 *                 first_line = file.readline()[:-1]             # <<<<<<<<<<<<<<
 *                 file.close()
 *                 if first_line.find('% Link Projection') > -1:
*/
      __pyx_t_9 = __pyx_v_file;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_readline, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 293, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[2], 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_first_line, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "cython/core/triangulation.pyx":294
 *                 file = open(pathname, 'r')
 *                 first_line = file.readline()[:-1]
 *                 file.close()             # <<<<<<<<<<<<<<
 *                 if first_line.find('% Link Projection') > -1:
 *                     LM = LinkManager()
*/
      __pyx_t_4 = __pyx_v_file;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/triangulation.pyx":295
 *                 first_line = file.readline()[:-1]
 *                 file.close()
 *                 if first_line.find('% Link Projection') > -1:             # <<<<<<<<<<<<<<
 *                     LM = LinkManager()
 *                     LM._from_string(open(pathname, 'r').read())
*/
      __pyx_t_4 = __pyx_v_first_line;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Link_Projection};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_mstate_global->__pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 295, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 295, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_12) {

        /* "cython/core/triangulation.pyx":296
 *                 file.close()
 *                 if first_line.find('% Link Projection') > -1:
 *                     LM = LinkManager()             # <<<<<<<<<<<<<<
 *                     LM._from_string(open(pathname, 'r').read())
 *                     klp = LM.SnapPea_KLPProjection()
*/
        __pyx_t_9 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_LinkManager); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 296, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_LM, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":297
 *                 if first_line.find('% Link Projection') > -1:
 *                     LM = LinkManager()
 *                     LM._from_string(open(pathname, 'r').read())             # <<<<<<<<<<<<<<
 *                     klp = LM.SnapPea_KLPProjection()
 *                     self._link_file_full_path = os.path.abspath(pathname)
*/
        __pyx_t_8 = __pyx_v_LM;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_14 = NULL;
        __Pyx_INCREF(__pyx_builtin_open);
        __pyx_t_15 = __pyx_builtin_open; 
        __pyx_t_11 = 1;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_pathname, __pyx_mstate_global->__pyx_n_u_r};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 297, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __pyx_t_6 = __pyx_t_13;
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 297, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_string, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 297, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":298
 *                     LM = LinkManager()
 *                     LM._from_string(open(pathname, 'r').read())
 *                     klp = LM.SnapPea_KLPProjection()             # <<<<<<<<<<<<<<
 *                     self._link_file_full_path = os.path.abspath(pathname)
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_code()))
*/
        __pyx_t_9 = __pyx_v_LM;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_SnapPea_KLPProjection, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 298, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_klp, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":299
 *                     LM._from_string(open(pathname, 'r').read())
 *                     klp = LM.SnapPea_KLPProjection()
 *                     self._link_file_full_path = os.path.abspath(pathname)             # <<<<<<<<<<<<<<
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_code()))
 *                     self._set_PDcode(LM.PD_code())
*/
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = __pyx_t_13;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_pathname};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_abspath, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 299, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_v_self->_link_file_full_path);
        __Pyx_DECREF(__pyx_v_self->_link_file_full_path);
        __pyx_v_self->_link_file_full_path = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":300
 *                     klp = LM.SnapPea_KLPProjection()
 *                     self._link_file_full_path = os.path.abspath(pathname)
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_code()))             # <<<<<<<<<<<<<<
 *                     self._set_PDcode(LM.PD_code())
 *                     self.set_c_triangulation(
*/
        __pyx_t_13 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_6 = __pyx_v_LM;
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_9};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_DTcode, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":301
 *                     self._link_file_full_path = os.path.abspath(pathname)
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_code()))
 *                     self._set_PDcode(LM.PD_code())             # <<<<<<<<<<<<<<
 *                     self.set_c_triangulation(
 *                         get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
*/
        __pyx_t_9 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_6 = __pyx_v_LM;
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_PD_code, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 301, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_13};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_PDcode, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 301, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":303
 *                     self._set_PDcode(LM.PD_code())
 *                     self.set_c_triangulation(
 *                         get_triangulation_from_PythonKLP(klp, remove_finite_vertices))             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.set_c_triangulation(read_triangulation(to_byte_str(pathname)))
*/
        __pyx_t_17.__pyx_n = 1;
        __pyx_t_17.remove_finite_vertices = __pyx_v_remove_finite_vertices;
        __pyx_t_16 = __pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(__pyx_v_klp, &__pyx_t_17); if (unlikely(__pyx_t_16 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 303, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":302
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_code()))
 *                     self._set_PDcode(LM.PD_code())
 *                     self.set_c_triangulation(             # <<<<<<<<<<<<<<
 *                         get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *                 else:
*/
        __pyx_t_4 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":295
 *                 first_line = file.readline()[:-1]
 *                 file.close()
 *                 if first_line.find('% Link Projection') > -1:             # <<<<<<<<<<<<<<
 *                     LM = LinkManager()
 *                     LM._from_string(open(pathname, 'r').read())
*/
        goto __pyx_L14;
      }

      /* "cython/core/triangulation.pyx":305
 *                         get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *                 else:
 *                     self.set_c_triangulation(read_triangulation(to_byte_str(pathname)))             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation == NULL:
*/
      /*else*/ {
        __pyx_t_13 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_9);
          assert(__pyx_t_13);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_pathname};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 305, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_t_18 = __Pyx_PyObject_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(4, 305, __pyx_L1_error)
        __pyx_t_9 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, read_triangulation(__pyx_t_18)); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_L14:;

      /* "cython/core/triangulation.pyx":291
 *         for location in locations:
 *             pathname = os.path.join(location, name)
 *             if os.path.isfile(pathname):             # <<<<<<<<<<<<<<
 *                 file = open(pathname, 'r')
 *                 first_line = file.readline()[:-1]
*/
    }

    /* "cython/core/triangulation.pyx":289
 *         except KeyError:
 *             locations = [os.curdir]
 *         for location in locations:             # <<<<<<<<<<<<<<
 *             pathname = os.path.join(location, name)
 *             if os.path.isfile(pathname):
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":307
 *                     self.set_c_triangulation(read_triangulation(to_byte_str(pathname)))
 * 
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('The manifold file %s was not found.\n%s'%
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
*/
  __pyx_t_12 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_12)) {

    /* "cython/core/triangulation.pyx":308
 * 
 *         if self.c_triangulation == NULL:
 *             raise IOError('The manifold file %s was not found.\n%s'%             # <<<<<<<<<<<<<<
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
 *         else:
*/
    __pyx_t_9 = NULL;
    __Pyx_INCREF(__pyx_builtin_IOError);
    __pyx_t_4 = __pyx_builtin_IOError; 

    /* "cython/core/triangulation.pyx":309
 *         if self.c_triangulation == NULL:
 *             raise IOError('The manifold file %s was not found.\n%s'%
 *                           (name, triangulation_help % 'Triangulation or Manifold'))             # <<<<<<<<<<<<<<
 *         else:
 *             if remove_finite_vertices:
*/
    __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_triangulation_help); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyNumber_Remainder(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Triangulation_or_Manifold); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_19[0] = __pyx_mstate_global->__pyx_kp_u_The_manifold_file;
    __pyx_t_19[1] = __pyx_t_13;
    __pyx_t_19[2] = __pyx_mstate_global->__pyx_kp_u_was_not_found;
    __pyx_t_19[3] = __pyx_t_6;

    /* "cython/core/triangulation.pyx":308
 * 
 *         if self.c_triangulation == NULL:
 *             raise IOError('The manifold file %s was not found.\n%s'%             # <<<<<<<<<<<<<<
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
 *         else:
*/
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_19, 4, 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(4, 308, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":307
 *                     self.set_c_triangulation(read_triangulation(to_byte_str(pathname)))
 * 
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('The manifold file %s was not found.\n%s'%
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
*/
  }

  /* "cython/core/triangulation.pyx":311
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
 *         else:
 *             if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *                 self._remove_finite_vertices()
 * 
*/
  /*else*/ {
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_remove_finite_vertices); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 311, __pyx_L1_error)
    if (__pyx_t_12) {

      /* "cython/core/triangulation.pyx":312
 *         else:
 *             if remove_finite_vertices:
 *                 self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 *     def _remove_finite_vertices(self):
*/
      __pyx_t_4 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove_finite_vertices_2, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/triangulation.pyx":311
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
 *         else:
 *             if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *                 self._remove_finite_vertices()
 * 
*/
    }
  }

  /* "cython/core/triangulation.pyx":284
 *         self.c_triangulation = get_triangulation_from_PythonKLP(data, remove_finite_vertices)
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         try:
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.get_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_locations);
  __Pyx_XDECREF(__pyx_v_location);
  __Pyx_XDECREF(__pyx_v_pathname);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_first_line);
  __Pyx_XDECREF(__pyx_v_LM);
  __Pyx_XDECREF(__pyx_v_klp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":314
 *                 self._remove_finite_vertices()
 * 
 *     def _remove_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Removing any finite vertices by simplification and drilling.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_5_remove_finite_vertices(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_8SnapPyHP_13Triangulation_4_remove_finite_vertices, "\n        Removing any finite vertices by simplification and drilling.\n\n        >>> isosig = 'kLLLLMQkccfigghjijjlnabnwnpsii'\n        >>> T = Triangulation(isosig, remove_finite_vertices=False)\n        >>> T.triangulation_isosig(decorated=False) == isosig\n        True\n        >>> T.num_cusps(),  T._num_fake_cusps()\n        (0, 1)\n        >>> T._remove_finite_vertices()\n        >>> T.num_cusps(),  T._num_fake_cusps()\n        (1, 0)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_5_remove_finite_vertices = {"_remove_finite_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_5_remove_finite_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_4_remove_finite_vertices};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_5_remove_finite_vertices(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_finite_vertices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_remove_finite_vertices", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_remove_finite_vertices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_4_remove_finite_vertices(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_4_remove_finite_vertices(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_remove_finite_vertices", 0);

  /* "cython/core/triangulation.pyx":328
 *         (1, 0)
 *         """
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             count_cusps(self.c_triangulation)
 *             if get_num_fake_cusps(self.c_triangulation) > 0:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":329
 *         """
 *         if self.c_triangulation != NULL:
 *             count_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 *             if get_num_fake_cusps(self.c_triangulation) > 0:
 *                 remove_finite_vertices(self.c_triangulation)
*/
    count_cusps(__pyx_v_self->c_triangulation);

    /* "cython/core/triangulation.pyx":330
 *         if self.c_triangulation != NULL:
 *             count_cusps(self.c_triangulation)
 *             if get_num_fake_cusps(self.c_triangulation) > 0:             # <<<<<<<<<<<<<<
 *                 remove_finite_vertices(self.c_triangulation)
 *                 count_cusps(self.c_triangulation)
*/
    __pyx_t_2 = get_num_fake_cusps(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 330, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 > 0);
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":331
 *             count_cusps(self.c_triangulation)
 *             if get_num_fake_cusps(self.c_triangulation) > 0:
 *                 remove_finite_vertices(self.c_triangulation)             # <<<<<<<<<<<<<<
 *                 count_cusps(self.c_triangulation)
 * 
*/
      remove_finite_vertices(__pyx_v_self->c_triangulation);

      /* "cython/core/triangulation.pyx":332
 *             if get_num_fake_cusps(self.c_triangulation) > 0:
 *                 remove_finite_vertices(self.c_triangulation)
 *                 count_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     def cover_info(self):
*/
      count_cusps(__pyx_v_self->c_triangulation);

      /* "cython/core/triangulation.pyx":330
 *         if self.c_triangulation != NULL:
 *             count_cusps(self.c_triangulation)
 *             if get_num_fake_cusps(self.c_triangulation) > 0:             # <<<<<<<<<<<<<<
 *                 remove_finite_vertices(self.c_triangulation)
 *                 count_cusps(self.c_triangulation)
*/
    }

    /* "cython/core/triangulation.pyx":328
 *         (1, 0)
 *         """
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             count_cusps(self.c_triangulation)
 *             if get_num_fake_cusps(self.c_triangulation) > 0:
*/
  }

  /* "cython/core/triangulation.pyx":314
 *                 self._remove_finite_vertices()
 * 
 *     def _remove_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Removing any finite vertices by simplification and drilling.
*/

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

/* "cython/core/triangulation.pyx":334
 *                 count_cusps(self.c_triangulation)
 * 
 *     def cover_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         If this is a manifold or triangulation which was constructed as
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_7cover_info(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_8SnapPyHP_13Triangulation_6cover_info, "\n        If this is a manifold or triangulation which was constructed as\n        a covering space, return a dictionary describing the cover.  Otherwise\n        return 0.  The dictionary keys are 'base', 'type' and 'degree'.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_7cover_info = {"cover_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_7cover_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_6cover_info};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_7cover_info(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("cover_info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("cover_info", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("cover_info", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_6cover_info(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_6cover_info(struct __pyx_obj_8SnapPyHP_Triangulation *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cover_info", 0);

  /* "cython/core/triangulation.pyx":340
 *         return 0.  The dictionary keys are 'base', 'type' and 'degree'.
 *         """
 *         if self._cover_info:             # <<<<<<<<<<<<<<
 *             return dict(self._cover_info)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_cover_info); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 340, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":341
 *         """
 *         if self._cover_info:
 *             return dict(self._cover_info)             # <<<<<<<<<<<<<<
 * 
 *     def plink(self):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_INCREF((PyObject *)(&PyDict_Type));
    __pyx_t_4 = ((PyObject *)(&PyDict_Type)); 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->_cover_info};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":340
 *         return 0.  The dictionary keys are 'base', 'type' and 'degree'.
 *         """
 *         if self._cover_info:             # <<<<<<<<<<<<<<
 *             return dict(self._cover_info)
 * 
*/
  }

  /* "cython/core/triangulation.pyx":334
 *                 count_cusps(self.c_triangulation)
 * 
 *     def cover_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         If this is a manifold or triangulation which was constructed as
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.cover_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":343
 *             return dict(self._cover_info)
 * 
 *     def plink(self):             # <<<<<<<<<<<<<<
 *         """
 *         Brings up a link editor window if the manifold is stored
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_9plink(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_8SnapPyHP_13Triangulation_8plink, "\n        Brings up a link editor window if the manifold is stored\n        as a link complement in your current session.\n\n        >>> M = Manifold('4_1') # stored as a triangulation with a link\n        >>> M.link()\n        <Link: 1 comp; 4 cross>\n        >>> N = Manifold('m004') # stored as a triangulation without a link\n        >>> N.link() #doctest: +ELLIPSIS\n        Traceback (most recent call last):\n        ...\n        ValueError: No associated link known.\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_9plink = {"plink", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_9plink, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_8plink};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_9plink(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("plink (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("plink", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("plink", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_8plink(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_8plink(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_v_L = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_new_plink __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plink", 0);

  /* "cython/core/triangulation.pyx":358
 * 
 *         """
 *         if self.LE is not None:             # <<<<<<<<<<<<<<
 *             self.LE.reopen()
 *         elif self._link_file_full_path is not None:
*/
  __pyx_t_1 = (__pyx_v_self->LE != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":359
 *         """
 *         if self.LE is not None:
 *             self.LE.reopen()             # <<<<<<<<<<<<<<
 *         elif self._link_file_full_path is not None:
 *             self.get_from_new_plink(self._link_file_full_path)
*/
    __pyx_t_3 = __pyx_v_self->LE;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reopen, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":358
 * 
 *         """
 *         if self.LE is not None:             # <<<<<<<<<<<<<<
 *             self.LE.reopen()
 *         elif self._link_file_full_path is not None:
*/
    goto __pyx_L3;
  }

  /* "cython/core/triangulation.pyx":360
 *         if self.LE is not None:
 *             self.LE.reopen()
 *         elif self._link_file_full_path is not None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink(self._link_file_full_path)
 *         elif self.DT_code() is not None:
*/
  __pyx_t_1 = (__pyx_v_self->_link_file_full_path != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":361
 *             self.LE.reopen()
 *         elif self._link_file_full_path is not None:
 *             self.get_from_new_plink(self._link_file_full_path)             # <<<<<<<<<<<<<<
 *         elif self.DT_code() is not None:
 *             self.get_from_new_plink()
*/
    __pyx_t_2 = __pyx_v_self->_link_file_full_path;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.file_name = __pyx_t_2;
    __pyx_t_3 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_new_plink(__pyx_v_self, &__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":360
 *         if self.LE is not None:
 *             self.LE.reopen()
 *         elif self._link_file_full_path is not None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink(self._link_file_full_path)
 *         elif self.DT_code() is not None:
*/
    goto __pyx_L3;
  }

  /* "cython/core/triangulation.pyx":362
 *         elif self._link_file_full_path is not None:
 *             self.get_from_new_plink(self._link_file_full_path)
 *         elif self.DT_code() is not None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink()
 *             L = spherogram.DTcodec(*self.DT_code(flips=True)).link()
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":363
 *             self.get_from_new_plink(self._link_file_full_path)
 *         elif self.DT_code() is not None:
 *             self.get_from_new_plink()             # <<<<<<<<<<<<<<
 *             L = spherogram.DTcodec(*self.DT_code(flips=True)).link()
 *             L.view(self.LE)
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_new_plink(__pyx_v_self, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":364
 *         elif self.DT_code() is not None:
 *             self.get_from_new_plink()
 *             L = spherogram.DTcodec(*self.DT_code(flips=True)).link()             # <<<<<<<<<<<<<<
 *             L.view(self.LE)
 *         else:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, NULL};
      __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_flips, Py_True, __pyx_t_9, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 364, __pyx_L1_error)
      __pyx_t_6 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_2 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_link, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_L = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":365
 *             self.get_from_new_plink()
 *             L = spherogram.DTcodec(*self.DT_code(flips=True)).link()
 *             L.view(self.LE)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('No associated link known.')
*/
    __pyx_t_6 = __pyx_v_L;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_self->LE};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_view, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":362
 *         elif self._link_file_full_path is not None:
 *             self.get_from_new_plink(self._link_file_full_path)
 *         elif self.DT_code() is not None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink()
 *             L = spherogram.DTcodec(*self.DT_code(flips=True)).link()
*/
    goto __pyx_L3;
  }

  /* "cython/core/triangulation.pyx":367
 *             L.view(self.LE)
 *         else:
 *             raise ValueError('No associated link known.')             # <<<<<<<<<<<<<<
 * 
 *     def link(self):
*/
  /*else*/ {
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_2 = __pyx_builtin_ValueError; 
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_No_associated_link_known};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 367, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 367, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/triangulation.pyx":343
 *             return dict(self._cover_info)
 * 
 *     def plink(self):             # <<<<<<<<<<<<<<
 *         """
 *         Brings up a link editor window if the manifold is stored
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.plink", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_L);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":369
 *             raise ValueError('No associated link known.')
 * 
 *     def link(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the manifold is stored as a link complement in your
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_11link(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_8SnapPyHP_13Triangulation_10link, "\n        If the manifold is stored as a link complement in your\n        current session then it returns the number of components\n        and crossing of the link. To view and interact with the\n        link see :meth:`spherogram.Link.view`\n        and :meth:`plink <snappy.Triangulation.plink>`.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_11link = {"link", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_11link, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_10link};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_11link(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("link (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("link", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("link", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_10link(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_10link(struct __pyx_obj_8SnapPyHP_Triangulation *__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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("link", 0);

  /* "cython/core/triangulation.pyx":377
 *         and :meth:`plink <snappy.Triangulation.plink>`.
 *         """
 *         if self._PDcode is not None:             # <<<<<<<<<<<<<<
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:
*/
  __pyx_t_1 = (__pyx_v_self->_PDcode != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":378
 *         """
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)             # <<<<<<<<<<<<<<
 *         elif self.DT_code() is not None:
 *             return spherogram.DTcodec(*self.DT_code(flips=True)).link()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Link); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->_PDcode};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":377
 *         and :meth:`plink <snappy.Triangulation.plink>`.
 *         """
 *         if self._PDcode is not None:             # <<<<<<<<<<<<<<
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:
*/
  }

  /* "cython/core/triangulation.pyx":379
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:             # <<<<<<<<<<<<<<
 *             return spherogram.DTcodec(*self.DT_code(flips=True)).link()
 *         else:
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_1 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":380
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:
 *             return spherogram.DTcodec(*self.DT_code(flips=True)).link()             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('No associated link known.')
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, NULL};
      __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_flips, Py_True, __pyx_t_8, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 380, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_link, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":379
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:             # <<<<<<<<<<<<<<
 *             return spherogram.DTcodec(*self.DT_code(flips=True)).link()
 *         else:
*/
  }

  /* "cython/core/triangulation.pyx":382
 *             return spherogram.DTcodec(*self.DT_code(flips=True)).link()
 *         else:
 *             raise ValueError('No associated link known.')             # <<<<<<<<<<<<<<
 * 
 *     cdef set_c_triangulation(self, c_Triangulation* c_triangulation):
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_No_associated_link_known};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 382, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":369
 *             raise ValueError('No associated link known.')
 * 
 *     def link(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the manifold is stored as a link complement in your
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.link", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":384
 *             raise ValueError('No associated link known.')
 * 
 *     cdef set_c_triangulation(self, c_Triangulation* c_triangulation):             # <<<<<<<<<<<<<<
 *         self.c_triangulation = c_triangulation
 * 
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_set_c_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, Triangulation *__pyx_v_c_triangulation) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_c_triangulation", 0);

  /* "cython/core/triangulation.pyx":385
 * 
 *     cdef set_c_triangulation(self, c_Triangulation* c_triangulation):
 *         self.c_triangulation = c_triangulation             # <<<<<<<<<<<<<<
 * 
 *     def num_cusps(self, cusp_type='all') -> int:
*/
  __pyx_v_self->c_triangulation = __pyx_v_c_triangulation;

  /* "cython/core/triangulation.pyx":384
 *             raise ValueError('No associated link known.')
 * 
 *     cdef set_c_triangulation(self, c_Triangulation* c_triangulation):             # <<<<<<<<<<<<<<
 *         self.c_triangulation = c_triangulation
 * 
*/

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

/* "cython/core/triangulation.pyx":387
 *         self.c_triangulation = c_triangulation
 * 
 *     def num_cusps(self, cusp_type='all') -> int:             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of cusps.  By giving the optional argument
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_13num_cusps(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_8SnapPyHP_13Triangulation_12num_cusps, "\n        Return the total number of cusps.  By giving the optional argument\n        'orientable' or 'nonorientable' it will only count cusps of that type.\n\n        >>> M = Triangulation('m125')\n        >>> M.num_cusps()\n        2\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_13num_cusps = {"num_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_13num_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_12num_cusps};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_13num_cusps(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_cusp_type = 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("num_cusps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cusp_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 387, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "num_cusps", 0) < 0) __PYX_ERR(4, 387, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    }
    __pyx_v_cusp_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("num_cusps", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 387, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.num_cusps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_12num_cusps(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_cusp_type);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_12num_cusps(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_cusp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_cusps", 0);

  /* "cython/core/triangulation.pyx":396
 *         2
 *         """
 *         if cusp_type == 'all':             # <<<<<<<<<<<<<<
 *             return get_num_cusps(self.c_triangulation)
 *         elif cusp_type == 'orientable':
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_cusp_type, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 396, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":397
 *         """
 *         if cusp_type == 'all':
 *             return get_num_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         elif cusp_type == 'orientable':
 *             return get_num_or_cusps(self.c_triangulation)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = get_num_cusps(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 397, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyLong_CheckExact(__pyx_t_3)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(4, 397, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":396
 *         2
 *         """
 *         if cusp_type == 'all':             # <<<<<<<<<<<<<<
 *             return get_num_cusps(self.c_triangulation)
 *         elif cusp_type == 'orientable':
*/
  }

  /* "cython/core/triangulation.pyx":398
 *         if cusp_type == 'all':
 *             return get_num_cusps(self.c_triangulation)
 *         elif cusp_type == 'orientable':             # <<<<<<<<<<<<<<
 *             return get_num_or_cusps(self.c_triangulation)
 *         elif cusp_type == 'nonorientable':
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_cusp_type, __pyx_mstate_global->__pyx_n_u_orientable, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 398, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":399
 *             return get_num_cusps(self.c_triangulation)
 *         elif cusp_type == 'orientable':
 *             return get_num_or_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         elif cusp_type == 'nonorientable':
 *             return get_num_nonor_cusps(self.c_triangulation)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = get_num_or_cusps(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 399, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyLong_CheckExact(__pyx_t_3)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(4, 399, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":398
 *         if cusp_type == 'all':
 *             return get_num_cusps(self.c_triangulation)
 *         elif cusp_type == 'orientable':             # <<<<<<<<<<<<<<
 *             return get_num_or_cusps(self.c_triangulation)
 *         elif cusp_type == 'nonorientable':
*/
  }

  /* "cython/core/triangulation.pyx":400
 *         elif cusp_type == 'orientable':
 *             return get_num_or_cusps(self.c_triangulation)
 *         elif cusp_type == 'nonorientable':             # <<<<<<<<<<<<<<
 *             return get_num_nonor_cusps(self.c_triangulation)
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_cusp_type, __pyx_mstate_global->__pyx_n_u_nonorientable, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 400, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":401
 *             return get_num_or_cusps(self.c_triangulation)
 *         elif cusp_type == 'nonorientable':
 *             return get_num_nonor_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Acceptable cusp types are "
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = get_num_nonor_cusps(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 401, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyLong_CheckExact(__pyx_t_3)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(4, 401, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":400
 *         elif cusp_type == 'orientable':
 *             return get_num_or_cusps(self.c_triangulation)
 *         elif cusp_type == 'nonorientable':             # <<<<<<<<<<<<<<
 *             return get_num_nonor_cusps(self.c_triangulation)
 *         else:
*/
  }

  /* "cython/core/triangulation.pyx":403
 *             return get_num_nonor_cusps(self.c_triangulation)
 *         else:
 *             raise ValueError("Acceptable cusp types are "             # <<<<<<<<<<<<<<
 *                              "['all', 'orientable', 'nonorientable'].")
 * 
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Acceptable_cusp_types_are_all_or};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 403, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":387
 *         self.c_triangulation = c_triangulation
 * 
 *     def num_cusps(self, cusp_type='all') -> int:             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of cusps.  By giving the optional argument
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.num_cusps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":406
 *                              "['all', 'orientable', 'nonorientable'].")
 * 
 *     def _num_fake_cusps(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of "fake" cusps, which is typically the number
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_15_num_fake_cusps(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_8SnapPyHP_13Triangulation_14_num_fake_cusps, "\n        Returns the number of \"fake\" cusps, which is typically the number\n        of finite vertices.\n\n        >>> M = Triangulation('m004(1,2)')\n        >>> F = M.filled_triangulation()\n        >>> F.num_cusps(),  F._num_fake_cusps()\n        (0, 1)\n        >>> S = Triangulation('bkaagb', remove_finite_vertices=False)\n        >>> S.num_cusps(),  S._num_fake_cusps()\n        (0, 2)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_15_num_fake_cusps = {"_num_fake_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_15_num_fake_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_14_num_fake_cusps};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_15_num_fake_cusps(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("_num_fake_cusps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_num_fake_cusps", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_num_fake_cusps", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_14_num_fake_cusps(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_14_num_fake_cusps(struct __pyx_obj_8SnapPyHP_Triangulation *__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("_num_fake_cusps", 0);

  /* "cython/core/triangulation.pyx":419
 *         (0, 2)
 *         """
 *         count_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         return get_num_fake_cusps(self.c_triangulation)
 * 
*/
  count_cusps(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":420
 *         """
 *         count_cusps(self.c_triangulation)
 *         return get_num_fake_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     def orientation_cover(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = get_num_fake_cusps(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 420, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":406
 *                              "['all', 'orientable', 'nonorientable'].")
 * 
 *     def _num_fake_cusps(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of "fake" cusps, which is typically the number
*/

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

/* "cython/core/triangulation.pyx":422
 *         return get_num_fake_cusps(self.c_triangulation)
 * 
 *     def orientation_cover(self):             # <<<<<<<<<<<<<<
 *         """
 *         For a non-orientable Triangulation, returns the 2-fold cover which
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_17orientation_cover(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_8SnapPyHP_13Triangulation_16orientation_cover, "\n        For a non-orientable Triangulation, returns the 2-fold cover which\n        is orientable.\n\n        >>> X = Triangulation('x123')\n        >>> Y = X.orientation_cover()\n        >>> (X.is_orientable(), Y.is_orientable())\n        (False, True)\n        >>> Y\n        x123~(0,0)(0,0)\n        >>> Y.cover_info()['type']\n        'cyclic'\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_17orientation_cover = {"orientation_cover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_17orientation_cover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_16orientation_cover};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_17orientation_cover(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("orientation_cover (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("orientation_cover", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("orientation_cover", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_16orientation_cover(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_16orientation_cover(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  Triangulation *__pyx_v_cover_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_new_tri = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Triangulation *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("orientation_cover", 0);

  /* "cython/core/triangulation.pyx":436
 *         'cyclic'
 *         """
 *         if self.is_orientable():             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is already orientable.')
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(4, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/triangulation.pyx":437
 *         """
 *         if self.is_orientable():
 *             raise ValueError('The Triangulation is already orientable.')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_Triangulation* cover_c_triangulation = NULL
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_already_ori};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 437, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":436
 *         'cyclic'
 *         """
 *         if self.is_orientable():             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is already orientable.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":439
 *             raise ValueError('The Triangulation is already orientable.')
 * 
 *         cdef c_Triangulation* cover_c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         cdef Triangulation new_tri
 * 
*/
  __pyx_v_cover_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":442
 *         cdef Triangulation new_tri
 * 
 *         cover_c_triangulation = double_cover(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         new_tri = self.__class__('empty')
 *         new_tri.set_c_triangulation(cover_c_triangulation)
*/
  __pyx_t_6 = double_cover(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 442, __pyx_L1_error)
  __pyx_v_cover_c_triangulation = __pyx_t_6;

  /* "cython/core/triangulation.pyx":443
 * 
 *         cover_c_triangulation = double_cover(self.c_triangulation)
 *         new_tri = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         new_tri.set_c_triangulation(cover_c_triangulation)
 *         new_tri.set_name(self.name() + '~')
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(4, 443, __pyx_L1_error)
  __pyx_v_new_tri = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":444
 *         cover_c_triangulation = double_cover(self.c_triangulation)
 *         new_tri = self.__class__('empty')
 *         new_tri.set_c_triangulation(cover_c_triangulation)             # <<<<<<<<<<<<<<
 *         new_tri.set_name(self.name() + '~')
 *         new_tri._cover_info = {'base'   : self.name(),
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_new_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_new_tri, __pyx_v_cover_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":445
 *         new_tri = self.__class__('empty')
 *         new_tri.set_c_triangulation(cover_c_triangulation)
 *         new_tri.set_name(self.name() + '~')             # <<<<<<<<<<<<<<
 *         new_tri._cover_info = {'base'   : self.name(),
 *                                'type'   : 'cyclic',
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_new_tri);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__24); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":446
 *         new_tri.set_c_triangulation(cover_c_triangulation)
 *         new_tri.set_name(self.name() + '~')
 *         new_tri._cover_info = {'base'   : self.name(),             # <<<<<<<<<<<<<<
 *                                'type'   : 'cyclic',
 *                                'degree' : 2}
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_base, __pyx_t_7) < 0) __PYX_ERR(4, 446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_type, __pyx_mstate_global->__pyx_n_u_cyclic) < 0) __PYX_ERR(4, 446, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_degree, __pyx_mstate_global->__pyx_int_2) < 0) __PYX_ERR(4, 446, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_new_tri->_cover_info);
  __Pyx_DECREF(__pyx_v_new_tri->_cover_info);
  __pyx_v_new_tri->_cover_info = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":449
 *                                'type'   : 'cyclic',
 *                                'degree' : 2}
 *         return new_tri             # <<<<<<<<<<<<<<
 * 
 *     def is_orientable(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_new_tri);
  __pyx_r = ((PyObject *)__pyx_v_new_tri);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":422
 *         return get_num_fake_cusps(self.c_triangulation)
 * 
 *     def orientation_cover(self):             # <<<<<<<<<<<<<<
 *         """
 *         For a non-orientable Triangulation, returns the 2-fold cover which
*/

  /* 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_AddTraceback("SnapPyHP.Triangulation.orientation_cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_new_tri);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":451
 *         return new_tri
 * 
 *     def is_orientable(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the underlying 3-manifold is orientable.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_19is_orientable(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_8SnapPyHP_13Triangulation_18is_orientable, "\n        Return whether the underlying 3-manifold is orientable.\n\n        >>> M = Triangulation('x124')\n        >>> M.is_orientable()\n        False\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_19is_orientable = {"is_orientable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_19is_orientable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_18is_orientable};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_19is_orientable(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("is_orientable (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_orientable", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_orientable", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_18is_orientable(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_18is_orientable(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_v_orientability = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Orientability __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_orientable", 0);

  /* "cython/core/triangulation.pyx":459
 *         False
 *         """
 *         orientability = Orientability[get_orientability(self.c_triangulation)]             # <<<<<<<<<<<<<<
 *         if orientability == 'orientable':
 *             return True
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Orientability); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = get_orientability(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 459, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyLong_From_Orientability(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_orientability = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":460
 *         """
 *         orientability = Orientability[get_orientability(self.c_triangulation)]
 *         if orientability == 'orientable':             # <<<<<<<<<<<<<<
 *             return True
 *         if orientability == 'nonorientable':
*/
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_orientability, __pyx_mstate_global->__pyx_n_u_orientable, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 460, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "cython/core/triangulation.pyx":461
 *         orientability = Orientability[get_orientability(self.c_triangulation)]
 *         if orientability == 'orientable':
 *             return True             # <<<<<<<<<<<<<<
 *         if orientability == 'nonorientable':
 *             return False
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":460
 *         """
 *         orientability = Orientability[get_orientability(self.c_triangulation)]
 *         if orientability == 'orientable':             # <<<<<<<<<<<<<<
 *             return True
 *         if orientability == 'nonorientable':
*/
  }

  /* "cython/core/triangulation.pyx":462
 *         if orientability == 'orientable':
 *             return True
 *         if orientability == 'nonorientable':             # <<<<<<<<<<<<<<
 *             return False
 *         return None
*/
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_orientability, __pyx_mstate_global->__pyx_n_u_nonorientable, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 462, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "cython/core/triangulation.pyx":463
 *             return True
 *         if orientability == 'nonorientable':
 *             return False             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":462
 *         if orientability == 'orientable':
 *             return True
 *         if orientability == 'nonorientable':             # <<<<<<<<<<<<<<
 *             return False
 *         return None
*/
  }

  /* "cython/core/triangulation.pyx":464
 *         if orientability == 'nonorientable':
 *             return False
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":451
 *         return new_tri
 * 
 *     def is_orientable(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the underlying 3-manifold is orientable.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.is_orientable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_orientability);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":466
 *         return None
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the triangulation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_21copy(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_8SnapPyHP_13Triangulation_20copy, "\n        Returns a copy of the triangulation.\n\n        >>> M = Triangulation('m125')\n        >>> N = M.copy()\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_21copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_21copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_20copy};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_21copy(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("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_20copy(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_20copy(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  Triangulation *__pyx_v_copy_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_new_tri = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "cython/core/triangulation.pyx":473
 *         >>> N = M.copy()
 *         """
 *         cdef c_Triangulation* copy_c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         cdef Triangulation new_tri
 * 
*/
  __pyx_v_copy_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":476
 *         cdef Triangulation new_tri
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return self.__class__('empty')
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":477
 * 
 *         if self.c_triangulation is NULL:
 *             return self.__class__('empty')             # <<<<<<<<<<<<<<
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)
 *         new_tri = self.__class__('empty')
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":476
 *         cdef Triangulation new_tri
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return self.__class__('empty')
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)
*/
  }

  /* "cython/core/triangulation.pyx":478
 *         if self.c_triangulation is NULL:
 *             return self.__class__('empty')
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)             # <<<<<<<<<<<<<<
 *         new_tri = self.__class__('empty')
 *         new_tri.set_c_triangulation(copy_c_triangulation)
*/
  copy_triangulation(__pyx_v_self->c_triangulation, (&__pyx_v_copy_c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 478, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":479
 *             return self.__class__('empty')
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)
 *         new_tri = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         new_tri.set_c_triangulation(copy_c_triangulation)
 *         return new_tri
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(4, 479, __pyx_L1_error)
  __pyx_v_new_tri = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":480
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)
 *         new_tri = self.__class__('empty')
 *         new_tri.set_c_triangulation(copy_c_triangulation)             # <<<<<<<<<<<<<<
 *         return new_tri
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_new_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_new_tri, __pyx_v_copy_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":481
 *         new_tri = self.__class__('empty')
 *         new_tri.set_c_triangulation(copy_c_triangulation)
 *         return new_tri             # <<<<<<<<<<<<<<
 * 
 *     def randomize(self, blowup_multiple=4, passes_at_fours=6):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_new_tri);
  __pyx_r = ((PyObject *)__pyx_v_new_tri);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":466
 *         return None
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the triangulation.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_new_tri);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":483
 *         return new_tri
 * 
 *     def randomize(self, blowup_multiple=4, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Perform random Pachner moves on the underlying triangulation,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_23randomize(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_8SnapPyHP_13Triangulation_22randomize, "\n        Perform random Pachner moves on the underlying triangulation,\n        including some initial 3 -> 2 moves that increase the number of\n        tetrahedra by blowup_multiple.\n\n        >>> M = Triangulation('Braid:[1,2,-3,-3,1,2]')\n        >>> M.randomize()\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_23randomize = {"randomize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_23randomize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_22randomize};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_23randomize(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_blowup_multiple = 0;
  PyObject *__pyx_v_passes_at_fours = 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("randomize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_blowup_multiple,&__pyx_mstate_global->__pyx_n_u_passes_at_fours,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 483, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "randomize", 0) < 0) __PYX_ERR(4, 483, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_4));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_4));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
    }
    __pyx_v_blowup_multiple = values[0];
    __pyx_v_passes_at_fours = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("randomize", 0, 0, 2, __pyx_nargs); __PYX_ERR(4, 483, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.randomize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_22randomize(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_blowup_multiple, __pyx_v_passes_at_fours);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_22randomize(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_blowup_multiple, PyObject *__pyx_v_passes_at_fours) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randomize", 0);

  /* "cython/core/triangulation.pyx":492
 *         >>> M.randomize()
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         randomize_triangulation_with_options(self.c_triangulation, passes_at_fours, blowup_multiple)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":493
 *         """
 *         if self.c_triangulation is NULL:
 *             return             # <<<<<<<<<<<<<<
 *         randomize_triangulation_with_options(self.c_triangulation, passes_at_fours, blowup_multiple)
 *         self._cache.clear(message='randomize')
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":492
 *         >>> M.randomize()
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         randomize_triangulation_with_options(self.c_triangulation, passes_at_fours, blowup_multiple)
*/
  }

  /* "cython/core/triangulation.pyx":494
 *         if self.c_triangulation is NULL:
 *             return
 *         randomize_triangulation_with_options(self.c_triangulation, passes_at_fours, blowup_multiple)             # <<<<<<<<<<<<<<
 *         self._cache.clear(message='randomize')
 * 
*/
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_passes_at_fours); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 494, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_blowup_multiple); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 494, __pyx_L1_error)
  randomize_triangulation_with_options(__pyx_v_self->c_triangulation, __pyx_t_2, __pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 494, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":495
 *             return
 *         randomize_triangulation_with_options(self.c_triangulation, passes_at_fours, blowup_multiple)
 *         self._cache.clear(message='randomize')             # <<<<<<<<<<<<<<
 * 
 *     def simplify(self, passes_at_fours=6):
*/
  __pyx_t_5 = __pyx_v_self->_cache;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_n_u_randomize, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 495, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __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(4, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":483
 *         return new_tri
 * 
 *     def randomize(self, blowup_multiple=4, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Perform random Pachner moves on the underlying triangulation,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.randomize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":497
 *         self._cache.clear(message='randomize')
 * 
 *     def simplify(self, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Try to simplify the triangulation by doing Pachner moves.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_25simplify(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_8SnapPyHP_13Triangulation_24simplify, "\n        Try to simplify the triangulation by doing Pachner moves.\n\n        >>> M = Triangulation('12n123')\n        >>> M.simplify()\n\n        It does four kinds of moves that reduce the number of\n        tetrahedra:\n\n        * 3 -> 2 and 2 -> 0 Pacher moves, which eliminate one or two\n          tetrahedra respectively.\n\n        * On suitable valence-1 edges, does a 2 -> 3 and then 2 -> 0 move,\n          which removes a tetrahedron and creates a new valence-1 edge.\n\n        * When a 2-simplex has two edges of valence-4 giving rise to the\n          suspension of a pentagon, replace these 6 tetrahedra with a\n          single edge of valence 5.\n\n        It also does random 4 -> 4 moves in hopes of setting up a\n        simplfication.  The argument passes_at_fours is the number of\n        times it goes through the valence-4 edges without progress\n        before giving up.\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_25simplify = {"simplify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_25simplify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_24simplify};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_25simplify(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_passes_at_fours = 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("simplify (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_passes_at_fours,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 497, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 497, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "simplify", 0) < 0) __PYX_ERR(4, 497, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 497, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
    }
    __pyx_v_passes_at_fours = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simplify", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 497, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.simplify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_24simplify(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_passes_at_fours);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_24simplify(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_passes_at_fours) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simplify", 0);

  /* "cython/core/triangulation.pyx":523
 * 
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         basic_simplification_with_options(self.c_triangulation, passes_at_fours)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":524
 *         """
 *         if self.c_triangulation is NULL:
 *             return             # <<<<<<<<<<<<<<
 *         basic_simplification_with_options(self.c_triangulation, passes_at_fours)
 *         self._cache.clear(message='simplify')
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":523
 * 
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         basic_simplification_with_options(self.c_triangulation, passes_at_fours)
*/
  }

  /* "cython/core/triangulation.pyx":525
 *         if self.c_triangulation is NULL:
 *             return
 *         basic_simplification_with_options(self.c_triangulation, passes_at_fours)             # <<<<<<<<<<<<<<
 *         self._cache.clear(message='simplify')
 * 
*/
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_passes_at_fours); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 525, __pyx_L1_error)
  basic_simplification_with_options(__pyx_v_self->c_triangulation, __pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 525, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":526
 *             return
 *         basic_simplification_with_options(self.c_triangulation, passes_at_fours)
 *         self._cache.clear(message='simplify')             # <<<<<<<<<<<<<<
 * 
 *     def _two_to_three(self, tet_num, face_index):
*/
  __pyx_t_4 = __pyx_v_self->_cache;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_n_u_simplify, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 526, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":497
 *         self._cache.clear(message='randomize')
 * 
 *     def simplify(self, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Try to simplify the triangulation by doing Pachner moves.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.simplify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":528
 *         self._cache.clear(message='simplify')
 * 
 *     def _two_to_three(self, tet_num, face_index):             # <<<<<<<<<<<<<<
 *         """
 *         Performs a 2-3 move which removes a given face.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_27_two_to_three(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_8SnapPyHP_13Triangulation_26_two_to_three, "\n        Performs a 2-3 move which removes a given face.\n\n        The face is specified by giving the index of one of the\n        tetrahedra which contains the face, as well as the index of that\n        face within the tetrahedron (i.e. the index of the vertex\n        opposite the face).\n\n        If the face is not adjacent to two distinct tetrahedra, this\n        function does nothing and returns a non-zero value.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_27_two_to_three = {"_two_to_three", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_27_two_to_three, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_26_two_to_three};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_27_two_to_three(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_tet_num = 0;
  PyObject *__pyx_v_face_index = 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("_two_to_three (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tet_num,&__pyx_mstate_global->__pyx_n_u_face_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 528, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_two_to_three", 0) < 0) __PYX_ERR(4, 528, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_two_to_three", 1, 2, 2, i); __PYX_ERR(4, 528, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 528, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 528, __pyx_L3_error)
    }
    __pyx_v_tet_num = values[0];
    __pyx_v_face_index = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_two_to_three", 1, 2, 2, __pyx_nargs); __PYX_ERR(4, 528, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._two_to_three", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_26_two_to_three(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_tet_num, __pyx_v_face_index);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_26_two_to_three(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_tet_num, PyObject *__pyx_v_face_index) {
  FuncResult __pyx_v_result;
  Tetrahedron *__pyx_v_tet;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_f = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Tetrahedron *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_two_to_three", 0);

  /* "cython/core/triangulation.pyx":544
 *         cdef c_Tetrahedron* tet
 * 
 *         n = valid_index(             # <<<<<<<<<<<<<<
 *             tet_num, self.num_tetrahedra(),
 *             "The specified tetrahedron (%s) does not exist.")
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/triangulation.pyx":545
 * 
 *         n = valid_index(
 *             tet_num, self.num_tetrahedra(),             # <<<<<<<<<<<<<<
 *             "The specified tetrahedron (%s) does not exist.")
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_tet_num, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_specified_tetrahedron_s_does};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":548
 *             "The specified tetrahedron (%s) does not exist.")
 * 
 *         f = valid_index(             # <<<<<<<<<<<<<<
 *             face_index, 4,
 *             "The specified face index (%s) is invalid.")
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/triangulation.pyx":549
 * 
 *         f = valid_index(
 *             face_index, 4,             # <<<<<<<<<<<<<<
 *             "The specified face index (%s) is invalid.")
 * 
*/
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_face_index, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_kp_u_The_specified_face_index_s_is_in};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":552
 *             "The specified face index (%s) is invalid.")
 * 
 *         tet = self.c_triangulation.tet_list_begin.next             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             tet = tet.next
*/
  __pyx_t_7 = __pyx_v_self->c_triangulation->tet_list_begin.next;
  __pyx_v_tet = __pyx_t_7;

  /* "cython/core/triangulation.pyx":553
 * 
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             tet = tet.next
 *         result = two_to_three(tet, f, &self.c_triangulation.num_tetrahedra)
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_3 = __pyx_builtin_range; 
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_n};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 553, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 553, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_8);
        ++__pyx_t_8;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 553, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8);
        #endif
        ++__pyx_t_8;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 553, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 553, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":554
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(n):
 *             tet = tet.next             # <<<<<<<<<<<<<<
 *         result = two_to_three(tet, f, &self.c_triangulation.num_tetrahedra)
 * 
*/
    __pyx_t_7 = __pyx_v_tet->next;
    __pyx_v_tet = __pyx_t_7;

    /* "cython/core/triangulation.pyx":553
 * 
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             tet = tet.next
 *         result = two_to_three(tet, f, &self.c_triangulation.num_tetrahedra)
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":555
 *         for i in range(n):
 *             tet = tet.next
 *         result = two_to_three(tet, f, &self.c_triangulation.num_tetrahedra)             # <<<<<<<<<<<<<<
 * 
 *         if result == func_OK:
*/
  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_v_f); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 555, __pyx_L1_error)
  __pyx_v_result = two_to_three(__pyx_v_tet, __pyx_t_10, (&__pyx_v_self->c_triangulation->num_tetrahedra));

  /* "cython/core/triangulation.pyx":557
 *         result = two_to_three(tet, f, &self.c_triangulation.num_tetrahedra)
 * 
 *         if result == func_OK:             # <<<<<<<<<<<<<<
 *             self._cache.clear(message = '2-3 move')
 *             self._polish_hyperbolic_structures()
*/
  __pyx_t_11 = (__pyx_v_result == func_OK);
  if (__pyx_t_11) {

    /* "cython/core/triangulation.pyx":558
 * 
 *         if result == func_OK:
 *             self._cache.clear(message = '2-3 move')             # <<<<<<<<<<<<<<
 *             self._polish_hyperbolic_structures()
 * 
*/
    __pyx_t_1 = __pyx_v_self->_cache;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, NULL};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_2_3_move, __pyx_t_4, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 558, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":559
 *         if result == func_OK:
 *             self._cache.clear(message = '2-3 move')
 *             self._polish_hyperbolic_structures()             # <<<<<<<<<<<<<<
 * 
 *         return result
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_polish_hyperbolic_structures, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":557
 *         result = two_to_three(tet, f, &self.c_triangulation.num_tetrahedra)
 * 
 *         if result == func_OK:             # <<<<<<<<<<<<<<
 *             self._cache.clear(message = '2-3 move')
 *             self._polish_hyperbolic_structures()
*/
  }

  /* "cython/core/triangulation.pyx":561
 *             self._polish_hyperbolic_structures()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _three_to_two(self, tet_num, edge_index):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyLong_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":528
 *         self._cache.clear(message='simplify')
 * 
 *     def _two_to_three(self, tet_num, face_index):             # <<<<<<<<<<<<<<
 *         """
 *         Performs a 2-3 move which removes a given face.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._two_to_three", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":563
 *         return result
 * 
 *     def _three_to_two(self, tet_num, edge_index):             # <<<<<<<<<<<<<<
 *         r"""
 *         Perform a 3-2 move which removes a given 3-valent edge.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_29_three_to_two(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_8SnapPyHP_13Triangulation_28_three_to_two, "\n        Perform a 3-2 move which removes a given 3-valent edge.\n\n        The edge is specified by giving the index of one of the tetrahedra which\n        contains the edge, as well as the index of that edge within the\n        tetrahedron (see below).\n\n        If specified edge is not 3-valent or the three adjacent tetrahedra are\n        not distinct, the function does nothing and returns a non-zero value.\n\n                 1\n                /|\\\n               / | \\\n              2  5  1\n             /   |   \\\n            2--0-|----3\n             \\   |   /\n              4  |  3\n               \\ | /\n                \\|/\n                 0\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_29_three_to_two = {"_three_to_two", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_29_three_to_two, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_28_three_to_two};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_29_three_to_two(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_tet_num = 0;
  PyObject *__pyx_v_edge_index = 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("_three_to_two (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tet_num,&__pyx_mstate_global->__pyx_n_u_edge_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 563, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_three_to_two", 0) < 0) __PYX_ERR(4, 563, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_three_to_two", 1, 2, 2, i); __PYX_ERR(4, 563, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 563, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 563, __pyx_L3_error)
    }
    __pyx_v_tet_num = values[0];
    __pyx_v_edge_index = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_three_to_two", 1, 2, 2, __pyx_nargs); __PYX_ERR(4, 563, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._three_to_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_28_three_to_two(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_tet_num, __pyx_v_edge_index);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_28_three_to_two(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_tet_num, PyObject *__pyx_v_edge_index) {
  FuncResult __pyx_v_result;
  Tetrahedron *__pyx_v_tet;
  EdgeClass *__pyx_v_where_to_resume;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Tetrahedron *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_three_to_two", 0);

  /* "cython/core/triangulation.pyx":590
 *         cdef EdgeClass* where_to_resume
 * 
 *         _ = valid_index(             # <<<<<<<<<<<<<<
 *             tet_num, self.num_tetrahedra(),
 *             "The specified tetrahedron (%s) does not exist.")
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/triangulation.pyx":591
 * 
 *         _ = valid_index(
 *             tet_num, self.num_tetrahedra(),             # <<<<<<<<<<<<<<
 *             "The specified tetrahedron (%s) does not exist.")
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_tet_num, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_specified_tetrahedron_s_does};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v__ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":594
 *             "The specified tetrahedron (%s) does not exist.")
 * 
 *         e = valid_index(             # <<<<<<<<<<<<<<
 *             edge_index, 6,
 *             "The specified edge index (%s) is invalid.")
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/triangulation.pyx":595
 * 
 *         e = valid_index(
 *             edge_index, 6,             # <<<<<<<<<<<<<<
 *             "The specified edge index (%s) is invalid.")
 * 
*/
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_edge_index, __pyx_mstate_global->__pyx_int_6, __pyx_mstate_global->__pyx_kp_u_The_specified_edge_index_s_is_in};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_e = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":598
 *             "The specified edge index (%s) is invalid.")
 * 
 *         tet = self.c_triangulation.tet_list_begin.next             # <<<<<<<<<<<<<<
 *         for i in range(tet_num):
 *             tet = tet.next
*/
  __pyx_t_7 = __pyx_v_self->c_triangulation->tet_list_begin.next;
  __pyx_v_tet = __pyx_t_7;

  /* "cython/core/triangulation.pyx":599
 * 
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(tet_num):             # <<<<<<<<<<<<<<
 *             tet = tet.next
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_3 = __pyx_builtin_range; 
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_tet_num};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 599, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 599, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_8);
        ++__pyx_t_8;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 599, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8);
        #endif
        ++__pyx_t_8;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 599, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 599, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":600
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(tet_num):
 *             tet = tet.next             # <<<<<<<<<<<<<<
 * 
 *         if tet.edge_class[e].order != 3:
*/
    __pyx_t_7 = __pyx_v_tet->next;
    __pyx_v_tet = __pyx_t_7;

    /* "cython/core/triangulation.pyx":599
 * 
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(tet_num):             # <<<<<<<<<<<<<<
 *             tet = tet.next
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":602
 *             tet = tet.next
 * 
 *         if tet.edge_class[e].order != 3:             # <<<<<<<<<<<<<<
 *             return func_failed
 * 
*/
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_e); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 602, __pyx_L1_error)
  __pyx_t_10 = ((__pyx_v_tet->edge_class[__pyx_t_8])->order != 3);
  if (__pyx_t_10) {

    /* "cython/core/triangulation.pyx":603
 * 
 *         if tet.edge_class[e].order != 3:
 *             return func_failed             # <<<<<<<<<<<<<<
 * 
 *         result = three_to_two(tet.edge_class[e], &where_to_resume,
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyLong_From_FuncResult(func_failed); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":602
 *             tet = tet.next
 * 
 *         if tet.edge_class[e].order != 3:             # <<<<<<<<<<<<<<
 *             return func_failed
 * 
*/
  }

  /* "cython/core/triangulation.pyx":605
 *             return func_failed
 * 
 *         result = three_to_two(tet.edge_class[e], &where_to_resume,             # <<<<<<<<<<<<<<
 *                               &self.c_triangulation.num_tetrahedra)
 * 
*/
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_e); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 605, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":606
 * 
 *         result = three_to_two(tet.edge_class[e], &where_to_resume,
 *                               &self.c_triangulation.num_tetrahedra)             # <<<<<<<<<<<<<<
 * 
 *         if result == func_OK:
*/
  __pyx_v_result = three_to_two((__pyx_v_tet->edge_class[__pyx_t_8]), (&__pyx_v_where_to_resume), (&__pyx_v_self->c_triangulation->num_tetrahedra));

  /* "cython/core/triangulation.pyx":608
 *                               &self.c_triangulation.num_tetrahedra)
 * 
 *         if result == func_OK:             # <<<<<<<<<<<<<<
 *             self._cache.clear(message = '3-2 move')
 *             self._polish_hyperbolic_structures()
*/
  __pyx_t_10 = (__pyx_v_result == func_OK);
  if (__pyx_t_10) {

    /* "cython/core/triangulation.pyx":609
 * 
 *         if result == func_OK:
 *             self._cache.clear(message = '3-2 move')             # <<<<<<<<<<<<<<
 *             self._polish_hyperbolic_structures()
 * 
*/
    __pyx_t_1 = __pyx_v_self->_cache;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, NULL};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_3_2_move, __pyx_t_4, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 609, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":610
 *         if result == func_OK:
 *             self._cache.clear(message = '3-2 move')
 *             self._polish_hyperbolic_structures()             # <<<<<<<<<<<<<<
 * 
 *         return result
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_polish_hyperbolic_structures, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":608
 *                               &self.c_triangulation.num_tetrahedra)
 * 
 *         if result == func_OK:             # <<<<<<<<<<<<<<
 *             self._cache.clear(message = '3-2 move')
 *             self._polish_hyperbolic_structures()
*/
  }

  /* "cython/core/triangulation.pyx":612
 *             self._polish_hyperbolic_structures()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def with_hyperbolic_structure(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyLong_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":563
 *         return result
 * 
 *     def _three_to_two(self, tet_num, edge_index):             # <<<<<<<<<<<<<<
 *         r"""
 *         Perform a 3-2 move which removes a given 3-valent edge.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._three_to_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":614
 *         return result
 * 
 *     def with_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Add a (possibly degenerate) hyperbolic structure, turning the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_31with_hyperbolic_structure(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_8SnapPyHP_13Triangulation_30with_hyperbolic_structure, "\n        Add a (possibly degenerate) hyperbolic structure, turning the\n        :class:`Triangulation` into a :class:`Manifold`.\n\n        >>> M = Triangulation('m004')\n        >>> N = M.with_hyperbolic_structure()\n        >>> N.volume() # doctest: +NUMERIC6\n        2.02988321\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_31with_hyperbolic_structure = {"with_hyperbolic_structure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_31with_hyperbolic_structure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_30with_hyperbolic_structure};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_31with_hyperbolic_structure(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("with_hyperbolic_structure (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("with_hyperbolic_structure", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("with_hyperbolic_structure", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_30with_hyperbolic_structure(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_30with_hyperbolic_structure(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("with_hyperbolic_structure", 0);

  /* "cython/core/triangulation.pyx":624
 *         2.02988321
 *         """
 *         return Manifold_from_Triangulation(self)             # <<<<<<<<<<<<<<
 * 
 *     def _polish_hyperbolic_structures(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Manifold_from_Triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":614
 *         return result
 * 
 *     def with_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Add a (possibly degenerate) hyperbolic structure, turning the
*/

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

/* "cython/core/triangulation.pyx":626
 *         return Manifold_from_Triangulation(self)
 * 
 *     def _polish_hyperbolic_structures(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function does nothing for Triangulation. It is overloaded in
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_33_polish_hyperbolic_structures(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_8SnapPyHP_13Triangulation_32_polish_hyperbolic_structures, "\n        This function does nothing for Triangulation. It is overloaded in\n        Manifold.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_33_polish_hyperbolic_structures = {"_polish_hyperbolic_structures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_33_polish_hyperbolic_structures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_32_polish_hyperbolic_structures};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_33_polish_hyperbolic_structures(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("_polish_hyperbolic_structures (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_polish_hyperbolic_structures", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_polish_hyperbolic_structures", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_32_polish_hyperbolic_structures(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_32_polish_hyperbolic_structures(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_polish_hyperbolic_structures", 0);

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

/* "cython/core/triangulation.pyx":633
 *         pass
 * 
 *     def _empty_save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Called by save when no file name is specified, so that in
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_35_empty_save(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_8SnapPyHP_13Triangulation_34_empty_save, "\n        Called by save when no file name is specified, so that in\n        theory it can be overloaded by the UI.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_35_empty_save = {"_empty_save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_35_empty_save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_34_empty_save};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_35_empty_save(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("_empty_save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_empty_save", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_empty_save", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_34_empty_save(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_34_empty_save(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_v_savefile = NULL;
  PyObject *__pyx_v_filename = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_empty_save", 0);

  /* "cython/core/triangulation.pyx":638
 *         theory it can be overloaded by the UI.
 *         """
 *         if asksaveasfile:             # <<<<<<<<<<<<<<
 *             savefile = asksaveasfile(
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asksaveasfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 638, __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(4, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":639
 *         """
 *         if asksaveasfile:
 *             savefile = asksaveasfile(             # <<<<<<<<<<<<<<
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 *                 filetypes = [
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_asksaveasfile); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/triangulation.pyx":641
 *             savefile = asksaveasfile(
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 *                 filetypes = [             # <<<<<<<<<<<<<<
 *                     ('Triangulation and text files', '*.tri *.txt', 'TEXT'),
 *                     ('All text files', '', 'TEXT'),
*/
    __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[12]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_tuple[12]) != (0)) __PYX_ERR(4, 641, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[13]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_tuple[13]) != (0)) __PYX_ERR(4, 641, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[14]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_tuple[14]) != (0)) __PYX_ERR(4, 641, __pyx_L1_error);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_3, NULL};
      __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 639, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_w, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 639, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_title, __pyx_mstate_global->__pyx_kp_u_Save_Triangulation, __pyx_t_7, __pyx_callargs+1, 1) < 0) __PYX_ERR(4, 639, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_defaultextension, __pyx_mstate_global->__pyx_kp_u_tri, __pyx_t_7, __pyx_callargs+1, 2) < 0) __PYX_ERR(4, 639, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filetypes, __pyx_t_5, __pyx_t_7, __pyx_callargs+1, 3) < 0) __PYX_ERR(4, 639, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 639, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_savefile = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":645
 *                     ('All text files', '', 'TEXT'),
 *                     ('All files', '')])
 *             if savefile:             # <<<<<<<<<<<<<<
 *                 filename = savefile.name
 *                 savefile.close()
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_savefile); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 645, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "cython/core/triangulation.pyx":646
 *                     ('All files', '')])
 *             if savefile:
 *                 filename = savefile.name             # <<<<<<<<<<<<<<
 *                 savefile.close()
 *                 self.save(filename)
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_savefile, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_filename = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cython/core/triangulation.pyx":647
 *             if savefile:
 *                 filename = savefile.name
 *                 savefile.close()             # <<<<<<<<<<<<<<
 *                 self.save(filename)
 *                 return
*/
      __pyx_t_4 = __pyx_v_savefile;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 647, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/triangulation.pyx":648
 *                 filename = savefile.name
 *                 savefile.close()
 *                 self.save(filename)             # <<<<<<<<<<<<<<
 *                 return
 * 
*/
      __pyx_t_4 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_save, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/triangulation.pyx":649
 *                 savefile.close()
 *                 self.save(filename)
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         raise ValueError('Please specify a file name.')
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":645
 *                     ('All text files', '', 'TEXT'),
 *                     ('All files', '')])
 *             if savefile:             # <<<<<<<<<<<<<<
 *                 filename = savefile.name
 *                 savefile.close()
*/
    }

    /* "cython/core/triangulation.pyx":638
 *         theory it can be overloaded by the UI.
 *         """
 *         if asksaveasfile:             # <<<<<<<<<<<<<<
 *             savefile = asksaveasfile(
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
*/
  }

  /* "cython/core/triangulation.pyx":651
 *                 return
 * 
 *         raise ValueError('Please specify a file name.')             # <<<<<<<<<<<<<<
 * 
 *     def save(self, file_name=None):
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __pyx_t_7 = __pyx_builtin_ValueError; 
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Please_specify_a_file_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 651, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":633
 *         pass
 * 
 *     def _empty_save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Called by save when no file name is specified, so that in
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._empty_save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_savefile);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":653
 *         raise ValueError('Please specify a file name.')
 * 
 *     def save(self, file_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Save the triangulation as a SnapPea triangulation file.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_37save(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_8SnapPyHP_13Triangulation_36save, "\n        Save the triangulation as a SnapPea triangulation file.\n\n        >>> M = Triangulation('m004')\n        >>> M.save('fig-eight.tri')     #doctest: +SKIP\n\n        To retrieve a SnapPea triangulation from the saved file\n        you can do the following. The first command creates a cusped\n        manifold M. The second one creates the filled manifold M1\n        with Dehn coefficients (2,3).\n\n        >>> M = Manifold('fig-eight.tri')   #doctest: +SKIP\n        >>> M1 = Manifold('fig-eight.tri(2,3)')   #doctest: +SKIP\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_37save = {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_37save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_36save};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_37save(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;
  #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("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_file_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 653, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 653, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "save", 0) < 0) __PYX_ERR(4, 653, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 653, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_file_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 653, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_36save(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_file_name);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_36save(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_file_name) {
  PyObject *__pyx_v_b_file_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save", 0);

  /* "cython/core/triangulation.pyx":669
 * 
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name is None:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":670
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if file_name is None:
 *             self._empty_save()
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 670, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":669
 * 
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name is None:
*/
  }

  /* "cython/core/triangulation.pyx":671
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name is None:             # <<<<<<<<<<<<<<
 *             self._empty_save()
 *         else:
*/
  __pyx_t_1 = (__pyx_v_file_name == Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":672
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name is None:
 *             self._empty_save()             # <<<<<<<<<<<<<<
 *         else:
 *             b_file_name = to_byte_str(file_name)
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_empty_save, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 672, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":671
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name is None:             # <<<<<<<<<<<<<<
 *             self._empty_save()
 *         else:
*/
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":674
 *             self._empty_save()
 *         else:
 *             b_file_name = to_byte_str(file_name)             # <<<<<<<<<<<<<<
 *             write_triangulation(self.c_triangulation, b_file_name)
 * 
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_file_name};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 674, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_b_file_name = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":675
 *         else:
 *             b_file_name = to_byte_str(file_name)
 *             write_triangulation(self.c_triangulation, b_file_name)             # <<<<<<<<<<<<<<
 * 
 *     def _to_string(self):
*/
    __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_b_file_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 675, __pyx_L1_error)
    (void)(write_triangulation(__pyx_v_self->c_triangulation, __pyx_t_6));
  }
  __pyx_L4:;

  /* "cython/core/triangulation.pyx":653
 *         raise ValueError('Please specify a file name.')
 * 
 *     def save(self, file_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Save the triangulation as a SnapPea triangulation file.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b_file_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":677
 *             write_triangulation(self.c_triangulation, b_file_name)
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a string containing the contents of a SnapPea triangulation
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_39_to_string(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_8SnapPyHP_13Triangulation_38_to_string, "\n        Return a string containing the contents of a SnapPea triangulation\n        file.\n        >>> M = Manifold('7_4')\n        >>> seed = M._to_string()\n        >>> N = Manifold(seed)\n        >>> N == M\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_39_to_string = {"_to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_39_to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_38_to_string};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_39_to_string(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("_to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_to_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_to_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_38_to_string(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_38_to_string(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  char *__pyx_v_c_string;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  char const *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_string", 0);

  /* "cython/core/triangulation.pyx":689
 *         cdef char *c_string
 *         cdef result
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":690
 *         cdef result
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         else:
 *             try:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 690, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":689
 *         cdef char *c_string
 *         cdef result
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         else:
*/
  }

  /* "cython/core/triangulation.pyx":692
 *             raise ValueError('The Triangulation is empty.')
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 c_string = string_triangulation(self.c_triangulation)
 *                 result = c_string
*/
  /*else*/ {
    /*try:*/ {

      /* "cython/core/triangulation.pyx":693
 *         else:
 *             try:
 *                 c_string = string_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 *                 result = c_string
 *             finally:
*/
      __pyx_v_c_string = string_triangulation(__pyx_v_self->c_triangulation);

      /* "cython/core/triangulation.pyx":694
 *             try:
 *                 c_string = string_triangulation(self.c_triangulation)
 *                 result = c_string             # <<<<<<<<<<<<<<
 *             finally:
 *                 free(c_string)
*/
      __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 694, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_result = __pyx_t_2;
      __pyx_t_2 = 0;
    }

    /* "cython/core/triangulation.pyx":696
 *                 result = c_string
 *             finally:
 *                 free(c_string)             # <<<<<<<<<<<<<<
 *             return to_str(result)
 * 
*/
    /*finally:*/ {
      /*normal exit:*/{
        free(__pyx_v_c_string);
        goto __pyx_L6;
      }
      __pyx_L5_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        if ( unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
        {
          free(__pyx_v_c_string);
        }
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
        __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
        goto __pyx_L1_error;
      }
      __pyx_L6:;
    }

    /* "cython/core/triangulation.pyx":697
 *             finally:
 *                 free(c_string)
 *             return to_str(result)             # <<<<<<<<<<<<<<
 * 
 *     def _from_string(self, string, remove_finite_vertices=True):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_result};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":677
 *             write_triangulation(self.c_triangulation, b_file_name)
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a string containing the contents of a SnapPea triangulation
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":699
 *             return to_str(result)
 * 
 *     def _from_string(self, string, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_41_from_string(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_8SnapPyHP_13Triangulation_40_from_string, "\n        WARNING: Users should not use this function directly.  To\n        create a Triangulation or Manifold or ManifoldHP from a string\n        containing the contents of a triangulation file, simply do:\n\n        >>> M = Manifold('7_4')\n        >>> seed = M._to_string()\n        >>> N = Manifold(seed)\n        >>> N == M\n        True\n\n        Fill an empty Triangulation from a string generated by\n        _to_string.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_41_from_string = {"_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_41_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_40_from_string};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_41_from_string(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_string = 0;
  PyObject *__pyx_v_remove_finite_vertices = 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_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_string,&__pyx_mstate_global->__pyx_n_u_remove_finite_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 699, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_from_string", 0) < 0) __PYX_ERR(4, 699, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_string", 0, 1, 2, i); __PYX_ERR(4, 699, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 699, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_string = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_string", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 699, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_40_from_string(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_string, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_40_from_string(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_remove_finite_vertices) {
  Triangulation *__pyx_v_c_triangulation;
  PyObject *__pyx_v_b_string = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_string", 0);

  /* "cython/core/triangulation.pyx":714
 *         _to_string.
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
*/
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":715
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         b_string = to_byte_str(string)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":716
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         b_string = to_byte_str(string)
 *         c_triangulation = read_triangulation_from_string(b_string)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_must_be_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 716, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":715
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         b_string = to_byte_str(string)
*/
  }

  /* "cython/core/triangulation.pyx":717
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
 *         b_string = to_byte_str(string)             # <<<<<<<<<<<<<<
 *         c_triangulation = read_triangulation_from_string(b_string)
 *         self.set_c_triangulation(c_triangulation)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_string};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_b_string = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":718
 *             raise ValueError('The Triangulation must be empty.')
 *         b_string = to_byte_str(string)
 *         c_triangulation = read_triangulation_from_string(b_string)             # <<<<<<<<<<<<<<
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:
*/
  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_b_string); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 718, __pyx_L1_error)
  __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_6);

  /* "cython/core/triangulation.pyx":719
 *         b_string = to_byte_str(string)
 *         c_triangulation = read_triangulation_from_string(b_string)
 *         self.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":720
 *         c_triangulation = read_triangulation_from_string(b_string)
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_finite_vertices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 720, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":721
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 *     def _to_bytes(self):
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove_finite_vertices_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 721, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":720
 *         c_triangulation = read_triangulation_from_string(b_string)
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  }

  /* "cython/core/triangulation.pyx":699
 *             return to_str(result)
 * 
 *     def _from_string(self, string, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":723
 *             self._remove_finite_vertices()
 * 
 *     def _to_bytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a reasonably short byte sequence which encodes the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_43_to_bytes(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_8SnapPyHP_13Triangulation_42_to_bytes, "\n        Return a reasonably short byte sequence which encodes the\n        combinatorics of this triangulation.\n        >>> M = Manifold('m125')\n        >>> seed = M._to_bytes()\n        >>> len(seed)\n        12\n        >>> N = Manifold('empty')\n        >>> N._from_bytes(seed)\n        >>> N == M\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_43_to_bytes = {"_to_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_43_to_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_42_to_bytes};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_43_to_bytes(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("_to_bytes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_to_bytes", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_to_bytes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_42_to_bytes(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_42_to_bytes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  TerseTriangulation *__pyx_v_c_terse;
  int __pyx_v_n;
  int __pyx_v_byte;
  PyObject *__pyx_v_byteseq = NULL;
  PyObject *__pyx_v_bit = NULL;
  PyObject *__pyx_9genexpr11__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  TerseTriangulation *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  long __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_bytes", 0);

  /* "cython/core/triangulation.pyx":738
 *         cdef TerseTriangulation* c_terse
 *         cdef int n, byte
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if False in [ c.is_complete for c in self.cusp_info()]:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":739
 *         cdef int n, byte
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if False in [ c.is_complete for c in self.cusp_info()]:
 *             raise ValueError('Byte encoding requires complete cusps.')
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 739, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":738
 *         cdef TerseTriangulation* c_terse
 *         cdef int n, byte
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if False in [ c.is_complete for c in self.cusp_info()]:
*/
  }

  /* "cython/core/triangulation.pyx":740
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if False in [ c.is_complete for c in self.cusp_info()]:             # <<<<<<<<<<<<<<
 *             raise ValueError('Byte encoding requires complete cusps.')
 *         c_terse = tri_to_terse(self.c_triangulation)
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 740, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 740, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    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_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 740, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 740, __pyx_L7_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 740, __pyx_L7_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 740, __pyx_L7_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 740, __pyx_L7_error)
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 740, __pyx_L7_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_c, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr11__pyx_v_c, __pyx_mstate_global->__pyx_n_u_is_complete); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 740, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 740, __pyx_L7_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_c); __pyx_9genexpr11__pyx_v_c = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_c); __pyx_9genexpr11__pyx_v_c = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":741
 *             raise ValueError('The Triangulation is empty.')
 *         if False in [ c.is_complete for c in self.cusp_info()]:
 *             raise ValueError('Byte encoding requires complete cusps.')             # <<<<<<<<<<<<<<
 *         c_terse = tri_to_terse(self.c_triangulation)
 *         byteseq = bytearray([c_terse.num_tetrahedra])
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Byte_encoding_requires_complete};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 741, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":740
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if False in [ c.is_complete for c in self.cusp_info()]:             # <<<<<<<<<<<<<<
 *             raise ValueError('Byte encoding requires complete cusps.')
 *         c_terse = tri_to_terse(self.c_triangulation)
*/
  }

  /* "cython/core/triangulation.pyx":742
 *         if False in [ c.is_complete for c in self.cusp_info()]:
 *             raise ValueError('Byte encoding requires complete cusps.')
 *         c_terse = tri_to_terse(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         byteseq = bytearray([c_terse.num_tetrahedra])
 *         byte, bit = 0, 0
*/
  __pyx_t_8 = tri_to_terse(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 742, __pyx_L1_error)
  __pyx_v_c_terse = __pyx_t_8;

  /* "cython/core/triangulation.pyx":743
 *             raise ValueError('Byte encoding requires complete cusps.')
 *         c_terse = tri_to_terse(self.c_triangulation)
 *         byteseq = bytearray([c_terse.num_tetrahedra])             # <<<<<<<<<<<<<<
 *         byte, bit = 0, 0
 *         for n from 0 <= n < 2*c_terse.num_tetrahedra:
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)(&PyByteArray_Type));
  __pyx_t_3 = ((PyObject *)(&PyByteArray_Type)); 
  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_c_terse->num_tetrahedra); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_9) != (0)) __PYX_ERR(4, 743, __pyx_L1_error);
  __pyx_t_9 = 0;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_byteseq = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":744
 *         c_terse = tri_to_terse(self.c_triangulation)
 *         byteseq = bytearray([c_terse.num_tetrahedra])
 *         byte, bit = 0, 0             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < 2*c_terse.num_tetrahedra:
 *             if c_terse.glues_to_old_tet[n]:
*/
  __pyx_t_11 = 0;
  __pyx_t_2 = __pyx_mstate_global->__pyx_int_0;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_byte = __pyx_t_11;
  __pyx_v_bit = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":745
 *         byteseq = bytearray([c_terse.num_tetrahedra])
 *         byte, bit = 0, 0
 *         for n from 0 <= n < 2*c_terse.num_tetrahedra:             # <<<<<<<<<<<<<<
 *             if c_terse.glues_to_old_tet[n]:
 *                 byte |= 1 << bit
*/
  __pyx_t_12 = (2 * __pyx_v_c_terse->num_tetrahedra);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_12; __pyx_v_n++) {

    /* "cython/core/triangulation.pyx":746
 *         byte, bit = 0, 0
 *         for n from 0 <= n < 2*c_terse.num_tetrahedra:
 *             if c_terse.glues_to_old_tet[n]:             # <<<<<<<<<<<<<<
 *                 byte |= 1 << bit
 *             bit += 1
*/
    __pyx_t_1 = ((__pyx_v_c_terse->glues_to_old_tet[__pyx_v_n]) != 0);
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":747
 *         for n from 0 <= n < 2*c_terse.num_tetrahedra:
 *             if c_terse.glues_to_old_tet[n]:
 *                 byte |= 1 << bit             # <<<<<<<<<<<<<<
 *             bit += 1
 *             if bit % 8 == 0:
*/
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_byte); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Lshift(__pyx_mstate_global->__pyx_int_1, __pyx_v_bit); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 747, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_byte = __pyx_t_11;

      /* "cython/core/triangulation.pyx":746
 *         byte, bit = 0, 0
 *         for n from 0 <= n < 2*c_terse.num_tetrahedra:
 *             if c_terse.glues_to_old_tet[n]:             # <<<<<<<<<<<<<<
 *                 byte |= 1 << bit
 *             bit += 1
*/
    }

    /* "cython/core/triangulation.pyx":748
 *             if c_terse.glues_to_old_tet[n]:
 *                 byte |= 1 << bit
 *             bit += 1             # <<<<<<<<<<<<<<
 *             if bit % 8 == 0:
 *                 byteseq.append(byte)
*/
    __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_v_bit, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF_SET(__pyx_v_bit, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cython/core/triangulation.pyx":749
 *                 byte |= 1 << bit
 *             bit += 1
 *             if bit % 8 == 0:             # <<<<<<<<<<<<<<
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0
*/
    __pyx_t_10 = __Pyx_PyLong_RemainderObjC(__pyx_v_bit, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_10, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":750
 *             bit += 1
 *             if bit % 8 == 0:
 *                 byteseq.append(byte)             # <<<<<<<<<<<<<<
 *                 byte, bit = 0, 0
 *         if bit:
*/
      __pyx_t_13 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, __pyx_v_byte); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 750, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":751
 *             if bit % 8 == 0:
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0             # <<<<<<<<<<<<<<
 *         if bit:
 *             byteseq.append(byte)
*/
      __pyx_t_11 = 0;
      __pyx_t_10 = __pyx_mstate_global->__pyx_int_0;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_v_byte = __pyx_t_11;
      __Pyx_DECREF_SET(__pyx_v_bit, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "cython/core/triangulation.pyx":749
 *                 byte |= 1 << bit
 *             bit += 1
 *             if bit % 8 == 0:             # <<<<<<<<<<<<<<
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0
*/
    }
  }

  /* "cython/core/triangulation.pyx":752
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0
 *         if bit:             # <<<<<<<<<<<<<<
 *             byteseq.append(byte)
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bit); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 752, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":753
 *                 byte, bit = 0, 0
 *         if bit:
 *             byteseq.append(byte)             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
 *             byteseq.append(c_terse.which_old_tet[n])
*/
    __pyx_t_13 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, __pyx_v_byte); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 753, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":752
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0
 *         if bit:             # <<<<<<<<<<<<<<
 *             byteseq.append(byte)
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
*/
  }

  /* "cython/core/triangulation.pyx":754
 *         if bit:
 *             byteseq.append(byte)
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:             # <<<<<<<<<<<<<<
 *             byteseq.append(c_terse.which_old_tet[n])
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
*/
  __pyx_t_12 = (1 + __pyx_v_c_terse->num_tetrahedra);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_12; __pyx_v_n++) {

    /* "cython/core/triangulation.pyx":755
 *             byteseq.append(byte)
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
 *             byteseq.append(c_terse.which_old_tet[n])             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
 *             byteseq.append(c_terse.which_gluing[n])
*/
    __pyx_t_13 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, (__pyx_v_c_terse->which_old_tet[__pyx_v_n])); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 755, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":756
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
 *             byteseq.append(c_terse.which_old_tet[n])
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:             # <<<<<<<<<<<<<<
 *             byteseq.append(c_terse.which_gluing[n])
 *         free_terse_triangulation(c_terse)
*/
  __pyx_t_12 = (1 + __pyx_v_c_terse->num_tetrahedra);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_12; __pyx_v_n++) {

    /* "cython/core/triangulation.pyx":757
 *             byteseq.append(c_terse.which_old_tet[n])
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
 *             byteseq.append(c_terse.which_gluing[n])             # <<<<<<<<<<<<<<
 *         free_terse_triangulation(c_terse)
 *         return bytearray_to_bytes(byteseq)
*/
    __pyx_t_13 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, (__pyx_v_c_terse->which_gluing[__pyx_v_n])); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 757, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":758
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
 *             byteseq.append(c_terse.which_gluing[n])
 *         free_terse_triangulation(c_terse)             # <<<<<<<<<<<<<<
 *         return bytearray_to_bytes(byteseq)
 * 
*/
  free_terse_triangulation(__pyx_v_c_terse); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 758, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":759
 *             byteseq.append(c_terse.which_gluing[n])
 *         free_terse_triangulation(c_terse)
 *         return bytearray_to_bytes(byteseq)             # <<<<<<<<<<<<<<
 * 
 *     def _from_bytes(self, bytestring, *args):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_bytearray_to_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_byteseq};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":723
 *             self._remove_finite_vertices()
 * 
 *     def _to_bytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a reasonably short byte sequence which encodes the
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_byteseq);
  __Pyx_XDECREF(__pyx_v_bit);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":761
 *         return bytearray_to_bytes(byteseq)
 * 
 *     def _from_bytes(self, bytestring, *args):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty triangulation from a byte sequence generated by
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_45_from_bytes(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_8SnapPyHP_13Triangulation_44_from_bytes, "\n        Fill an empty triangulation from a byte sequence generated by\n        _to_bytes.\n        >>> M = Manifold('m125')\n        >>> seed = M._to_bytes()\n        >>> len(seed)\n        12\n        >>> N = Manifold('empty')\n        >>> N._from_bytes(seed)\n        >>> N == M\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_45_from_bytes = {"_from_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_45_from_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_44_from_bytes};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_45_from_bytes(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_bytestring = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 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_bytes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs);
  if (unlikely(!__pyx_v_args)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_v_args);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bytestring,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 761, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, used_pos_args, __pyx_kwds_len, "_from_bytes", 0) < 0) __PYX_ERR(4, 761, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_bytes", 0, 1, 1, i); __PYX_ERR(4, 761, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs < 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 761, __pyx_L3_error)
    }
    __pyx_v_bytestring = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_bytes", 0, 1, 1, __pyx_nargs); __PYX_ERR(4, 761, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_44_from_bytes(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_bytestring, __pyx_v_args);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_44_from_bytes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_bytestring, CYTHON_UNUSED PyObject *__pyx_v_args) {
  Triangulation *__pyx_v_c_triangulation;
  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;
  size_t __pyx_t_5;
  Triangulation *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_bytes", 0);

  /* "cython/core/triangulation.pyx":774
 *         True
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
*/
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":775
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = triangulation_from_bytes(bytestring)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":776
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         c_triangulation = triangulation_from_bytes(bytestring)
 *         self.set_c_triangulation(c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_must_be_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 776, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":775
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = triangulation_from_bytes(bytestring)
*/
  }

  /* "cython/core/triangulation.pyx":777
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = triangulation_from_bytes(bytestring)             # <<<<<<<<<<<<<<
 *         self.set_c_triangulation(c_triangulation)
 * 
*/
  __pyx_t_6 = __pyx_f_8SnapPyHP_triangulation_from_bytes(__pyx_v_bytestring); if (unlikely(__pyx_t_6 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 777, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_6;

  /* "cython/core/triangulation.pyx":778
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = triangulation_from_bytes(bytestring)
 *         self.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     def _from_pickle(self, bytestring, remove_finite_vertices=True):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":761
 *         return bytearray_to_bytes(byteseq)
 * 
 *     def _from_bytes(self, bytestring, *args):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty triangulation from a byte sequence generated by
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":780
 *         self.set_c_triangulation(c_triangulation)
 * 
 *     def _from_pickle(self, bytestring, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_47_from_pickle(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_8SnapPyHP_13Triangulation_46_from_pickle, "\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_47_from_pickle = {"_from_pickle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_47_from_pickle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_46_from_pickle};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_47_from_pickle(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_bytestring = 0;
  PyObject *__pyx_v_remove_finite_vertices = 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_pickle (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bytestring,&__pyx_mstate_global->__pyx_n_u_remove_finite_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 780, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_from_pickle", 0) < 0) __PYX_ERR(4, 780, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_pickle", 0, 1, 2, i); __PYX_ERR(4, 780, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 780, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_bytestring = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_pickle", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 780, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_46_from_pickle(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_bytestring, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_46_from_pickle(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_bytestring, PyObject *__pyx_v_remove_finite_vertices) {
  Triangulation *__pyx_v_c_triangulation;
  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;
  size_t __pyx_t_5;
  Triangulation *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_pickle", 0);

  /* "cython/core/triangulation.pyx":783
 *         """
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
*/
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":784
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = unpickle_triangulation(bytestring)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":785
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         c_triangulation = unpickle_triangulation(bytestring)
 *         self.set_c_triangulation(c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_must_be_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 785, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":784
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = unpickle_triangulation(bytestring)
*/
  }

  /* "cython/core/triangulation.pyx":786
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = unpickle_triangulation(bytestring)             # <<<<<<<<<<<<<<
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:
*/
  if (!(likely(PyBytes_CheckExact(__pyx_v_bytestring))||((__pyx_v_bytestring) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_bytestring))) __PYX_ERR(4, 786, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_8SnapPyHP_unpickle_triangulation(((PyObject*)__pyx_v_bytestring)); if (unlikely(__pyx_t_6 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 786, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_6;

  /* "cython/core/triangulation.pyx":787
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = unpickle_triangulation(bytestring)
 *         self.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":788
 *         c_triangulation = unpickle_triangulation(bytestring)
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_finite_vertices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 788, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":789
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 *     def _from_tetrahedra_gluing_data(self, tetrahedra_data,
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove_finite_vertices_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":788
 *         c_triangulation = unpickle_triangulation(bytestring)
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  }

  /* "cython/core/triangulation.pyx":780
 *         self.set_c_triangulation(c_triangulation)
 * 
 *     def _from_pickle(self, bytestring, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":791
 *             self._remove_finite_vertices()
 * 
 *     def _from_tetrahedra_gluing_data(self, tetrahedra_data,             # <<<<<<<<<<<<<<
 *                                      num_or_cusps=0,
 *                                      num_nonor_cusps=0,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_49_from_tetrahedra_gluing_data(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_8SnapPyHP_13Triangulation_48_from_tetrahedra_gluing_data, "\n        >>> data = [([1, 1, 2, 2], [[0, 1, 3, 2], [2, 3, 1, 0], [0, 1, 3, 2], [3, 0, 1, 2]]),\n        ...         ([0, 2, 2, 0], [[0, 1, 3, 2], [1, 0, 2, 3], [2, 3, 1, 0], [3, 2, 0, 1]]),\n        ...         ([1, 1, 0, 0], [[1, 0, 2, 3], [3, 2, 0, 1], [1, 2, 3, 0], [0, 1, 3, 2]])]\n        >>> M = Triangulation('empty')\n        >>> M._from_tetrahedra_gluing_data(data)\n        >>> N = Triangulation('m007')\n        >>> M == N\n        True\n\n        Check that cusp indices are transmitted. This manfiold has two\n        cusps and trivial symmetry group and we interchange the two\n        cusps.\n\n        >>> M = Manifold('o9_44133')\n        >>> tet_data = M._get_tetrahedra_gluing_data()\n        >>> cusp_data = M._get_cusp_indices_and_peripheral_curve_data()[0]\n        >>> cusp_data = [[1 - c for c in tet_cusps] for tet_cusps in cusp_data]\n        >>> N = Manifold('empty')\n        >>> N._from_tetrahedra_gluing_data(tet_data, num_or_cusps=2, cusp_indices=cusp_data)\n        >>> M.is_isometric_to(N, True)[0].cusp_images()\n        [1, 0]\n\n        A nonorientable example.\n\n        >>> Y = Triangulation('y885')\n        >>> Y.set_peripheral_curves([([1, 0], [0, 1]), ([-1, 0], [0, -1]), ([1, 7], [1, 8])])\n        >>> tets = Y._get_tetrahedra_gluing_data()\n        >>> cusps, curves = Y._get_cusp_indices_and_peripheral_curve_data()\n        >>> max(sum(curves, []))\n        9\n        >>> X = Triangulation('empty')\n        >>> X._from_tetrahedra_gluing_data(tets, 1, 2, cusps, curves)\n        >>> X._get_cusp_indices_and_peripheral_curve_data() == (cusps, curves)\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_49_from_tetrahedra_gluing_data = {"_from_tetrahedra_gluing_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_49_from_tetrahedra_gluing_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_48_from_tetrahedra_gluing_data};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_49_from_tetrahedra_gluing_data(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_tetrahedra_data = 0;
  PyObject *__pyx_v_num_or_cusps = 0;
  PyObject *__pyx_v_num_nonor_cusps = 0;
  PyObject *__pyx_v_cusp_indices = 0;
  PyObject *__pyx_v_peripheral_curves = 0;
  PyObject *__pyx_v_remove_finite_vertices = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_tetrahedra_gluing_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tetrahedra_data,&__pyx_mstate_global->__pyx_n_u_num_or_cusps,&__pyx_mstate_global->__pyx_n_u_num_nonor_cusps,&__pyx_mstate_global->__pyx_n_u_cusp_indices,&__pyx_mstate_global->__pyx_n_u_peripheral_curves,&__pyx_mstate_global->__pyx_n_u_remove_finite_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 791, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_from_tetrahedra_gluing_data", 0) < 0) __PYX_ERR(4, 791, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));

      /* "cython/core/triangulation.pyx":794
 *                                      num_or_cusps=0,
 *                                      num_nonor_cusps=0,
 *                                      cusp_indices=None,             # <<<<<<<<<<<<<<
 *                                      peripheral_curves=None,
 *                                      remove_finite_vertices=True):
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/triangulation.pyx":795
 *                                      num_nonor_cusps=0,
 *                                      cusp_indices=None,
 *                                      peripheral_curves=None,             # <<<<<<<<<<<<<<
 *                                      remove_finite_vertices=True):
 *         """
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/triangulation.pyx":796
 *                                      cusp_indices=None,
 *                                      peripheral_curves=None,
 *                                      remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         >>> data = [([1, 1, 2, 2], [[0, 1, 3, 2], [2, 3, 1, 0], [0, 1, 3, 2], [3, 0, 1, 2]]),
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_tetrahedra_gluing_data", 0, 1, 6, i); __PYX_ERR(4, 791, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 791, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));

      /* "cython/core/triangulation.pyx":794
 *                                      num_or_cusps=0,
 *                                      num_nonor_cusps=0,
 *                                      cusp_indices=None,             # <<<<<<<<<<<<<<
 *                                      peripheral_curves=None,
 *                                      remove_finite_vertices=True):
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/triangulation.pyx":795
 *                                      num_nonor_cusps=0,
 *                                      cusp_indices=None,
 *                                      peripheral_curves=None,             # <<<<<<<<<<<<<<
 *                                      remove_finite_vertices=True):
 *         """
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/triangulation.pyx":796
 *                                      cusp_indices=None,
 *                                      peripheral_curves=None,
 *                                      remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         >>> data = [([1, 1, 2, 2], [[0, 1, 3, 2], [2, 3, 1, 0], [0, 1, 3, 2], [3, 0, 1, 2]]),
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_tetrahedra_data = values[0];
    __pyx_v_num_or_cusps = values[1];
    __pyx_v_num_nonor_cusps = values[2];
    __pyx_v_cusp_indices = values[3];
    __pyx_v_peripheral_curves = values[4];
    __pyx_v_remove_finite_vertices = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_tetrahedra_gluing_data", 0, 1, 6, __pyx_nargs); __PYX_ERR(4, 791, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_tetrahedra_gluing_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_48_from_tetrahedra_gluing_data(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_tetrahedra_data, __pyx_v_num_or_cusps, __pyx_v_num_nonor_cusps, __pyx_v_cusp_indices, __pyx_v_peripheral_curves, __pyx_v_remove_finite_vertices);

  /* "cython/core/triangulation.pyx":791
 *             self._remove_finite_vertices()
 * 
 *     def _from_tetrahedra_gluing_data(self, tetrahedra_data,             # <<<<<<<<<<<<<<
 *                                      num_or_cusps=0,
 *                                      num_nonor_cusps=0,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_48_from_tetrahedra_gluing_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_tetrahedra_data, PyObject *__pyx_v_num_or_cusps, PyObject *__pyx_v_num_nonor_cusps, PyObject *__pyx_v_cusp_indices, PyObject *__pyx_v_peripheral_curves, PyObject *__pyx_v_remove_finite_vertices) {
  Triangulation *__pyx_v_c_triangulation;
  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;
  size_t __pyx_t_5;
  Triangulation *__pyx_t_6;
  struct __pyx_opt_args_8SnapPyHP_listlike_to_triangulation __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_tetrahedra_gluing_data", 0);

  /* "cython/core/triangulation.pyx":833
 *         True
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
*/
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":834
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = listlike_to_triangulation(tetrahedra_data,
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":835
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         c_triangulation = listlike_to_triangulation(tetrahedra_data,
 *                                                     num_or_cusps,
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_must_be_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 835, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":834
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = listlike_to_triangulation(tetrahedra_data,
*/
  }

  /* "cython/core/triangulation.pyx":836
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = listlike_to_triangulation(tetrahedra_data,             # <<<<<<<<<<<<<<
 *                                                     num_or_cusps,
 *                                                     num_nonor_cusps,
*/
  __pyx_t_7.__pyx_n = 4;
  __pyx_t_7.num_or_cusps = __pyx_v_num_or_cusps;
  __pyx_t_7.num_nonor_cusps = __pyx_v_num_nonor_cusps;
  __pyx_t_7.cusp_indices = __pyx_v_cusp_indices;
  __pyx_t_7.peripheral_curves = __pyx_v_peripheral_curves;
  __pyx_t_6 = __pyx_f_8SnapPyHP_listlike_to_triangulation(__pyx_v_tetrahedra_data, &__pyx_t_7); if (unlikely(__pyx_t_6 == ((Triangulation *)0) && PyErr_Occurred())) __PYX_ERR(4, 836, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_6;

  /* "cython/core/triangulation.pyx":841
 *                                                     cusp_indices,
 *                                                     peripheral_curves)
 *         self.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":842
 *                                                     peripheral_curves)
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_finite_vertices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 842, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":843
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 *     def _from_isosig(self, isosig, remove_finite_vertices=True):
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove_finite_vertices_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":842
 *                                                     peripheral_curves)
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  }

  /* "cython/core/triangulation.pyx":791
 *             self._remove_finite_vertices()
 * 
 *     def _from_tetrahedra_gluing_data(self, tetrahedra_data,             # <<<<<<<<<<<<<<
 *                                      num_or_cusps=0,
 *                                      num_nonor_cusps=0,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_tetrahedra_gluing_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":845
 *             self._remove_finite_vertices()
 * 
 *     def _from_isosig(self, isosig, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_51_from_isosig(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_8SnapPyHP_13Triangulation_50_from_isosig, "\n        WARNING: Users should not use this function directly.  To\n        create a Triangulation or Manifold or ManifoldHP from an isosig,\n        simply do:\n\n        >>> M = Manifold('empty')\n        >>> M._from_isosig('jLAwLMQbcbdghgiiixxnxhhxkwv')\n        >>> N = Manifold('o9_10894')\n        >>> M == N\n        True\n\n        Fill an empty Triangulation from an isosig generated by\n        triangulation_isosig.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_51_from_isosig = {"_from_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_51_from_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_50_from_isosig};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_51_from_isosig(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_isosig = 0;
  PyObject *__pyx_v_remove_finite_vertices = 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_isosig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isosig,&__pyx_mstate_global->__pyx_n_u_remove_finite_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 845, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_from_isosig", 0) < 0) __PYX_ERR(4, 845, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_isosig", 0, 1, 2, i); __PYX_ERR(4, 845, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 845, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_isosig = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_isosig", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 845, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_50_from_isosig(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_isosig, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_50_from_isosig(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_isosig, PyObject *__pyx_v_remove_finite_vertices) {
  PyObject *__pyx_v_match = NULL;
  PyObject *__pyx_v_decoration = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  char *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_isosig", 0);
  __Pyx_INCREF(__pyx_v_isosig);

  /* "cython/core/triangulation.pyx":861
 *         """
 * 
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":862
 * 
 *         if self.c_triangulation is not NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 * 
 *         match = is_decorated_isosig.match(isosig)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_must_be_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 862, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":861
 *         """
 * 
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":864
 *             raise ValueError('The Triangulation must be empty.')
 * 
 *         match = is_decorated_isosig.match(isosig)             # <<<<<<<<<<<<<<
 *         if match:
 *             isosig, decoration = match.groups()
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_decorated_isosig); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_isosig};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_match = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":865
 * 
 *         match = is_decorated_isosig.match(isosig)
 *         if match:             # <<<<<<<<<<<<<<
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 865, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":866
 *         match = is_decorated_isosig.match(isosig)
 *         if match:
 *             isosig, decoration = match.groups()             # <<<<<<<<<<<<<<
 *         elif is_isosig.match(isosig):
 *             decoration = None
*/
    __pyx_t_6 = __pyx_v_match;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_groups, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 866, __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(4, 866, __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_INCREF(__pyx_t_6);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 866, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 866, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
      index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(4, 866, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 866, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_isosig, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_v_decoration = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":865
 * 
 *         match = is_decorated_isosig.match(isosig)
 *         if match:             # <<<<<<<<<<<<<<
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):
*/
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":867
 *         if match:
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):             # <<<<<<<<<<<<<<
 *             decoration = None
 *         else:
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_isosig); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_isosig};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":868
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):
 *             decoration = None             # <<<<<<<<<<<<<<
 *         else:
 *             # Did not match regular expression, bail
*/
    __Pyx_INCREF(Py_None);
    __pyx_v_decoration = Py_None;

    /* "cython/core/triangulation.pyx":867
 *         if match:
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):             # <<<<<<<<<<<<<<
 *             decoration = None
 *         else:
*/
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":871
 *         else:
 *             # Did not match regular expression, bail
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.set_c_triangulation(
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }
  __pyx_L4:;

  /* "cython/core/triangulation.pyx":874
 * 
 *         self.set_c_triangulation(
 *             triangulation_from_isomorphism_signature(isosig.encode('ascii')))             # <<<<<<<<<<<<<<
 * 
 *         # Not a valid isomorphism signature, bail
*/
  __pyx_t_3 = __pyx_v_isosig;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ascii};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(4, 874, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":873
 *             return
 * 
 *         self.set_c_triangulation(             # <<<<<<<<<<<<<<
 *             triangulation_from_isomorphism_signature(isosig.encode('ascii')))
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, triangulation_from_isomorphism_signature(__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":877
 * 
 *         # Not a valid isomorphism signature, bail
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":878
 *         # Not a valid isomorphism signature, bail
 *         if self.c_triangulation == NULL:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if decoration:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":877
 * 
 *         # Not a valid isomorphism signature, bail
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "cython/core/triangulation.pyx":880
 *             return
 * 
 *         if decoration:             # <<<<<<<<<<<<<<
 *             decorated_isosig.set_peripheral_from_decoration(self, decoration)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_decoration); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 880, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":881
 * 
 *         if decoration:
 *             decorated_isosig.set_peripheral_from_decoration(self, decoration)             # <<<<<<<<<<<<<<
 * 
 *         if remove_finite_vertices:
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_decorated_isosig); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_set_peripheral_from_decoration); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_decoration};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 881, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":880
 *             return
 * 
 *         if decoration:             # <<<<<<<<<<<<<<
 *             decorated_isosig.set_peripheral_from_decoration(self, decoration)
 * 
*/
  }

  /* "cython/core/triangulation.pyx":883
 *             decorated_isosig.set_peripheral_from_decoration(self, decoration)
 * 
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_finite_vertices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 883, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":884
 * 
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove_finite_vertices_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":883
 *             decorated_isosig.set_peripheral_from_decoration(self, decoration)
 * 
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
*/
  }

  /* "cython/core/triangulation.pyx":845
 *             self._remove_finite_vertices()
 * 
 *     def _from_isosig(self, isosig, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._from_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_match);
  __Pyx_XDECREF(__pyx_v_decoration);
  __Pyx_XDECREF(__pyx_v_isosig);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":888
 * 
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by pickle.dumps.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_53__reduce__(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_8SnapPyHP_13Triangulation_52__reduce__, "\n        Used by pickle.dumps.\n\n        >>> from pickle import loads, dumps\n        >>> from spherogram import random_link\n        >>> M = Manifold('m125')\n        >>> M == loads(dumps(M))\n        True\n        >>> M.dehn_fill((2,3),0)\n        >>> len(dumps(M)) < len(M._to_string())\n        True\n        >>> N = loads(dumps(M))\n        >>> N\n        m125(2,3)(0,0)\n        >>> M.is_isometric_to(N)\n        True\n        >>> M = Manifold('m024')\n        >>> M.is_orientable()\n        False\n        >>> N = loads(dumps(M))\n        >>> N == M\n        True\n        >>> N.volume() == M.volume()\n        True\n        >>> while True:\n        ...    M = random_link(500).exterior()\n        ...    if M.num_tetrahedra() > 256:\n        ...       break\n        ...\n        >>> M == loads(dumps(M))\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_53__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_53__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_52__reduce__};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_53__reduce__(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__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_52__reduce__(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_52__reduce__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cython/core/triangulation.pyx":921
 *         True
 *         """
 *         return (self.__class__, (self.pickle(),))             # <<<<<<<<<<<<<<
 * 
 *     def pickle(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pickle_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(4, 921, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(4, 921, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(4, 921, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":888
 * 
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by pickle.dumps.
*/

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

/* "cython/core/triangulation.pyx":923
 *         return (self.__class__, (self.pickle(),))
 * 
 *     def pickle(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return pickle_triangulation(self.c_triangulation)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_55pickle(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_55pickle = {"pickle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_55pickle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_55pickle(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("pickle (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pickle", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pickle", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_54pickle(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_54pickle(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pickle", 0);

  /* "cython/core/triangulation.pyx":924
 * 
 *     def pickle(self):
 *         try:             # <<<<<<<<<<<<<<
 *             return pickle_triangulation(self.c_triangulation)
 *         except ValueError:
*/
  {
    __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:*/ {

      /* "cython/core/triangulation.pyx":925
 *     def pickle(self):
 *         try:
 *             return pickle_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             # When M has > 255 cusps or does not have integer filling
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __pyx_f_8SnapPyHP_pickle_triangulation(__pyx_v_self->c_triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 925, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/triangulation.pyx":924
 * 
 *     def pickle(self):
 *         try:             # <<<<<<<<<<<<<<
 *             return pickle_triangulation(self.c_triangulation)
 *         except ValueError:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":926
 *         try:
 *             return pickle_triangulation(self.c_triangulation)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             # When M has > 255 cusps or does not have integer filling
 *             # coefficients and curve weights in the interval [-128, 127] we use
*/
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("SnapPyHP.Triangulation.pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 926, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "cython/core/triangulation.pyx":930
 *             # coefficients and curve weights in the interval [-128, 127] we use
 *             # _to_string.
 *             return self._to_string()             # <<<<<<<<<<<<<<
 * 
 *     def _reindex_cusps(self, permutation):
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_string, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 930, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "cython/core/triangulation.pyx":924
 * 
 *     def pickle(self):
 *         try:             # <<<<<<<<<<<<<<
 *             return pickle_triangulation(self.c_triangulation)
 *         except ValueError:
*/
    __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;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":923
 *         return (self.__class__, (self.pickle(),))
 * 
 *     def pickle(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return pickle_triangulation(self.c_triangulation)
*/

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":932
 *             return self._to_string()
 * 
 *     def _reindex_cusps(self, permutation):             # <<<<<<<<<<<<<<
 *         """
 *         >>> import itertools
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_57_reindex_cusps(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_8SnapPyHP_13Triangulation_56_reindex_cusps, "\n        >>> import itertools\n        >>> M = Manifold('L14n62484')\n        >>> ['%.5f' % z.real() for z in M.cusp_info('shape')]\n        ['0.10384', '1.17955', '-1.89674', '0.86324']\n        >>> perms = itertools.permutations(range(4))\n        >>> for perm in perms:\n        ...     shapes = M.cusp_info('shape')\n        ...     M._reindex_cusps(perm)\n        ...     new_shapes = M.cusp_info('shape')\n        ...     for i in range(4):\n        ...         assert new_shapes[perm[i]] == shapes[i]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_57_reindex_cusps = {"_reindex_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_57_reindex_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_56_reindex_cusps};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_57_reindex_cusps(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_permutation = 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("_reindex_cusps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_permutation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 932, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_reindex_cusps", 0) < 0) __PYX_ERR(4, 932, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_reindex_cusps", 1, 1, 1, i); __PYX_ERR(4, 932, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 932, __pyx_L3_error)
    }
    __pyx_v_permutation = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_reindex_cusps", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 932, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._reindex_cusps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_56_reindex_cusps(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_permutation);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_56_reindex_cusps(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_permutation) {
  int *__pyx_v_indices;
  int __pyx_v_n;
  int __pyx_v_num;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reindex_cusps", 0);

  /* "cython/core/triangulation.pyx":947
 *         """
 *         cdef int* indices
 *         cdef int n, num = self.num_cusps()             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num = __pyx_t_4;

  /* "cython/core/triangulation.pyx":948
 *         cdef int* indices
 *         cdef int n, num = self.num_cusps()
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if ( len(permutation) != num or set(permutation) != set(range(num)) ):
*/
  __pyx_t_5 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":949
 *         cdef int n, num = self.num_cusps()
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if ( len(permutation) != num or set(permutation) != set(range(num)) ):
 *             raise ValueError('Not a valid permutation')
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 949, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 949, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":948
 *         cdef int* indices
 *         cdef int n, num = self.num_cusps()
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if ( len(permutation) != num or set(permutation) != set(range(num)) ):
*/
  }

  /* "cython/core/triangulation.pyx":950
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if ( len(permutation) != num or set(permutation) != set(range(num)) ):             # <<<<<<<<<<<<<<
 *             raise ValueError('Not a valid permutation')
 *         indices = <int *>malloc(num*sizeof(int))
*/
  __pyx_t_7 = PyObject_Length(__pyx_v_permutation); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(4, 950, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != __pyx_v_num);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_5 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = PySet_New(__pyx_v_permutation); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_9 = __pyx_builtin_range; 
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_num); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_9 = PySet_New(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_9, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(4, 950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":951
 *             raise ValueError('The Triangulation is empty.')
 *         if ( len(permutation) != num or set(permutation) != set(range(num)) ):
 *             raise ValueError('Not a valid permutation')             # <<<<<<<<<<<<<<
 *         indices = <int *>malloc(num*sizeof(int))
 *         for n in range(num):
*/
    __pyx_t_9 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_1 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Not_a_valid_permutation};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 951, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(4, 951, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":950
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if ( len(permutation) != num or set(permutation) != set(range(num)) ):             # <<<<<<<<<<<<<<
 *             raise ValueError('Not a valid permutation')
 *         indices = <int *>malloc(num*sizeof(int))
*/
  }

  /* "cython/core/triangulation.pyx":952
 *         if ( len(permutation) != num or set(permutation) != set(range(num)) ):
 *             raise ValueError('Not a valid permutation')
 *         indices = <int *>malloc(num*sizeof(int))             # <<<<<<<<<<<<<<
 *         for n in range(num):
 *             indices[n] = permutation[n]
*/
  __pyx_v_indices = ((int *)malloc((__pyx_v_num * (sizeof(int)))));

  /* "cython/core/triangulation.pyx":953
 *             raise ValueError('Not a valid permutation')
 *         indices = <int *>malloc(num*sizeof(int))
 *         for n in range(num):             # <<<<<<<<<<<<<<
 *             indices[n] = permutation[n]
 *         reindex_cusps(self.c_triangulation, indices)
*/
  __pyx_t_4 = __pyx_v_num;
  __pyx_t_11 = __pyx_t_4;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_n = __pyx_t_12;

    /* "cython/core/triangulation.pyx":954
 *         indices = <int *>malloc(num*sizeof(int))
 *         for n in range(num):
 *             indices[n] = permutation[n]             # <<<<<<<<<<<<<<
 *         reindex_cusps(self.c_triangulation, indices)
 *         free(indices)
*/
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_permutation, __pyx_v_n, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 954, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    (__pyx_v_indices[__pyx_v_n]) = __pyx_t_13;
  }

  /* "cython/core/triangulation.pyx":955
 *         for n in range(num):
 *             indices[n] = permutation[n]
 *         reindex_cusps(self.c_triangulation, indices)             # <<<<<<<<<<<<<<
 *         free(indices)
 * 
*/
  reindex_cusps(__pyx_v_self->c_triangulation, __pyx_v_indices);

  /* "cython/core/triangulation.pyx":956
 *             indices[n] = permutation[n]
 *         reindex_cusps(self.c_triangulation, indices)
 *         free(indices)             # <<<<<<<<<<<<<<
 * 
 *     def _get_cusp_indices_and_peripheral_curve_data(self):
*/
  free(__pyx_v_indices);

  /* "cython/core/triangulation.pyx":932
 *             return self._to_string()
 * 
 *     def _reindex_cusps(self, permutation):             # <<<<<<<<<<<<<<
 *         """
 *         >>> import itertools
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._reindex_cusps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":958
 *         free(indices)
 * 
 *     def _get_cusp_indices_and_peripheral_curve_data(self):             # <<<<<<<<<<<<<<
 *         cdef int i, j, k, v, f
 *         cdef TriangulationData* data
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_59_get_cusp_indices_and_peripheral_curve_data(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_59_get_cusp_indices_and_peripheral_curve_data = {"_get_cusp_indices_and_peripheral_curve_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_59_get_cusp_indices_and_peripheral_curve_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_59_get_cusp_indices_and_peripheral_curve_data(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_cusp_indices_and_peripheral_curve_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_cusp_indices_and_peripheral_curve_data", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_cusp_indices_and_peripheral_curve_data", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_58_get_cusp_indices_and_peripheral_curve_data(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_58_get_cusp_indices_and_peripheral_curve_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  TriangulationData *__pyx_v_data;
  PyObject *__pyx_v_result_cusp_indices = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_result_curves = NULL;
  int (*__pyx_v_data_ijk)[4];
  int __pyx_9genexpr12__pyx_v_v;
  int __pyx_9genexpr13__pyx_v_v;
  int __pyx_9genexpr13__pyx_v_f;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_cusp_indices_and_peripheral_curve_data", 0);

  /* "cython/core/triangulation.pyx":961
 *         cdef int i, j, k, v, f
 *         cdef TriangulationData* data
 *         triangulation_to_data(self.c_triangulation, &data)             # <<<<<<<<<<<<<<
 * 
 *         result_cusp_indices = []
*/
  triangulation_to_data(__pyx_v_self->c_triangulation, (&__pyx_v_data)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 961, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":963
 *         triangulation_to_data(self.c_triangulation, &data)
 * 
 *         result_cusp_indices = []             # <<<<<<<<<<<<<<
 *         for i in range(self.num_tetrahedra()):
 *             row = [data.tetrahedron_data[i].cusp_index[v]
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result_cusp_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":964
 * 
 *         result_cusp_indices = []
 *         for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *             row = [data.tetrahedron_data[i].cusp_index[v]
 *                    for v in range(4)]
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 964, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cython/core/triangulation.pyx":965
 *         result_cusp_indices = []
 *         for i in range(self.num_tetrahedra()):
 *             row = [data.tetrahedron_data[i].cusp_index[v]             # <<<<<<<<<<<<<<
 *                    for v in range(4)]
 *             result_cusp_indices.append(row)
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/triangulation.pyx":966
 *         for i in range(self.num_tetrahedra()):
 *             row = [data.tetrahedron_data[i].cusp_index[v]
 *                    for v in range(4)]             # <<<<<<<<<<<<<<
 *             result_cusp_indices.append(row)
 * 
*/
      for (__pyx_t_7 = 0; __pyx_t_7 < 4; __pyx_t_7+=1) {
        __pyx_9genexpr12__pyx_v_v = __pyx_t_7;

        /* "cython/core/triangulation.pyx":965
 *         result_cusp_indices = []
 *         for i in range(self.num_tetrahedra()):
 *             row = [data.tetrahedron_data[i].cusp_index[v]             # <<<<<<<<<<<<<<
 *                    for v in range(4)]
 *             result_cusp_indices.append(row)
*/
        __pyx_t_2 = __Pyx_PyLong_From_int(((__pyx_v_data->tetrahedron_data[__pyx_v_i]).cusp_index[__pyx_9genexpr12__pyx_v_v])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 965, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 965, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
    } /* exit inner scope */
    __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":967
 *             row = [data.tetrahedron_data[i].cusp_index[v]
 *                    for v in range(4)]
 *             result_cusp_indices.append(row)             # <<<<<<<<<<<<<<
 * 
 *         result_curves = []
*/
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result_cusp_indices, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 967, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":969
 *             result_cusp_indices.append(row)
 * 
 *         result_curves = []             # <<<<<<<<<<<<<<
 *         for i in range(self.num_tetrahedra()):
 *             for j in range(2):         # meridian, longitude
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result_curves = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":970
 * 
 *         result_curves = []
 *         for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *             for j in range(2):         # meridian, longitude
 *                 for k in range(2):     # righthanded, lefthanded
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cython/core/triangulation.pyx":971
 *         result_curves = []
 *         for i in range(self.num_tetrahedra()):
 *             for j in range(2):         # meridian, longitude             # <<<<<<<<<<<<<<
 *                 for k in range(2):     # righthanded, lefthanded
 *                     data_ijk = data.tetrahedron_data[i].curve[j][k]
*/
    for (__pyx_t_7 = 0; __pyx_t_7 < 2; __pyx_t_7+=1) {
      __pyx_v_j = __pyx_t_7;

      /* "cython/core/triangulation.pyx":972
 *         for i in range(self.num_tetrahedra()):
 *             for j in range(2):         # meridian, longitude
 *                 for k in range(2):     # righthanded, lefthanded             # <<<<<<<<<<<<<<
 *                     data_ijk = data.tetrahedron_data[i].curve[j][k]
 *                     row = [data_ijk[v][f] for v in range(4) for f in range(4)]
*/
      for (__pyx_t_9 = 0; __pyx_t_9 < 2; __pyx_t_9+=1) {
        __pyx_v_k = __pyx_t_9;

        /* "cython/core/triangulation.pyx":973
 *             for j in range(2):         # meridian, longitude
 *                 for k in range(2):     # righthanded, lefthanded
 *                     data_ijk = data.tetrahedron_data[i].curve[j][k]             # <<<<<<<<<<<<<<
 *                     row = [data_ijk[v][f] for v in range(4) for f in range(4)]
 *                     result_curves.append(row)
*/
        __pyx_v_data_ijk = (((__pyx_v_data->tetrahedron_data[__pyx_v_i]).curve[__pyx_v_j])[__pyx_v_k]);

        /* "cython/core/triangulation.pyx":974
 *                 for k in range(2):     # righthanded, lefthanded
 *                     data_ijk = data.tetrahedron_data[i].curve[j][k]
 *                     row = [data_ijk[v][f] for v in range(4) for f in range(4)]             # <<<<<<<<<<<<<<
 *                     result_curves.append(row)
 * 
*/
        { /* enter inner scope */
          __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 974, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          for (__pyx_t_10 = 0; __pyx_t_10 < 4; __pyx_t_10+=1) {
            __pyx_9genexpr13__pyx_v_v = __pyx_t_10;
            for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
              __pyx_9genexpr13__pyx_v_f = __pyx_t_11;
              __pyx_t_2 = __Pyx_PyLong_From_int(((__pyx_v_data_ijk[__pyx_9genexpr13__pyx_v_v])[__pyx_9genexpr13__pyx_v_f])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 974, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 974, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
          }
        } /* exit inner scope */
        __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "cython/core/triangulation.pyx":975
 *                     data_ijk = data.tetrahedron_data[i].curve[j][k]
 *                     row = [data_ijk[v][f] for v in range(4) for f in range(4)]
 *                     result_curves.append(row)             # <<<<<<<<<<<<<<
 * 
 *         free_triangulation_data(data)
*/
        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result_curves, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 975, __pyx_L1_error)
      }
    }
  }

  /* "cython/core/triangulation.pyx":977
 *                     result_curves.append(row)
 * 
 *         free_triangulation_data(data)             # <<<<<<<<<<<<<<
 *         return (result_cusp_indices, result_curves)
 * 
*/
  free_triangulation_data(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 977, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":978
 * 
 *         free_triangulation_data(data)
 *         return (result_cusp_indices, result_curves)             # <<<<<<<<<<<<<<
 * 
 *     def _get_tetrahedra_gluing_data(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_result_cusp_indices);
  __Pyx_GIVEREF(__pyx_v_result_cusp_indices);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_result_cusp_indices) != (0)) __PYX_ERR(4, 978, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_result_curves);
  __Pyx_GIVEREF(__pyx_v_result_curves);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_result_curves) != (0)) __PYX_ERR(4, 978, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":958
 *         free(indices)
 * 
 *     def _get_cusp_indices_and_peripheral_curve_data(self):             # <<<<<<<<<<<<<<
 *         cdef int i, j, k, v, f
 *         cdef TriangulationData* data
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._get_cusp_indices_and_peripheral_curve_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result_cusp_indices);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_result_curves);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":980
 *         return (result_cusp_indices, result_curves)
 * 
 *     def _get_tetrahedra_gluing_data(self):             # <<<<<<<<<<<<<<
 *         cdef int i, j, k
 *         cdef TriangulationData* data
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_61_get_tetrahedra_gluing_data(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_61_get_tetrahedra_gluing_data = {"_get_tetrahedra_gluing_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_61_get_tetrahedra_gluing_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_61_get_tetrahedra_gluing_data(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_tetrahedra_gluing_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_tetrahedra_gluing_data", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_tetrahedra_gluing_data", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_60_get_tetrahedra_gluing_data(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_60_get_tetrahedra_gluing_data(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  int __pyx_v_i;
  TriangulationData *__pyx_v_data;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_neighbors = NULL;
  PyObject *__pyx_v_perms = NULL;
  int __pyx_9genexpr14__pyx_v_j;
  int __pyx_9genexpr15__pyx_v_j;
  int __pyx_9genexpr16__pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_tetrahedra_gluing_data", 0);

  /* "cython/core/triangulation.pyx":983
 *         cdef int i, j, k
 *         cdef TriangulationData* data
 *         triangulation_to_data(self.c_triangulation, &data)             # <<<<<<<<<<<<<<
 *         result = []
 *         for i from 0 <= i < data.num_tetrahedra:
*/
  triangulation_to_data(__pyx_v_self->c_triangulation, (&__pyx_v_data)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 983, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":984
 *         cdef TriangulationData* data
 *         triangulation_to_data(self.c_triangulation, &data)
 *         result = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < data.num_tetrahedra:
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":985
 *         triangulation_to_data(self.c_triangulation, &data)
 *         result = []
 *         for i from 0 <= i < data.num_tetrahedra:             # <<<<<<<<<<<<<<
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
 *                          for j in range(4)]
*/
  __pyx_t_2 = __pyx_v_data->num_tetrahedra;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":986
 *         result = []
 *         for i from 0 <= i < data.num_tetrahedra:
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]             # <<<<<<<<<<<<<<
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 986, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/triangulation.pyx":987
 *         for i from 0 <= i < data.num_tetrahedra:
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
 *                          for j in range(4)]             # <<<<<<<<<<<<<<
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]
 *                       for k in range(4)] for j in range(4)]
*/
      for (__pyx_t_3 = 0; __pyx_t_3 < 4; __pyx_t_3+=1) {
        __pyx_9genexpr14__pyx_v_j = __pyx_t_3;

        /* "cython/core/triangulation.pyx":986
 *         result = []
 *         for i from 0 <= i < data.num_tetrahedra:
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]             # <<<<<<<<<<<<<<
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]
*/
        __pyx_t_4 = __Pyx_PyLong_From_int(((__pyx_v_data->tetrahedron_data[__pyx_v_i]).neighbor_index[__pyx_9genexpr14__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 986, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    } /* exit inner scope */
    __Pyx_XDECREF_SET(__pyx_v_neighbors, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":988
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]             # <<<<<<<<<<<<<<
 *                       for k in range(4)] for j in range(4)]
 * 
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 988, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/triangulation.pyx":989
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]
 *                       for k in range(4)] for j in range(4)]             # <<<<<<<<<<<<<<
 * 
 *             result.append((neighbors, perms))
*/
      for (__pyx_t_3 = 0; __pyx_t_3 < 4; __pyx_t_3+=1) {
        __pyx_9genexpr15__pyx_v_j = __pyx_t_3;
        { /* enter inner scope */

          /* "cython/core/triangulation.pyx":988
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]             # <<<<<<<<<<<<<<
 *                       for k in range(4)] for j in range(4)]
 * 
*/
          __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 988, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);

          /* "cython/core/triangulation.pyx":989
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]
 *                       for k in range(4)] for j in range(4)]             # <<<<<<<<<<<<<<
 * 
 *             result.append((neighbors, perms))
*/
          for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
            __pyx_9genexpr16__pyx_v_k = __pyx_t_5;

            /* "cython/core/triangulation.pyx":988
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]             # <<<<<<<<<<<<<<
 *                       for k in range(4)] for j in range(4)]
 * 
*/
            __pyx_t_6 = __Pyx_PyLong_From_int((((__pyx_v_data->tetrahedron_data[__pyx_v_i]).gluing[__pyx_9genexpr15__pyx_v_j])[__pyx_9genexpr16__pyx_v_k])); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 988, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 988, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
        } /* exit inner scope */
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 988, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    } /* exit inner scope */
    __Pyx_XDECREF_SET(__pyx_v_perms, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":991
 *                       for k in range(4)] for j in range(4)]
 * 
 *             result.append((neighbors, perms))             # <<<<<<<<<<<<<<
 *         free_triangulation_data(data)
 *         return result
*/
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_neighbors);
    __Pyx_GIVEREF(__pyx_v_neighbors);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_neighbors) != (0)) __PYX_ERR(4, 991, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_perms);
    __Pyx_GIVEREF(__pyx_v_perms);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_perms) != (0)) __PYX_ERR(4, 991, __pyx_L1_error);
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(4, 991, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cython/core/triangulation.pyx":992
 * 
 *             result.append((neighbors, perms))
 *         free_triangulation_data(data)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  free_triangulation_data(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 992, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":993
 *             result.append((neighbors, perms))
 *         free_triangulation_data(data)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _isomorphisms_to(self, Triangulation other not None):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":980
 *         return (result_cusp_indices, result_curves)
 * 
 *     def _get_tetrahedra_gluing_data(self):             # <<<<<<<<<<<<<<
 *         cdef int i, j, k
 *         cdef TriangulationData* data
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._get_tetrahedra_gluing_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_neighbors);
  __Pyx_XDECREF(__pyx_v_perms);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":995
 *         return result
 * 
 *     def _isomorphisms_to(self, Triangulation other not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a complete list of combinatorial isomorphisms between
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_63_isomorphisms_to(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_8SnapPyHP_13Triangulation_62_isomorphisms_to, "\n        Returns a complete list of combinatorial isomorphisms between\n        the two triangulations:\n\n        >>> M = Manifold('5^2_1')\n        >>> N = Manifold('5^2_1')\n        >>> N.set_peripheral_curves([[[2,3],[-1,-1]],[[1,1],[0,1]]])\n        >>> isoms = M.isomorphisms_to(N)\n        >>> isoms[6]\n        0 -> 1  1 -> 0\n        [ 1 0]  [-1 1]\n        [-1 1]  [-3 2]\n        Does not extend to link\n\n        Each transformation between cusps is given by a matrix which\n        acts on the left.  That is, the two *columns* of the matrix\n        give the image of the meridian and longitude respectively.  In\n        the above example, the meridian of cusp 0 is sent to the\n        meridian of cusp 1.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_63_isomorphisms_to = {"_isomorphisms_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_63_isomorphisms_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_62_isomorphisms_to};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_63_isomorphisms_to(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
) {
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other = 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("_isomorphisms_to (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 995, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 995, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_isomorphisms_to", 0) < 0) __PYX_ERR(4, 995, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_isomorphisms_to", 1, 1, 1, i); __PYX_ERR(4, 995, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 995, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_8SnapPyHP_Triangulation *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_isomorphisms_to", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 995, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._isomorphisms_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, 0, "other", 0))) __PYX_ERR(4, 995, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_62_isomorphisms_to(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_other);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_62_isomorphisms_to(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other) {
  IsometryList *__pyx_v_isometries;
  PyObject *__pyx_v_result = 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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_isomorphisms_to", 0);

  /* "cython/core/triangulation.pyx":1016
 *         meridian of cusp 1.
 *         """
 *         cdef IsometryList *isometries = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:
*/
  __pyx_v_isometries = NULL;

  /* "cython/core/triangulation.pyx":1018
 *         cdef IsometryList *isometries = NULL
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifolds must be non-empty.')
 * 
*/
  __pyx_t_2 = (__pyx_v_self->c_triangulation == NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_other->c_triangulation == NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1019
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:
 *             raise ValueError('Manifolds must be non-empty.')             # <<<<<<<<<<<<<<
 * 
 *         compute_cusped_isomorphisms(self.c_triangulation,
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Manifolds_must_be_non_empty};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1019, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1019, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1018
 *         cdef IsometryList *isometries = NULL
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifolds must be non-empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1021
 *             raise ValueError('Manifolds must be non-empty.')
 * 
 *         compute_cusped_isomorphisms(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                     other.c_triangulation,
 *                                     &isometries,
*/
  compute_cusped_isomorphisms(__pyx_v_self->c_triangulation, __pyx_v_other->c_triangulation, (&__pyx_v_isometries), NULL);

  /* "cython/core/triangulation.pyx":1026
 *                                     NULL)
 * 
 *         if isometry_list_size(isometries) == 0:             # <<<<<<<<<<<<<<
 *             result = []
 *         else:
*/
  __pyx_t_7 = isometry_list_size(__pyx_v_isometries); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1026, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_7 == 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1027
 * 
 *         if isometry_list_size(isometries) == 0:
 *             result = []             # <<<<<<<<<<<<<<
 *         else:
 *             result = IsometryListToIsometries(isometries)
*/
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1027, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1026
 *                                     NULL)
 * 
 *         if isometry_list_size(isometries) == 0:             # <<<<<<<<<<<<<<
 *             result = []
 *         else:
*/
    goto __pyx_L6;
  }

  /* "cython/core/triangulation.pyx":1029
 *             result = []
 *         else:
 *             result = IsometryListToIsometries(isometries)             # <<<<<<<<<<<<<<
 *         free_isometry_list(isometries)
 *         return result
*/
  /*else*/ {
    __pyx_t_3 = __pyx_f_8SnapPyHP_IsometryListToIsometries(__pyx_v_isometries); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L6:;

  /* "cython/core/triangulation.pyx":1030
 *         else:
 *             result = IsometryListToIsometries(isometries)
 *         free_isometry_list(isometries)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  free_isometry_list(__pyx_v_isometries); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1030, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1031
 *             result = IsometryListToIsometries(isometries)
 *         free_isometry_list(isometries)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def isomorphisms_to(self, Triangulation other not None):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":995
 *         return result
 * 
 *     def _isomorphisms_to(self, Triangulation other not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a complete list of combinatorial isomorphisms between
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._isomorphisms_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1033
 *         return result
 * 
 *     def isomorphisms_to(self, Triangulation other not None):             # <<<<<<<<<<<<<<
 *         """
 *         This is only here to make the tests that use SnapPy.Triangulation work.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_65isomorphisms_to(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_8SnapPyHP_13Triangulation_64isomorphisms_to, "\n        This is only here to make the tests that use SnapPy.Triangulation work.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_65isomorphisms_to = {"isomorphisms_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_65isomorphisms_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_64isomorphisms_to};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_65isomorphisms_to(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
) {
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other = 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("isomorphisms_to (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1033, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1033, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isomorphisms_to", 0) < 0) __PYX_ERR(4, 1033, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("isomorphisms_to", 1, 1, 1, i); __PYX_ERR(4, 1033, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1033, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_8SnapPyHP_Triangulation *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isomorphisms_to", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 1033, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.isomorphisms_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, 0, "other", 0))) __PYX_ERR(4, 1033, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_64isomorphisms_to(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_other);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_64isomorphisms_to(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isomorphisms_to", 0);

  /* "cython/core/triangulation.pyx":1037
 *         This is only here to make the tests that use SnapPy.Triangulation work.
 *         """
 *         return self._isomorphisms_to(other)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_other)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_isomorphisms_to, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1033
 *         return result
 * 
 *     def isomorphisms_to(self, Triangulation other not None):             # <<<<<<<<<<<<<<
 *         """
 *         This is only here to make the tests that use SnapPy.Triangulation work.
*/

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

/* "cython/core/triangulation.pyx":1039
 *         return self._isomorphisms_to(other)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is not NULL:
 *             free_triangulation(self.c_triangulation)
*/

/* Python wrapper */
static void __pyx_pw_8SnapPyHP_13Triangulation_67__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8SnapPyHP_13Triangulation_67__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_8SnapPyHP_13Triangulation_66__dealloc__(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static void __pyx_pf_8SnapPyHP_13Triangulation_66__dealloc__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cython/core/triangulation.pyx":1040
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1041
 *     def __dealloc__(self):
 *         if self.c_triangulation is not NULL:
 *             free_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(Triangulation self, Triangulation other, op):
*/
    free_triangulation(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1041, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1040
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1039
 *         return self._isomorphisms_to(other)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is not NULL:
 *             free_triangulation(self.c_triangulation)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("SnapPyHP.Triangulation.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
}

/* "cython/core/triangulation.pyx":1043
 *             free_triangulation(self.c_triangulation)
 * 
 *     def __richcmp__(Triangulation self, Triangulation other, op):             # <<<<<<<<<<<<<<
 *         """
 *         Two triangulations are equal if they are combinatorially
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_69__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_69__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op) {
  PyObject *__pyx_v_op = 0;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_v_op = __Pyx_PyLong_From_int(__pyx_arg_op); if (unlikely(!__pyx_v_op)) __PYX_ERR(4, 1043, __pyx_L3_error)
  __Pyx_GOTREF(__pyx_v_op);
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPyHP.Triangulation.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, 1, "other", 0))) __PYX_ERR(4, 1043, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_68__richcmp__(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_other), ((PyObject *)__pyx_v_op));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_68__richcmp__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_other, PyObject *__pyx_v_op) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Boolean __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "cython/core/triangulation.pyx":1057
 *         ValueError: Can't compare triangulations of manifolds with Dehn fillings.
 *         """
 *         if op != 2:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 *         if type(self) != type(other):
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_op, __pyx_mstate_global->__pyx_int_2, 2, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1057, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1058
 *         """
 *         if op != 2:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 *         if type(self) != type(other):
 *             return False
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1057
 *         ValueError: Can't compare triangulations of manifolds with Dehn fillings.
 *         """
 *         if op != 2:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 *         if type(self) != type(other):
*/
  }

  /* "cython/core/triangulation.pyx":1059
 *         if op != 2:
 *             return NotImplemented
 *         if type(self) != type(other):             # <<<<<<<<<<<<<<
 *             return False
 *         if False in ( self.cusp_info('is_complete') +
*/
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_other))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1059, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1060
 *             return NotImplemented
 *         if type(self) != type(other):
 *             return False             # <<<<<<<<<<<<<<
 *         if False in ( self.cusp_info('is_complete') +
 *                       other.cusp_info('is_complete') ):
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1059
 *         if op != 2:
 *             return NotImplemented
 *         if type(self) != type(other):             # <<<<<<<<<<<<<<
 *             return False
 *         if False in ( self.cusp_info('is_complete') +
*/
  }

  /* "cython/core/triangulation.pyx":1061
 *         if type(self) != type(other):
 *             return False
 *         if False in ( self.cusp_info('is_complete') +             # <<<<<<<<<<<<<<
 *                       other.cusp_info('is_complete') ):
 *             raise ValueError("Can't compare triangulations of manifolds "
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_complete};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "cython/core/triangulation.pyx":1062
 *             return False
 *         if False in ( self.cusp_info('is_complete') +
 *                       other.cusp_info('is_complete') ):             # <<<<<<<<<<<<<<
 *             raise ValueError("Can't compare triangulations of manifolds "
 *                              "with Dehn fillings.")
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_other);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_is_complete};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }

  /* "cython/core/triangulation.pyx":1061
 *         if type(self) != type(other):
 *             return False
 *         if False in ( self.cusp_info('is_complete') +             # <<<<<<<<<<<<<<
 *                       other.cusp_info('is_complete') ):
 *             raise ValueError("Can't compare triangulations of manifolds "
*/
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1061, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1063
 *         if False in ( self.cusp_info('is_complete') +
 *                       other.cusp_info('is_complete') ):
 *             raise ValueError("Can't compare triangulations of manifolds "             # <<<<<<<<<<<<<<
 *                              "with Dehn fillings.")
 *         return bool(same_triangulation(self.c_triangulation,
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_2 = __pyx_builtin_ValueError; 
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Can_t_compare_triangulations_of};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1063, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(4, 1063, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1061
 *         if type(self) != type(other):
 *             return False
 *         if False in ( self.cusp_info('is_complete') +             # <<<<<<<<<<<<<<
 *                       other.cusp_info('is_complete') ):
 *             raise ValueError("Can't compare triangulations of manifolds "
*/
  }

  /* "cython/core/triangulation.pyx":1065
 *             raise ValueError("Can't compare triangulations of manifolds "
 *                              "with Dehn fillings.")
 *         return bool(same_triangulation(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                        other.c_triangulation))
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/triangulation.pyx":1066
 *                              "with Dehn fillings.")
 *         return bool(same_triangulation(self.c_triangulation,
 *                                        other.c_triangulation))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_6 = same_triangulation(__pyx_v_self->c_triangulation, __pyx_v_other->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1065, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1065
 *             raise ValueError("Can't compare triangulations of manifolds "
 *                              "with Dehn fillings.")
 *         return bool(same_triangulation(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                        other.c_triangulation))
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_From_Boolean(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1065, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1043
 *             free_triangulation(self.c_triangulation)
 * 
 *     def __richcmp__(Triangulation self, Triangulation other, op):             # <<<<<<<<<<<<<<
 *         """
 *         Two triangulations are equal if they are combinatorially
*/

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

/* "cython/core/triangulation.pyx":1068
 *                                        other.c_triangulation))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             return 'Empty Triangulation'
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_71__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_71__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_8SnapPyHP_13Triangulation_70__repr__(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_70__repr__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_v_repr = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/triangulation.pyx":1069
 * 
 *     def __repr__(self):
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 'Empty Triangulation'
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1070
 *     def __repr__(self):
 *         if self.c_triangulation is NULL:
 *             return 'Empty Triangulation'             # <<<<<<<<<<<<<<
 *         else:
 *             repr = self.name()
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Empty_Triangulation);
    __pyx_r = __pyx_mstate_global->__pyx_kp_u_Empty_Triangulation;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1069
 * 
 *     def __repr__(self):
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 'Empty Triangulation'
 *         else:
*/
  }

  /* "cython/core/triangulation.pyx":1072
 *             return 'Empty Triangulation'
 *         else:
 *             repr = self.name()             # <<<<<<<<<<<<<<
 *             for i in range(self.num_cusps()):
 *                 info = self.cusp_info(i)
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1072, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_repr = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1073
 *         else:
 *             repr = self.name()
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_5 = __pyx_builtin_range; 
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1073, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1073, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1073, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1073, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1073, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1073, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1073, __pyx_L1_error)
      } else {
        __pyx_t_2 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1073, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":1074
 *             repr = self.name()
 *             for i in range(self.num_cusps()):
 *                 info = self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                 if info.is_complete:
 *                     repr += '(0,0)'
*/
      __pyx_t_6 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_i};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1074, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":1075
 *             for i in range(self.num_cusps()):
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:             # <<<<<<<<<<<<<<
 *                     repr += '(0,0)'
 *                 else:
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_info, __pyx_mstate_global->__pyx_n_u_is_complete); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1075, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":1076
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:
 *                     repr += '(0,0)'             # <<<<<<<<<<<<<<
 *                 else:
 *                     repr += '(%g,%g)'% info['filling']
*/
        __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_repr, __pyx_mstate_global->__pyx_kp_u_0_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1076, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_repr, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":1075
 *             for i in range(self.num_cusps()):
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:             # <<<<<<<<<<<<<<
 *                     repr += '(0,0)'
 *                 else:
*/
        goto __pyx_L6;
      }

      /* "cython/core/triangulation.pyx":1078
 *                     repr += '(0,0)'
 *                 else:
 *                     repr += '(%g,%g)'% info['filling']             # <<<<<<<<<<<<<<
 *             return repr
 * 
*/
      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_info, __pyx_mstate_global->__pyx_n_u_filling); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1078, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_g_g, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1078, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_repr, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1078, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_repr, __pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L6:;

      /* "cython/core/triangulation.pyx":1073
 *         else:
 *             repr = self.name()
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":1079
 *                 else:
 *                     repr += '(%g,%g)'% info['filling']
 *             return repr             # <<<<<<<<<<<<<<
 * 
 *     def name(self) -> str:
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_repr);
    __pyx_r = __pyx_v_repr;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":1068
 *                                        other.c_triangulation))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             return 'Empty Triangulation'
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_repr);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1081
 *             return repr
 * 
 *     def name(self) -> str:             # <<<<<<<<<<<<<<
 *         """
 *         Return the name of the triangulation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_73name(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_8SnapPyHP_13Triangulation_72name, "\n        Return the name of the triangulation.\n\n        >>> M = Triangulation('4_1')\n        >>> M.name()\n        '4_1'\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_73name = {"name", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_73name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_72name};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_73name(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("name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("name", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("name", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_72name(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_72name(struct __pyx_obj_8SnapPyHP_Triangulation *__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;
  char *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("name", 0);

  /* "cython/core/triangulation.pyx":1089
 *         '4_1'
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         return to_str(get_triangulation_name(self.c_triangulation))
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1090
 *         """
 *         if self.c_triangulation is NULL:
 *             return             # <<<<<<<<<<<<<<
 *         return to_str(get_triangulation_name(self.c_triangulation))
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1089
 *         '4_1'
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         return to_str(get_triangulation_name(self.c_triangulation))
*/
  }

  /* "cython/core/triangulation.pyx":1091
 *         if self.c_triangulation is NULL:
 *             return
 *         return to_str(get_triangulation_name(self.c_triangulation))             # <<<<<<<<<<<<<<
 * 
 *     def set_name(self, new_name : str) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = get_triangulation_name(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1091, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(4, 1091, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1081
 *             return repr
 * 
 *     def name(self) -> str:             # <<<<<<<<<<<<<<
 *         """
 *         Return the name of the triangulation.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1093
 *         return to_str(get_triangulation_name(self.c_triangulation))
 * 
 *     def set_name(self, new_name : str) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Give the triangulation a new name.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_75set_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_8SnapPyHP_13Triangulation_74set_name, "\n        Give the triangulation a new name.\n\n        >>> M = Triangulation('4_1')\n        >>> M.set_name('figure-eight-comp')\n        >>> M\n        figure-eight-comp(0,0)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_75set_name = {"set_name", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_75set_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_74set_name};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_75set_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_new_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("set_name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_new_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1093, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1093, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_name", 0) < 0) __PYX_ERR(4, 1093, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_name", 1, 1, 1, i); __PYX_ERR(4, 1093, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1093, __pyx_L3_error)
    }
    __pyx_v_new_name = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 1093, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_name), (&PyUnicode_Type), 0, "new_name", 2))) __PYX_ERR(4, 1093, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_74set_name(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_new_name);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_74set_name(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_new_name) {
  PyObject *__pyx_v_b_new_name = NULL;
  char *__pyx_v_c_new_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_name", 0);

  /* "cython/core/triangulation.pyx":1102
 *         figure-eight-comp(0,0)
 *         """
 *         b_new_name = to_byte_str(new_name)             # <<<<<<<<<<<<<<
 *         cdef char* c_new_name = b_new_name
 *         if self.c_triangulation is NULL:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_new_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_b_new_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":1103
 *         """
 *         b_new_name = to_byte_str(new_name)
 *         cdef char* c_new_name = b_new_name             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The empty triangulation has no name.')
*/
  __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_b_new_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(4, 1103, __pyx_L1_error)
  __pyx_v_c_new_name = __pyx_t_5;

  /* "cython/core/triangulation.pyx":1104
 *         b_new_name = to_byte_str(new_name)
 *         cdef char* c_new_name = b_new_name
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The empty triangulation has no name.')
 *         set_triangulation_name(self.c_triangulation, c_new_name)
*/
  __pyx_t_6 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/triangulation.pyx":1105
 *         cdef char* c_new_name = b_new_name
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The empty triangulation has no name.')             # <<<<<<<<<<<<<<
 *         set_triangulation_name(self.c_triangulation, c_new_name)
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_2 = __pyx_builtin_ValueError; 
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_empty_triangulation_has_no_n};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1105, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1104
 *         b_new_name = to_byte_str(new_name)
 *         cdef char* c_new_name = b_new_name
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The empty triangulation has no name.')
 *         set_triangulation_name(self.c_triangulation, c_new_name)
*/
  }

  /* "cython/core/triangulation.pyx":1106
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The empty triangulation has no name.')
 *         set_triangulation_name(self.c_triangulation, c_new_name)             # <<<<<<<<<<<<<<
 * 
 *     def DT_code(self, alpha=False, flips=False):
*/
  set_triangulation_name(__pyx_v_self->c_triangulation, __pyx_v_c_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1106, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1093
 *         return to_str(get_triangulation_name(self.c_triangulation))
 * 
 *     def set_name(self, new_name : str) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Give the triangulation a new name.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b_new_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1108
 *         set_triangulation_name(self.c_triangulation, c_new_name)
 * 
 *     def DT_code(self, alpha=False, flips=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Dowker-Thistlethwaite code of this link complement,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_77DT_code(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_8SnapPyHP_13Triangulation_76DT_code, "\n        Return the Dowker-Thistlethwaite code of this link complement,\n        if it is a link complement. The DT code is intended to be an\n        immutable attribute, for use with knot and link exteriors\n        only, which is set only when the manifold was created.\n\n        Here is the Whitehead link:\n\n        >>> M = Manifold('L5a1')\n        >>> M.DT_code()\n        [(6, 8), (2, 10, 4)]\n        >>> M.DT_code(alpha=True)\n        'ebbccdaeb'\n        >>> M.DT_code(alpha=True, flips=True)\n        'ebbccdaeb.01110'\n        >>> M.DT_code(flips=True)\n        ([(6, 8), (2, 10, 4)], [0, 1, 1, 1, 0])\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_77DT_code = {"DT_code", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_77DT_code, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_76DT_code};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_77DT_code(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_alpha = 0;
  PyObject *__pyx_v_flips = 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("DT_code (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_flips,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1108, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "DT_code", 0) < 0) __PYX_ERR(4, 1108, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_alpha = values[0];
    __pyx_v_flips = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("DT_code", 0, 0, 2, __pyx_nargs); __PYX_ERR(4, 1108, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.DT_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_76DT_code(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_alpha, __pyx_v_flips);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_76DT_code(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_flips) {
  PyObject *__pyx_v_codec = NULL;
  PyObject *__pyx_9genexpr17__pyx_v_x = 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DT_code", 0);

  /* "cython/core/triangulation.pyx":1127
 *         ([(6, 8), (2, 10, 4)], [0, 1, 1, 1, 0])
 *         """
 *         codec = self._DTcode             # <<<<<<<<<<<<<<
 *         if codec is None:
 *             return None
*/
  __pyx_t_1 = __pyx_v_self->_DTcode;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_codec = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":1128
 *         """
 *         codec = self._DTcode
 *         if codec is None:             # <<<<<<<<<<<<<<
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):
*/
  __pyx_t_2 = (__pyx_v_codec == Py_None);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":1129
 *         codec = self._DTcode
 *         if codec is None:
 *             return None             # <<<<<<<<<<<<<<
 *         elif not isinstance(codec, spherogram.DTcodec):
 *             self._DTcode = codec = spherogram.DTcodec(codec)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1128
 *         """
 *         codec = self._DTcode
 *         if codec is None:             # <<<<<<<<<<<<<<
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):
*/
  }

  /* "cython/core/triangulation.pyx":1130
 *         if codec is None:
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):             # <<<<<<<<<<<<<<
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_codec, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (!__pyx_t_2);
  if (__pyx_t_4) {

    /* "cython/core/triangulation.pyx":1131
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):
 *             self._DTcode = codec = spherogram.DTcodec(codec)             # <<<<<<<<<<<<<<
 *         if alpha:
 *             return codec.encode(header=False, flips=flips)
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_codec};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_DTcode);
    __Pyx_DECREF(__pyx_v_self->_DTcode);
    __pyx_v_self->_DTcode = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_codec, __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1130
 *         if codec is None:
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):             # <<<<<<<<<<<<<<
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:
*/
  }

  /* "cython/core/triangulation.pyx":1132
 *         elif not isinstance(codec, spherogram.DTcodec):
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:             # <<<<<<<<<<<<<<
 *             return codec.encode(header=False, flips=flips)
 *         else:
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_alpha); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(4, 1132, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/triangulation.pyx":1133
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:
 *             return codec.encode(header=False, flips=flips)             # <<<<<<<<<<<<<<
 *         else:
 *             if flips:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_v_codec;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_6, NULL};
      __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_header, Py_False, __pyx_t_1, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 1133, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_flips, __pyx_v_flips, __pyx_t_1, __pyx_callargs+1, 1) < 0) __PYX_ERR(4, 1133, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1132
 *         elif not isinstance(codec, spherogram.DTcodec):
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:             # <<<<<<<<<<<<<<
 *             return codec.encode(header=False, flips=flips)
 *         else:
*/
  }

  /* "cython/core/triangulation.pyx":1135
 *             return codec.encode(header=False, flips=flips)
 *         else:
 *             if flips:             # <<<<<<<<<<<<<<
 *                 return codec.code, [int(x) for x in codec.flips]
 *             else:
*/
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_flips); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(4, 1135, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "cython/core/triangulation.pyx":1136
 *         else:
 *             if flips:
 *                 return codec.code, [int(x) for x in codec.flips]             # <<<<<<<<<<<<<<
 *             else:
 *                 return codec.code
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_mstate_global->__pyx_n_u_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1136, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_mstate_global->__pyx_n_u_flips); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1136, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
          __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
          __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1136, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1136, __pyx_L8_error)
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1136, __pyx_L8_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_8);
              ++__pyx_t_8;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1136, __pyx_L8_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8));
              #else
              __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8);
              #endif
              ++__pyx_t_8;
            }
            if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1136, __pyx_L8_error)
          } else {
            __pyx_t_6 = __pyx_t_9(__pyx_t_5);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1136, __pyx_L8_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_x, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_9genexpr17__pyx_v_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1136, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 1136, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_x); __pyx_9genexpr17__pyx_v_x = 0;
        goto __pyx_L12_exit_scope;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_x); __pyx_9genexpr17__pyx_v_x = 0;
        goto __pyx_L1_error;
        __pyx_L12_exit_scope:;
      } /* exit inner scope */
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(4, 1136, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(4, 1136, __pyx_L1_error);
      __pyx_t_3 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":1135
 *             return codec.encode(header=False, flips=flips)
 *         else:
 *             if flips:             # <<<<<<<<<<<<<<
 *                 return codec.code, [int(x) for x in codec.flips]
 *             else:
*/
    }

    /* "cython/core/triangulation.pyx":1138
 *                 return codec.code, [int(x) for x in codec.flips]
 *             else:
 *                 return codec.code             # <<<<<<<<<<<<<<
 * 
 *     def _set_DTcode(self, code, lazy=True):
*/
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_mstate_global->__pyx_n_u_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
  }

  /* "cython/core/triangulation.pyx":1108
 *         set_triangulation_name(self.c_triangulation, c_new_name)
 * 
 *     def DT_code(self, alpha=False, flips=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Dowker-Thistlethwaite code of this link complement,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.DT_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_codec);
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1140
 *                 return codec.code
 * 
 *     def _set_DTcode(self, code, lazy=True):             # <<<<<<<<<<<<<<
 *         if not lazy and not isinstance(code, spherogram.DTcodec):
 *             code = spherogram.DTcodec(code)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_79_set_DTcode(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_79_set_DTcode = {"_set_DTcode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_79_set_DTcode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_79_set_DTcode(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_code = 0;
  PyObject *__pyx_v_lazy = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_DTcode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_code,&__pyx_mstate_global->__pyx_n_u_lazy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1140, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_set_DTcode", 0) < 0) __PYX_ERR(4, 1140, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_set_DTcode", 0, 1, 2, i); __PYX_ERR(4, 1140, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1140, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_code = values[0];
    __pyx_v_lazy = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_DTcode", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 1140, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._set_DTcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_78_set_DTcode(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_code, __pyx_v_lazy);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_78_set_DTcode(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_code, PyObject *__pyx_v_lazy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_DTcode", 0);
  __Pyx_INCREF(__pyx_v_code);

  /* "cython/core/triangulation.pyx":1141
 * 
 *     def _set_DTcode(self, code, lazy=True):
 *         if not lazy and not isinstance(code, spherogram.DTcodec):             # <<<<<<<<<<<<<<
 *             code = spherogram.DTcodec(code)
 *         self._DTcode = code
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lazy); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 1141, __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_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_code, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1142
 *     def _set_DTcode(self, code, lazy=True):
 *         if not lazy and not isinstance(code, spherogram.DTcodec):
 *             code = spherogram.DTcodec(code)             # <<<<<<<<<<<<<<
 *         self._DTcode = code
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_spherogram); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_DTcodec); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_code};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF_SET(__pyx_v_code, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":1141
 * 
 *     def _set_DTcode(self, code, lazy=True):
 *         if not lazy and not isinstance(code, spherogram.DTcodec):             # <<<<<<<<<<<<<<
 *             code = spherogram.DTcodec(code)
 *         self._DTcode = code
*/
  }

  /* "cython/core/triangulation.pyx":1143
 *         if not lazy and not isinstance(code, spherogram.DTcodec):
 *             code = spherogram.DTcodec(code)
 *         self._DTcode = code             # <<<<<<<<<<<<<<
 * 
 *     def _set_PDcode(self, code):
*/
  __Pyx_INCREF(__pyx_v_code);
  __Pyx_GIVEREF(__pyx_v_code);
  __Pyx_GOTREF(__pyx_v_self->_DTcode);
  __Pyx_DECREF(__pyx_v_self->_DTcode);
  __pyx_v_self->_DTcode = __pyx_v_code;

  /* "cython/core/triangulation.pyx":1140
 *                 return codec.code
 * 
 *     def _set_DTcode(self, code, lazy=True):             # <<<<<<<<<<<<<<
 *         if not lazy and not isinstance(code, spherogram.DTcodec):
 *             code = spherogram.DTcodec(code)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._set_DTcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1145
 *         self._DTcode = code
 * 
 *     def _set_PDcode(self, code):             # <<<<<<<<<<<<<<
 *         self._PDcode = code
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_81_set_PDcode(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_81_set_PDcode = {"_set_PDcode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_81_set_PDcode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_81_set_PDcode(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_code = 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_PDcode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_code,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1145, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1145, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_set_PDcode", 0) < 0) __PYX_ERR(4, 1145, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_set_PDcode", 1, 1, 1, i); __PYX_ERR(4, 1145, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1145, __pyx_L3_error)
    }
    __pyx_v_code = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_PDcode", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 1145, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._set_PDcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_80_set_PDcode(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_code);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_80_set_PDcode(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_PDcode", 0);

  /* "cython/core/triangulation.pyx":1146
 * 
 *     def _set_PDcode(self, code):
 *         self._PDcode = code             # <<<<<<<<<<<<<<
 * 
 *     def num_tetrahedra(self) -> int:
*/
  __Pyx_INCREF(__pyx_v_code);
  __Pyx_GIVEREF(__pyx_v_code);
  __Pyx_GOTREF(__pyx_v_self->_PDcode);
  __Pyx_DECREF(__pyx_v_self->_PDcode);
  __pyx_v_self->_PDcode = __pyx_v_code;

  /* "cython/core/triangulation.pyx":1145
 *         self._DTcode = code
 * 
 *     def _set_PDcode(self, code):             # <<<<<<<<<<<<<<
 *         self._PDcode = code
 * 
*/

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

/* "cython/core/triangulation.pyx":1148
 *         self._PDcode = code
 * 
 *     def num_tetrahedra(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of tetrahedra in the triangulation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_83num_tetrahedra(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_8SnapPyHP_13Triangulation_82num_tetrahedra, "\n        Return the number of tetrahedra in the triangulation.\n\n        >>> M = Triangulation('m004')\n        >>> M.num_tetrahedra()\n        2\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_83num_tetrahedra = {"num_tetrahedra", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_83num_tetrahedra, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_82num_tetrahedra};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_83num_tetrahedra(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("num_tetrahedra (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_tetrahedra", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_tetrahedra", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_82num_tetrahedra(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_82num_tetrahedra(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_tetrahedra", 0);

  /* "cython/core/triangulation.pyx":1156
 *         2
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         return get_num_tetrahedra(self.c_triangulation)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1157
 *         """
 *         if self.c_triangulation is NULL:
 *             return 0             # <<<<<<<<<<<<<<
 *         return get_num_tetrahedra(self.c_triangulation)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_r = __pyx_mstate_global->__pyx_int_0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1156
 *         2
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         return get_num_tetrahedra(self.c_triangulation)
*/
  }

  /* "cython/core/triangulation.pyx":1158
 *         if self.c_triangulation is NULL:
 *             return 0
 *         return get_num_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = get_num_tetrahedra(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1158, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyLong_CheckExact(__pyx_t_3)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(4, 1158, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1148
 *         self._PDcode = code
 * 
 *     def num_tetrahedra(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of tetrahedra in the triangulation.
*/

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

/* "cython/core/triangulation.pyx":1160
 *         return get_num_tetrahedra(self.c_triangulation)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_85dehn_fill(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_8SnapPyHP_13Triangulation_84dehn_fill, "\n        Set the Dehn filling coefficients of the cusps.  This can be\n        specified in the following ways, where the cusps are numbered\n        by 0,1,...,(num_cusps - 1).\n\n        - Fill cusp 2:\n\n          >>> M = Triangulation('8^4_1')\n          >>> M.dehn_fill((2,3), 2)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(0,0)\n\n        - Fill the last cusp:\n\n          >>> M.dehn_fill((1,5), -1)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(1,5)\n\n        - Fill the first two cusps:\n\n          >>> M.dehn_fill( [ (3,0), (1, -4) ])\n          >>> M\n          8^4_1(3,0)(1,-4)(2,3)(1,5)\n\n        - When there is only one cusp, there's a shortcut\n\n          >>> N = Triangulation('m004')\n          >>> N.dehn_fill( (-3,4) )\n          >>> N\n          m004(-3,4)\n\n        Does not return a new :class:`Triangulation`.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_85dehn_fill = {"dehn_fill", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_85dehn_fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_84dehn_fill};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_85dehn_fill(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_filling_data = 0;
  PyObject *__pyx_v_which_cusp = 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("dehn_fill (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filling_data,&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1160, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dehn_fill", 0) < 0) __PYX_ERR(4, 1160, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dehn_fill", 0, 1, 2, i); __PYX_ERR(4, 1160, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1160, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_filling_data = values[0];
    __pyx_v_which_cusp = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dehn_fill", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 1160, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.dehn_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_84dehn_fill(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_filling_data, __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_84dehn_fill(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_filling_data, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_num_cusps = NULL;
  PyObject *__pyx_v_meridian = NULL;
  PyObject *__pyx_v_longitude = NULL;
  PyObject *__pyx_v_complete = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_fill = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  Boolean __pyx_t_8;
  __pyx_t_8SnapPyHP_Real __pyx_t_9;
  __pyx_t_8SnapPyHP_Real __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dehn_fill", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/triangulation.pyx":1194
 *         Does not return a new :class:`Triangulation`.
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1195
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         num_cusps = self.num_cusps()
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1195, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1194
 *         Does not return a new :class:`Triangulation`.
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1197
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         num_cusps = self.num_cusps()             # <<<<<<<<<<<<<<
 * 
 *         if which_cusp is not None:
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_num_cusps = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1199
 *         num_cusps = self.num_cusps()
 * 
 *         if which_cusp is not None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, num_cusps,
*/
  __pyx_t_1 = (__pyx_v_which_cusp != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1200
 * 
 *         if which_cusp is not None:
 *             which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *                 which_cusp, num_cusps,
 *                 'The specified cusp (%s) does not exist.')
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/triangulation.pyx":1201
 *         if which_cusp is not None:
 *             which_cusp = valid_index(
 *                 which_cusp, num_cusps,             # <<<<<<<<<<<<<<
 *                 'The specified cusp (%s) does not exist.')
 * 
*/
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_which_cusp, __pyx_v_num_cusps, __pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1204
 *                 'The specified cusp (%s) does not exist.')
 * 
 *             meridian, longitude = filling_data             # <<<<<<<<<<<<<<
 *             complete = ( meridian == 0 and longitude == 0)
 *             set_cusp_info(self.c_triangulation,
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_filling_data))) || (PyList_CheckExact(__pyx_v_filling_data))) {
      PyObject* sequence = __pyx_v_filling_data;
      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(4, 1204, __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_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1204, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1204, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_4 = PyObject_GetIter(__pyx_v_filling_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
      index = 0; __pyx_t_2 = __pyx_t_6(__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_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(4, 1204, __pyx_L1_error)
      __pyx_t_6 = 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_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1204, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_v_meridian = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_longitude = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1205
 * 
 *             meridian, longitude = filling_data
 *             complete = ( meridian == 0 and longitude == 0)             # <<<<<<<<<<<<<<
 *             set_cusp_info(self.c_triangulation,
 *                           which_cusp, complete,
*/
    __pyx_t_2 = __Pyx_PyLong_EqObjC(__pyx_v_meridian, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1205, __pyx_L1_error)
    if (__pyx_t_1) {
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = __pyx_t_2;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyLong_EqObjC(__pyx_v_longitude, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_L7_bool_binop_done:;
    __pyx_v_complete = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1207
 *             complete = ( meridian == 0 and longitude == 0)
 *             set_cusp_info(self.c_triangulation,
 *                           which_cusp, complete,             # <<<<<<<<<<<<<<
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
*/
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1207, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyLong_As_Boolean(__pyx_v_complete); if (unlikely((__pyx_t_8 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(4, 1207, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1208
 *             set_cusp_info(self.c_triangulation,
 *                           which_cusp, complete,
 *                           Object2Real(meridian),             # <<<<<<<<<<<<<<
 *                           Object2Real(longitude))
 *             self._cache.clear(message='dehn_fill')
*/
    __pyx_t_9 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_meridian); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1208, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1209
 *                           which_cusp, complete,
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))             # <<<<<<<<<<<<<<
 *             self._cache.clear(message='dehn_fill')
 *         else:
*/
    __pyx_t_10 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_longitude); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1209, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1206
 *             meridian, longitude = filling_data
 *             complete = ( meridian == 0 and longitude == 0)
 *             set_cusp_info(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                           which_cusp, complete,
 *                           Object2Real(meridian),
*/
    set_cusp_info(__pyx_v_self->c_triangulation, __pyx_t_7, __pyx_t_8, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1206, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1210
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
 *             self._cache.clear(message='dehn_fill')             # <<<<<<<<<<<<<<
 *         else:
 *             if num_cusps > 1 and len(filling_data) == 2:
*/
    __pyx_t_2 = __pyx_v_self->_cache;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_t_4, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 1210, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1199
 *         num_cusps = self.num_cusps()
 * 
 *         if which_cusp is not None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, num_cusps,
*/
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":1212
 *             self._cache.clear(message='dehn_fill')
 *         else:
 *             if num_cusps > 1 and len(filling_data) == 2:             # <<<<<<<<<<<<<<
 *                 if ( not hasattr(filling_data, '__getitem__')
 *                      or not hasattr(filling_data[0], '__getitem__') ):
*/
  /*else*/ {
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_num_cusps, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1212, __pyx_L1_error)
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(4, 1212, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_12 = PyObject_Length(__pyx_v_filling_data); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(4, 1212, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_12 == 2);
    __pyx_t_1 = __pyx_t_11;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":1213
 *         else:
 *             if num_cusps > 1 and len(filling_data) == 2:
 *                 if ( not hasattr(filling_data, '__getitem__')             # <<<<<<<<<<<<<<
 *                      or not hasattr(filling_data[0], '__getitem__') ):
 *                     raise IndexError('If there is more than one cusp '
*/
      __pyx_t_11 = __Pyx_HasAttr(__pyx_v_filling_data, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(4, 1213, __pyx_L1_error)
      __pyx_t_13 = (!__pyx_t_11);
      if (!__pyx_t_13) {
      } else {
        __pyx_t_1 = __pyx_t_13;
        goto __pyx_L13_bool_binop_done;
      }

      /* "cython/core/triangulation.pyx":1214
 *             if num_cusps > 1 and len(filling_data) == 2:
 *                 if ( not hasattr(filling_data, '__getitem__')
 *                      or not hasattr(filling_data[0], '__getitem__') ):             # <<<<<<<<<<<<<<
 *                     raise IndexError('If there is more than one cusp '
 *                                      'you must specify which one you\n'
*/
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_filling_data, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_HasAttr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 1214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = (!__pyx_t_13);
      __pyx_t_1 = __pyx_t_11;
      __pyx_L13_bool_binop_done:;

      /* "cython/core/triangulation.pyx":1213
 *         else:
 *             if num_cusps > 1 and len(filling_data) == 2:
 *                 if ( not hasattr(filling_data, '__getitem__')             # <<<<<<<<<<<<<<
 *                      or not hasattr(filling_data[0], '__getitem__') ):
 *                     raise IndexError('If there is more than one cusp '
*/
      if (unlikely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":1215
 *                 if ( not hasattr(filling_data, '__getitem__')
 *                      or not hasattr(filling_data[0], '__getitem__') ):
 *                     raise IndexError('If there is more than one cusp '             # <<<<<<<<<<<<<<
 *                                      'you must specify which one you\n'
 *                                      'are filling, e.g. M.dehn_fill((2,3),1)')
*/
        __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_builtin_IndexError);
        __pyx_t_2 = __pyx_builtin_IndexError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_If_there_is_more_than_one_cusp_y};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1215, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(4, 1215, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":1213
 *         else:
 *             if num_cusps > 1 and len(filling_data) == 2:
 *                 if ( not hasattr(filling_data, '__getitem__')             # <<<<<<<<<<<<<<
 *                      or not hasattr(filling_data[0], '__getitem__') ):
 *                     raise IndexError('If there is more than one cusp '
*/
      }

      /* "cython/core/triangulation.pyx":1212
 *             self._cache.clear(message='dehn_fill')
 *         else:
 *             if num_cusps > 1 and len(filling_data) == 2:             # <<<<<<<<<<<<<<
 *                 if ( not hasattr(filling_data, '__getitem__')
 *                      or not hasattr(filling_data[0], '__getitem__') ):
*/
    }

    /* "cython/core/triangulation.pyx":1218
 *                                      'you must specify which one you\n'
 *                                      'are filling, e.g. M.dehn_fill((2,3),1)')
 *             if num_cusps == 1 and len(filling_data) == 2:             # <<<<<<<<<<<<<<
 *                 Triangulation.dehn_fill(self, filling_data, 0)
 *                 return
*/
    __pyx_t_11 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_num_cusps, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(4, 1218, __pyx_L1_error)
    if (__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_12 = PyObject_Length(__pyx_v_filling_data); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(4, 1218, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_12 == 2);
    __pyx_t_1 = __pyx_t_11;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":1219
 *                                      'are filling, e.g. M.dehn_fill((2,3),1)')
 *             if num_cusps == 1 and len(filling_data) == 2:
 *                 Triangulation.dehn_fill(self, filling_data, 0)             # <<<<<<<<<<<<<<
 *                 return
 *             if len(filling_data) > num_cusps:
*/
      __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_filling_data, __pyx_mstate_global->__pyx_int_0};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1220
 *             if num_cusps == 1 and len(filling_data) == 2:
 *                 Triangulation.dehn_fill(self, filling_data, 0)
 *                 return             # <<<<<<<<<<<<<<
 *             if len(filling_data) > num_cusps:
 *                 raise IndexError('You provided filling data for too '
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":1218
 *                                      'you must specify which one you\n'
 *                                      'are filling, e.g. M.dehn_fill((2,3),1)')
 *             if num_cusps == 1 and len(filling_data) == 2:             # <<<<<<<<<<<<<<
 *                 Triangulation.dehn_fill(self, filling_data, 0)
 *                 return
*/
    }

    /* "cython/core/triangulation.pyx":1221
 *                 Triangulation.dehn_fill(self, filling_data, 0)
 *                 return
 *             if len(filling_data) > num_cusps:             # <<<<<<<<<<<<<<
 *                 raise IndexError('You provided filling data for too '
 *                                  'many cusps.  There are only %s.'%
*/
    __pyx_t_12 = PyObject_Length(__pyx_v_filling_data); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(4, 1221, __pyx_L1_error)
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_num_cusps, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1221, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1221, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":1222
 *                 return
 *             if len(filling_data) > num_cusps:
 *                 raise IndexError('You provided filling data for too '             # <<<<<<<<<<<<<<
 *                                  'many cusps.  There are only %s.'%
 *                                  num_cusps)
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_IndexError);
      __pyx_t_4 = __pyx_builtin_IndexError; 

      /* "cython/core/triangulation.pyx":1223
 *             if len(filling_data) > num_cusps:
 *                 raise IndexError('You provided filling data for too '
 *                                  'many cusps.  There are only %s.'%             # <<<<<<<<<<<<<<
 *                                  num_cusps)
 *             for i, fill in enumerate(filling_data):
*/
      __pyx_t_14 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_You_provided_filling_data_for_to, __pyx_v_num_cusps); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 1223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_14};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 1222, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":1221
 *                 Triangulation.dehn_fill(self, filling_data, 0)
 *                 return
 *             if len(filling_data) > num_cusps:             # <<<<<<<<<<<<<<
 *                 raise IndexError('You provided filling data for too '
 *                                  'many cusps.  There are only %s.'%
*/
    }

    /* "cython/core/triangulation.pyx":1225
 *                                  'many cusps.  There are only %s.'%
 *                                  num_cusps)
 *             for i, fill in enumerate(filling_data):             # <<<<<<<<<<<<<<
 *                 Triangulation.dehn_fill(self, fill, i)
 * 
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_2 = __pyx_mstate_global->__pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_filling_data)) || PyTuple_CheckExact(__pyx_v_filling_data)) {
      __pyx_t_4 = __pyx_v_filling_data; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_12 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_filling_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1225, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1225, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_12);
          ++__pyx_t_12;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1225, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_14 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12));
          #else
          __pyx_t_14 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12);
          #endif
          ++__pyx_t_12;
        }
        if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 1225, __pyx_L1_error)
      } else {
        __pyx_t_14 = __pyx_t_15(__pyx_t_4);
        if (unlikely(!__pyx_t_14)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1225, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_14);
      __pyx_t_14 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_14 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 1225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "cython/core/triangulation.pyx":1226
 *                                  num_cusps)
 *             for i, fill in enumerate(filling_data):
 *                 Triangulation.dehn_fill(self, fill, i)             # <<<<<<<<<<<<<<
 * 
 *     # When doctesting, the M,L coefficients acquire an accuracy of 8.
*/
      __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_fill, __pyx_v_i};
        __pyx_t_14 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 1226, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "cython/core/triangulation.pyx":1225
 *                                  'many cusps.  There are only %s.'%
 *                                  num_cusps)
 *             for i, fill in enumerate(filling_data):             # <<<<<<<<<<<<<<
 *                 Triangulation.dehn_fill(self, fill, i)
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cython/core/triangulation.pyx":1160
 *         return get_num_tetrahedra(self.c_triangulation)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.dehn_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_cusps);
  __Pyx_XDECREF(__pyx_v_meridian);
  __Pyx_XDECREF(__pyx_v_longitude);
  __Pyx_XDECREF(__pyx_v_complete);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_fill);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1230
 *     # When doctesting, the M,L coefficients acquire an accuracy of 8.
 *     # So we have to include the zeros in the doctest string.
 *     def cusp_info(self, data_spec=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_87cusp_info(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_8SnapPyHP_13Triangulation_86cusp_info, "\n        Returns an info object containing information about the given\n        cusp.   Usage:\n\n        >>> M = Triangulation('v3227(0,0)(1,2)(3,2)')\n        >>> M.cusp_info(1)\n        Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0)\n        >>> c = M.cusp_info(1)\n        >>> c.is_complete\n        False\n        >>> sorted(c.keys())\n        ['filling', 'index', 'is_complete', 'topology']\n\n        You can get information about multiple cusps at once:\n\n        >>> M.cusp_info()\n        [Cusp 0 : torus cusp, not filled,\n         Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0),\n         Cusp 2 : torus cusp with Dehn filling coefficients (M, L) = (3.0, 2.0)]\n        >>> M.cusp_info('is_complete')\n        [True, False, False]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_87cusp_info = {"cusp_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_87cusp_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_86cusp_info};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_87cusp_info(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_data_spec = 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("cusp_info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data_spec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1230, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1230, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cusp_info", 0) < 0) __PYX_ERR(4, 1230, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1230, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_data_spec = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cusp_info", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 1230, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.cusp_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_86cusp_info(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_data_spec);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_86cusp_info(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_data_spec) {
  int __pyx_v_cusp_index;
  CuspTopology __pyx_v_topology;
  Boolean __pyx_v_is_complete;
  __pyx_t_8SnapPyHP_Real __pyx_v_m;
  __pyx_t_8SnapPyHP_Real __pyx_v_l;
  Complex __pyx_v_initial_shape;
  Complex __pyx_v_current_shape;
  int __pyx_v_initial_shape_accuracy;
  int __pyx_v_current_shape_accuracy;
  Complex __pyx_v_initial_modulus;
  Complex __pyx_v_current_modulus;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_9genexpr18__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr19__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cusp_info", 0);

  /* "cython/core/triangulation.pyx":1261
 *         cdef Complex initial_modulus, current_modulus
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec is None:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1262
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1262, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1261
 *         cdef Complex initial_modulus, current_modulus
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec is None:
*/
  }

  /* "cython/core/triangulation.pyx":1263
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec is None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
*/
  __pyx_t_1 = (__pyx_v_data_spec == Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1264
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         if isinstance(data_spec, str):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ListOnePerLine); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1264, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/triangulation.pyx":1265
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]
*/
      __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_9 = __pyx_builtin_range; 
      __pyx_t_11 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
        __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 1265, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1265, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_9 = __pyx_t_7; __Pyx_INCREF(__pyx_t_9);
        __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1265, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1265, __pyx_L7_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1265, __pyx_L7_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_12);
            ++__pyx_t_12;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1265, __pyx_L7_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12));
            #else
            __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_12);
            #endif
            ++__pyx_t_12;
          }
          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1265, __pyx_L7_error)
        } else {
          __pyx_t_7 = __pyx_t_13(__pyx_t_9);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1265, __pyx_L7_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_i, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cython/core/triangulation.pyx":1264
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         if isinstance(data_spec, str):
*/
        __pyx_t_10 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr18__pyx_v_i};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1264, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_7))) __PYX_ERR(4, 1264, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cython/core/triangulation.pyx":1265
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]
*/
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); __pyx_9genexpr18__pyx_v_i = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); __pyx_9genexpr18__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1263
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec is None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
*/
  }

  /* "cython/core/triangulation.pyx":1266
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 *         if isinstance(data_spec, str):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_data_spec); 
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1267
 *                                    for i in range(self.num_cusps())])
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]             # <<<<<<<<<<<<<<
 *         cusp_index = valid_index(
 *             data_spec, self.num_cusps(),
*/
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1267, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1267, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6);
        __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1267, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1267, __pyx_L15_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1267, __pyx_L15_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_12);
            ++__pyx_t_12;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1267, __pyx_L15_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12));
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_12);
            #endif
            ++__pyx_t_12;
          }
          if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1267, __pyx_L15_error)
        } else {
          __pyx_t_3 = __pyx_t_13(__pyx_t_6);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1267, __pyx_L15_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_c, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_9genexpr19__pyx_v_c, __pyx_v_data_spec); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1267, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(4, 1267, __pyx_L15_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_c); __pyx_9genexpr19__pyx_v_c = 0;
      goto __pyx_L19_exit_scope;
      __pyx_L15_error:;
      __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_c); __pyx_9genexpr19__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L19_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1266
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 *         if isinstance(data_spec, str):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
*/
  }

  /* "cython/core/triangulation.pyx":1268
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(             # <<<<<<<<<<<<<<
 *             data_spec, self.num_cusps(),
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/triangulation.pyx":1269
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
 *             data_spec, self.num_cusps(),             # <<<<<<<<<<<<<<
 *             'The specified cusp (%s) does not exist.')
 * 
*/
  __pyx_t_9 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_data_spec, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "cython/core/triangulation.pyx":1268
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(             # <<<<<<<<<<<<<<
 *             data_spec, self.num_cusps(),
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cusp_index = __pyx_t_14;

  /* "cython/core/triangulation.pyx":1272
 *             'The specified cusp (%s) does not exist.')
 * 
 *         get_cusp_info(self.c_triangulation, cusp_index,             # <<<<<<<<<<<<<<
 *                       &topology, &is_complete, &m, &l,
 *                       &initial_shape, &current_shape,
*/
  get_cusp_info(__pyx_v_self->c_triangulation, __pyx_v_cusp_index, (&__pyx_v_topology), (&__pyx_v_is_complete), (&__pyx_v_m), (&__pyx_v_l), (&__pyx_v_initial_shape), (&__pyx_v_current_shape), (&__pyx_v_initial_shape_accuracy), (&__pyx_v_current_shape_accuracy), (&__pyx_v_initial_modulus), (&__pyx_v_current_modulus));

  /* "cython/core/triangulation.pyx":1278
 *                       &initial_modulus, &current_modulus)
 *         info = {
 *            'index' : cusp_index,             # <<<<<<<<<<<<<<
 *            'topology' : CuspTopology[topology],
 *            'is_complete' : B2B(is_complete),
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_cusp_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_3) < 0) __PYX_ERR(4, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1279
 *         info = {
 *            'index' : cusp_index,
 *            'topology' : CuspTopology[topology],             # <<<<<<<<<<<<<<
 *            'is_complete' : B2B(is_complete),
 *            'filling' : (Real2float(m), Real2float(l))
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CuspTopology); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_CuspTopology(__pyx_v_topology); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_topology, __pyx_t_6) < 0) __PYX_ERR(4, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":1280
 *            'index' : cusp_index,
 *            'topology' : CuspTopology[topology],
 *            'is_complete' : B2B(is_complete),             # <<<<<<<<<<<<<<
 *            'filling' : (Real2float(m), Real2float(l))
 *            }
*/
  __pyx_t_6 = __pyx_f_8SnapPyHP_B2B(__pyx_v_is_complete); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_complete, __pyx_t_6) < 0) __PYX_ERR(4, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":1281
 *            'topology' : CuspTopology[topology],
 *            'is_complete' : B2B(is_complete),
 *            'filling' : (Real2float(m), Real2float(l))             # <<<<<<<<<<<<<<
 *            }
 * 
*/
  __pyx_t_6 = __pyx_f_8SnapPyHP_Real2float(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __pyx_f_8SnapPyHP_Real2float(__pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1281, __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) != (0)) __PYX_ERR(4, 1281, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(4, 1281, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_filling, __pyx_t_3) < 0) __PYX_ERR(4, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_info = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1284
 *            }
 * 
 *         return CuspInfo(**info)             # <<<<<<<<<<<<<<
 * 
 *     def reverse_orientation(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CuspInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyDict_Copy(__pyx_v_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1284, __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;

  /* "cython/core/triangulation.pyx":1230
 *     # When doctesting, the M,L coefficients acquire an accuracy of 8.
 *     # So we have to include the zeros in the doctest string.
 *     def cusp_info(self, data_spec=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.cusp_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1286
 *         return CuspInfo(**info)
 * 
 *     def reverse_orientation(self) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Reverses the orientation of the Triangulation, presuming that
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_89reverse_orientation(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_8SnapPyHP_13Triangulation_88reverse_orientation, "\n        Reverses the orientation of the Triangulation, presuming that\n        it is orientable.\n\n        >>> M = Manifold('m015')\n        >>> cs = M.chern_simons()\n        >>> M.reverse_orientation()\n        >>> abs(cs + M.chern_simons()) # doctest: +NUMERIC9\n        0.0\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_89reverse_orientation = {"reverse_orientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_89reverse_orientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_88reverse_orientation};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_89reverse_orientation(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_orientation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reverse_orientation", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reverse_orientation", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_88reverse_orientation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_88reverse_orientation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_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("reverse_orientation", 0);

  /* "cython/core/triangulation.pyx":1297
 *         0.0
 *         """
 *         if not self.is_orientable():             # <<<<<<<<<<<<<<
 *             raise ValueError("The Manifold is not orientable, so its "
 *                              "orientation can't be reversed.")
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(4, 1297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":1298
 *         """
 *         if not self.is_orientable():
 *             raise ValueError("The Manifold is not orientable, so its "             # <<<<<<<<<<<<<<
 *                              "orientation can't be reversed.")
 *         reorient(self.c_triangulation)
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_Manifold_is_not_orientable_s};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1298, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1297
 *         0.0
 *         """
 *         if not self.is_orientable():             # <<<<<<<<<<<<<<
 *             raise ValueError("The Manifold is not orientable, so its "
 *                              "orientation can't be reversed.")
*/
  }

  /* "cython/core/triangulation.pyx":1300
 *             raise ValueError("The Manifold is not orientable, so its "
 *                              "orientation can't be reversed.")
 *         reorient(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         self._cache.clear(message='reverse_orientation')
 * 
*/
  reorient(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1300, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1301
 *                              "orientation can't be reversed.")
 *         reorient(self.c_triangulation)
 *         self._cache.clear(message='reverse_orientation')             # <<<<<<<<<<<<<<
 * 
 *     def filled_triangulation(
*/
  __pyx_t_6 = __pyx_v_self->_cache;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_n_u_reverse_orientation, __pyx_t_2, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 1301, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":1286
 *         return CuspInfo(**info)
 * 
 *     def reverse_orientation(self) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Reverses the orientation of the Triangulation, presuming that
*/

  /* 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_AddTraceback("SnapPyHP.Triangulation.reverse_orientation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1303
 *         self._cache.clear(message='reverse_orientation')
 * 
 *     def filled_triangulation(             # <<<<<<<<<<<<<<
 *             self, cusps_to_fill='all') -> 'snappy.Triangulation':
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_91filled_triangulation(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_8SnapPyHP_13Triangulation_90filled_triangulation, "\n        Return a new manifold where the specified cusps have been\n        permanently filled in.  Examples:\n\n        Filling all the cusps:\n\n        >>> M = Triangulation('m125(1,2)(3,4)')\n        >>> N = M.filled_triangulation()\n        >>> N.num_cusps()\n        0\n\n        Filling cusps 0 and 2 :\n\n        >>> M = Triangulation('v3227(1,2)(3,4)(5,6)')\n        >>> M.filled_triangulation([0,2])\n        v3227_filled(3,4)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_91filled_triangulation = {"filled_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_91filled_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_90filled_triangulation};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_91filled_triangulation(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_cusps_to_fill = 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("filled_triangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cusps_to_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1303, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "filled_triangulation", 0) < 0) __PYX_ERR(4, 1303, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    }
    __pyx_v_cusps_to_fill = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filled_triangulation", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 1303, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_90filled_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_cusps_to_fill);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_90filled_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_cusps_to_fill) {
  PyObject *__pyx_v_n = NULL;
  Triangulation *__pyx_v_c_filled_tri;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_filled_tri = 0;
  Boolean *__pyx_v_fill_cusp_spec;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_fill_all = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_c = NULL;
  PyObject *__pyx_9genexpr21__pyx_v_c = NULL;
  PyObject *__pyx_9genexpr22__pyx_v_c = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  Boolean __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Triangulation *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("filled_triangulation", 0);
  __Pyx_INCREF(__pyx_v_cusps_to_fill);

  /* "cython/core/triangulation.pyx":1322
 *         v3227_filled(3,4)
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1323
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         n = self.num_cusps()
 *         if cusps_to_fill == 'all':
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1323, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1322
 *         v3227_filled(3,4)
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
*/
  }

  /* "cython/core/triangulation.pyx":1324
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()             # <<<<<<<<<<<<<<
 *         if cusps_to_fill == 'all':
 *             cusps_to_fill = [c for c in range(n) if cusp_is_fillable(self.c_triangulation, c)]
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1325
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 *         if cusps_to_fill == 'all':             # <<<<<<<<<<<<<<
 *             cusps_to_fill = [c for c in range(n) if cusp_is_fillable(self.c_triangulation, c)]
 * 
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_cusps_to_fill, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1325, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1326
 *         n = self.num_cusps()
 *         if cusps_to_fill == 'all':
 *             cusps_to_fill = [c for c in range(n) if cusp_is_fillable(self.c_triangulation, c)]             # <<<<<<<<<<<<<<
 * 
 *         if False in [(c in range(n)) for c in cusps_to_fill]:
*/
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1326, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_6 = __pyx_builtin_range; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_n};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1326, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_6 = __pyx_t_4; __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_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1326, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1326, __pyx_L7_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1326, __pyx_L7_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_7);
            ++__pyx_t_7;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1326, __pyx_L7_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7));
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7);
            #endif
            ++__pyx_t_7;
          }
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1326, __pyx_L7_error)
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_6);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1326, __pyx_L7_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_c, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_9genexpr20__pyx_v_c); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1326, __pyx_L7_error)
        __pyx_t_10 = cusp_is_fillable(__pyx_v_self->c_triangulation, __pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1326, __pyx_L7_error)
        __pyx_t_1 = (__pyx_t_10 != 0);
        if (__pyx_t_1) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr20__pyx_v_c))) __PYX_ERR(4, 1326, __pyx_L7_error)
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_c); __pyx_9genexpr20__pyx_v_c = 0;
      goto __pyx_L12_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_c); __pyx_9genexpr20__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L12_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_cusps_to_fill, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1325
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 *         if cusps_to_fill == 'all':             # <<<<<<<<<<<<<<
 *             cusps_to_fill = [c for c in range(n) if cusp_is_fillable(self.c_triangulation, c)]
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1328
 *             cusps_to_fill = [c for c in range(n) if cusp_is_fillable(self.c_triangulation, c)]
 * 
 *         if False in [(c in range(n)) for c in cusps_to_fill]:             # <<<<<<<<<<<<<<
 *             raise IndexError('The specified indices to be filled are beyond '
 *                              'the actual number of cusps.')
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1328, __pyx_L16_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_cusps_to_fill)) || PyTuple_CheckExact(__pyx_v_cusps_to_fill)) {
      __pyx_t_6 = __pyx_v_cusps_to_fill; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_cusps_to_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1328, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1328, __pyx_L16_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1328, __pyx_L16_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1328, __pyx_L16_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1328, __pyx_L16_error)
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1328, __pyx_L16_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_c, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_11 = __pyx_builtin_range; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_n};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1328, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr21__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1328, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1328, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 1328, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_c); __pyx_9genexpr21__pyx_v_c = 0;
    goto __pyx_L20_exit_scope;
    __pyx_L16_error:;
    __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_c); __pyx_9genexpr21__pyx_v_c = 0;
    goto __pyx_L1_error;
    __pyx_L20_exit_scope:;
  } /* exit inner scope */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1329
 * 
 *         if False in [(c in range(n)) for c in cusps_to_fill]:
 *             raise IndexError('The specified indices to be filled are beyond '             # <<<<<<<<<<<<<<
 *                              'the actual number of cusps.')
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)
*/
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_IndexError);
    __pyx_t_4 = __pyx_builtin_IndexError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_The_specified_indices_to_be_fill};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1329, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1328
 *             cusps_to_fill = [c for c in range(n) if cusp_is_fillable(self.c_triangulation, c)]
 * 
 *         if False in [(c in range(n)) for c in cusps_to_fill]:             # <<<<<<<<<<<<<<
 *             raise IndexError('The specified indices to be filled are beyond '
 *                              'the actual number of cusps.')
*/
  }

  /* "cython/core/triangulation.pyx":1331
 *             raise IndexError('The specified indices to be filled are beyond '
 *                              'the actual number of cusps.')
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)             # <<<<<<<<<<<<<<
 *                  for c in cusps_to_fill]:
 *             raise IndexError('To permanently fill a cusp, the Dehn '
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1331, __pyx_L24_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/triangulation.pyx":1332
 *                              'the actual number of cusps.')
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)
 *                  for c in cusps_to_fill]:             # <<<<<<<<<<<<<<
 *             raise IndexError('To permanently fill a cusp, the Dehn '
 *                              'filling coefficients must be relatively '
*/
    if (likely(PyList_CheckExact(__pyx_v_cusps_to_fill)) || PyTuple_CheckExact(__pyx_v_cusps_to_fill)) {
      __pyx_t_4 = __pyx_v_cusps_to_fill; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_cusps_to_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1332, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1332, __pyx_L24_error)
    }
    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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1332, __pyx_L24_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1332, __pyx_L24_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1332, __pyx_L24_error)
      } else {
        __pyx_t_6 = __pyx_t_8(__pyx_t_4);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1332, __pyx_L24_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_c, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":1331
 *             raise IndexError('The specified indices to be filled are beyond '
 *                              'the actual number of cusps.')
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)             # <<<<<<<<<<<<<<
 *                  for c in cusps_to_fill]:
 *             raise IndexError('To permanently fill a cusp, the Dehn '
*/
      __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_9genexpr22__pyx_v_c); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1331, __pyx_L24_error)
      __pyx_t_10 = cusp_is_fillable(__pyx_v_self->c_triangulation, __pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1331, __pyx_L24_error)
      __pyx_t_6 = __Pyx_PyLong_From_Boolean(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1331, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 1331, __pyx_L24_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":1332
 *                              'the actual number of cusps.')
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)
 *                  for c in cusps_to_fill]:             # <<<<<<<<<<<<<<
 *             raise IndexError('To permanently fill a cusp, the Dehn '
 *                              'filling coefficients must be relatively '
*/
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_c); __pyx_9genexpr22__pyx_v_c = 0;
    goto __pyx_L28_exit_scope;
    __pyx_L24_error:;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_c); __pyx_9genexpr22__pyx_v_c = 0;
    goto __pyx_L1_error;
    __pyx_L28_exit_scope:;
  } /* exit inner scope */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_int_0, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1331
 *             raise IndexError('The specified indices to be filled are beyond '
 *                              'the actual number of cusps.')
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)             # <<<<<<<<<<<<<<
 *                  for c in cusps_to_fill]:
 *             raise IndexError('To permanently fill a cusp, the Dehn '
*/
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1333
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)
 *                  for c in cusps_to_fill]:
 *             raise IndexError('To permanently fill a cusp, the Dehn '             # <<<<<<<<<<<<<<
 *                              'filling coefficients must be relatively '
 *                              'prime integers.')
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_IndexError);
    __pyx_t_6 = __pyx_builtin_IndexError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_To_permanently_fill_a_cusp_the_D};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1333, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1331
 *             raise IndexError('The specified indices to be filled are beyond '
 *                              'the actual number of cusps.')
 *         if 0 in [cusp_is_fillable(self.c_triangulation, c)             # <<<<<<<<<<<<<<
 *                  for c in cusps_to_fill]:
 *             raise IndexError('To permanently fill a cusp, the Dehn '
*/
  }

  /* "cython/core/triangulation.pyx":1337
 *                              'prime integers.')
 * 
 *         cdef c_Triangulation* c_filled_tri = NULL             # <<<<<<<<<<<<<<
 *         cdef Triangulation filled_tri
 *         cdef Boolean *fill_cusp_spec = NULL
*/
  __pyx_v_c_filled_tri = NULL;

  /* "cython/core/triangulation.pyx":1339
 *         cdef c_Triangulation* c_filled_tri = NULL
 *         cdef Triangulation filled_tri
 *         cdef Boolean *fill_cusp_spec = NULL             # <<<<<<<<<<<<<<
 * 
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
*/
  __pyx_v_fill_cusp_spec = NULL;

  /* "cython/core/triangulation.pyx":1341
 *         cdef Boolean *fill_cusp_spec = NULL
 * 
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             fill_cusp_spec[i] = True if i in cusps_to_fill else False
*/
  __pyx_t_2 = __Pyx_PyLong_FromSize_t((sizeof(Boolean))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyNumber_Multiply(__pyx_v_n, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_fill_cusp_spec = ((Boolean *)malloc(__pyx_t_5));

  /* "cython/core/triangulation.pyx":1342
 * 
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             fill_cusp_spec[i] = True if i in cusps_to_fill else False
 *         fill_all = all([i in cusps_to_fill for i in range(n)])
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_4 = __pyx_builtin_range; 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_n};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  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(4, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1342, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1342, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1342, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1342, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_8(__pyx_t_4);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1342, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":1343
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 *         for i in range(n):
 *             fill_cusp_spec[i] = True if i in cusps_to_fill else False             # <<<<<<<<<<<<<<
 *         fill_all = all([i in cusps_to_fill for i in range(n)])
 *         c_filled_tri = fill_cusps(self.c_triangulation,
*/
    __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_i, __pyx_v_cusps_to_fill, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 1343, __pyx_L1_error)
    if (__pyx_t_12) {
      __pyx_t_1 = 1;
    } else {
      __pyx_t_1 = 0;
    }
    __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1343, __pyx_L1_error)
    (__pyx_v_fill_cusp_spec[__pyx_t_13]) = __pyx_t_1;

    /* "cython/core/triangulation.pyx":1342
 * 
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             fill_cusp_spec[i] = True if i in cusps_to_fill else False
 *         fill_all = all([i in cusps_to_fill for i in range(n)])
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1344
 *         for i in range(n):
 *             fill_cusp_spec[i] = True if i in cusps_to_fill else False
 *         fill_all = all([i in cusps_to_fill for i in range(n)])             # <<<<<<<<<<<<<<
 *         c_filled_tri = fill_cusps(self.c_triangulation,
 *                                   fill_cusp_spec, '', fill_all)
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF(__pyx_builtin_all);
  __pyx_t_2 = __pyx_builtin_all; 
  { /* enter inner scope */
    __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 1344, __pyx_L34_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_14 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_15 = __pyx_builtin_range; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_n};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(4, 1344, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_15 = __pyx_t_3; __Pyx_INCREF(__pyx_t_15);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1344, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1344, __pyx_L34_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_15))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1344, __pyx_L34_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_15, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1344, __pyx_L34_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_7));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1344, __pyx_L34_error)
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_15);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1344, __pyx_L34_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr23__pyx_v_i, __pyx_v_cusps_to_fill, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1344, __pyx_L34_error)
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1344, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_3))) __PYX_ERR(4, 1344, __pyx_L34_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_i); __pyx_9genexpr23__pyx_v_i = 0;
    goto __pyx_L38_exit_scope;
    __pyx_L34_error:;
    __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_i); __pyx_9genexpr23__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L38_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_11};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_fill_all = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1346
 *         fill_all = all([i in cusps_to_fill for i in range(n)])
 *         c_filled_tri = fill_cusps(self.c_triangulation,
 *                                   fill_cusp_spec, '', fill_all)             # <<<<<<<<<<<<<<
 *         free(fill_cusp_spec)
 *         filled_tri = self.__class__('empty')
*/
  __pyx_t_10 = __Pyx_PyLong_As_Boolean(__pyx_v_fill_all); if (unlikely((__pyx_t_10 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(4, 1346, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1345
 *             fill_cusp_spec[i] = True if i in cusps_to_fill else False
 *         fill_all = all([i in cusps_to_fill for i in range(n)])
 *         c_filled_tri = fill_cusps(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                   fill_cusp_spec, '', fill_all)
 *         free(fill_cusp_spec)
*/
  __pyx_t_16 = fill_cusps(__pyx_v_self->c_triangulation, __pyx_v_fill_cusp_spec, ((char *)""), __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1345, __pyx_L1_error)
  __pyx_v_c_filled_tri = __pyx_t_16;

  /* "cython/core/triangulation.pyx":1347
 *         c_filled_tri = fill_cusps(self.c_triangulation,
 *                                   fill_cusp_spec, '', fill_all)
 *         free(fill_cusp_spec)             # <<<<<<<<<<<<<<
 *         filled_tri = self.__class__('empty')
 *         filled_tri.set_c_triangulation(c_filled_tri)
*/
  free(__pyx_v_fill_cusp_spec);

  /* "cython/core/triangulation.pyx":1348
 *                                   fill_cusp_spec, '', fill_all)
 *         free(fill_cusp_spec)
 *         filled_tri = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         filled_tri.set_c_triangulation(c_filled_tri)
 *         filled_tri.set_name(self.name() + '_filled')
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(4, 1348, __pyx_L1_error)
  __pyx_v_filled_tri = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1349
 *         free(fill_cusp_spec)
 *         filled_tri = self.__class__('empty')
 *         filled_tri.set_c_triangulation(c_filled_tri)             # <<<<<<<<<<<<<<
 *         filled_tri.set_name(self.name() + '_filled')
 *         return filled_tri
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_filled_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_filled_tri, __pyx_v_c_filled_tri); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1350
 *         filled_tri = self.__class__('empty')
 *         filled_tri.set_c_triangulation(c_filled_tri)
 *         filled_tri.set_name(self.name() + '_filled')             # <<<<<<<<<<<<<<
 *         return filled_tri
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_filled_tri);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  __pyx_t_6 = PyNumber_Add(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_filled); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1351
 *         filled_tri.set_c_triangulation(c_filled_tri)
 *         filled_tri.set_name(self.name() + '_filled')
 *         return filled_tri             # <<<<<<<<<<<<<<
 * 
 *     def _unsimplified_filled_triangulation(self, method='fold'):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_filled_tri);
  __pyx_r = ((PyObject *)__pyx_v_filled_tri);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1303
 *         self._cache.clear(message='reverse_orientation')
 * 
 *     def filled_triangulation(             # <<<<<<<<<<<<<<
 *             self, cusps_to_fill='all') -> 'snappy.Triangulation':
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF((PyObject *)__pyx_v_filled_tri);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_fill_all);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_c);
  __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_c);
  __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_c);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_cusps_to_fill);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1353
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self, method='fold'):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_93_unsimplified_filled_triangulation(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_8SnapPyHP_13Triangulation_92_unsimplified_filled_triangulation, "\n        For a Triangulation that describes a closed manifold, returns\n        the unsimplified finite triangulation that the kernel builds.\n\n        >>> M = Triangulation('m004(1, 2)')\n        >>> F = M._unsimplified_filled_triangulation()\n        >>> F.num_tetrahedra(), F._num_fake_cusps()\n        (58, 7)\n\n        The default is to use the kernel's original fold method as\n        the final step to close off the cusp. Specifying\n        method='layered' uses a 1-tetrahedron solid torus instead.\n        For method='layered_and_marked', the core solid tori are marked\n        internally so that any calls to simplify/randomize will leave\n        these in place.\n\n        >>> M = Triangulation('m004(1, 2)')\n        >>> F = M._unsimplified_filled_triangulation(method='layered')\n        >>> F.num_tetrahedra(), F._num_fake_cusps()\n        (60, 7)\n        >>> F.simplify(); F.num_tetrahedra() < 15\n        True\n        >>> M = Triangulation('K8n1(1,0)')\n        >>> F = M._unsimplified_filled_triangulation(method='layered_and_marked')\n        >>> F.num_tetrahedra() > 2\n        True\n\n        You can determine which tets are the cores, and remove the\n        marks to allow unrestricted simplification.\n\n        >>> any(F._marked_tetrahedra(clear_marks=True))\n        True\n        >>> F.simplify()\n        >>> F.num_tetrahedra() <= 2\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_93_unsimplified_filled_triangulation = {"_unsimplified_filled_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_93_unsimplified_filled_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_92_unsimplified_filled_triangulation};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_93_unsimplified_filled_triangulation(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("_unsimplified_filled_triangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_method,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1353, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1353, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_unsimplified_filled_triangulation", 0) < 0) __PYX_ERR(4, 1353, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_fold));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1353, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_fold));
    }
    __pyx_v_method = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_unsimplified_filled_triangulation", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 1353, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._unsimplified_filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_92_unsimplified_filled_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_method);

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

/* "cython/core/triangulation.pyx":1393
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):             # <<<<<<<<<<<<<<
 *             raise IndexError('All cusps must be fillable.')
 *         cdef c_Triangulation* c_new_tri = NULL
*/

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_34_unsimplified_filled_triangulation_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct_2_genexpr *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 1393, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *) __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_8SnapPyHP_13Triangulation_34_unsimplified_filled_triangulation_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_unsimplified_filled_triangulati, __pyx_mstate_global->__pyx_n_u_SnapPyHP); if (unlikely(!gen)) __PYX_ERR(4, 1393, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPyHP.Triangulation._unsimplified_filled_triangulation.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_8SnapPyHP_13Triangulation_34_unsimplified_filled_triangulation_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___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;
  int __pyx_t_5;
  Boolean __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;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 1393, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(4, 1393, __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(4, 1393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1393, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1393, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1393, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1393, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1393, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(4, 1393, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_cur_scope->__pyx_v_c); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1393, __pyx_L1_error)
    __pyx_t_6 = cusp_is_fillable(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->c_triangulation, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1393, __pyx_L1_error)
    __pyx_t_7 = (!(__pyx_t_6 != 0));
    if (__pyx_t_7) {
      __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_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __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;
}

/* "cython/core/triangulation.pyx":1353
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self, method='fold'):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
*/

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_92_unsimplified_filled_triangulation(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_method) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *__pyx_cur_scope;
  PyObject *__pyx_v_n = NULL;
  Triangulation *__pyx_v_c_new_tri;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_filled_tri = 0;
  Boolean *__pyx_v_fill_cusp_spec;
  Boolean __pyx_v_fill_by_fold;
  int __pyx_v_mark_solid_tori;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_gb_8SnapPyHP_13Triangulation_34_unsimplified_filled_triangulation_2generator1 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  Triangulation *__pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unsimplified_filled_triangulation", 0);
  __pyx_cur_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 1353, __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);

  /* "cython/core/triangulation.pyx":1390
 *         True
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1391
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         n = self.num_cusps()
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1391, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1391, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1390
 *         True
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
*/
  }

  /* "cython/core/triangulation.pyx":1392
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()             # <<<<<<<<<<<<<<
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):
 *             raise IndexError('All cusps must be fillable.')
*/
  __pyx_t_4 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1393
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):             # <<<<<<<<<<<<<<
 *             raise IndexError('All cusps must be fillable.')
 *         cdef c_Triangulation* c_new_tri = NULL
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_3 = __pyx_builtin_range; 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_n};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __pyx_pf_8SnapPyHP_13Triangulation_34_unsimplified_filled_triangulation_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_1);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/triangulation.pyx":1394
 *         n = self.num_cusps()
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):
 *             raise IndexError('All cusps must be fillable.')             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_new_tri = NULL
 *         cdef Triangulation filled_tri
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_IndexError);
    __pyx_t_4 = __pyx_builtin_IndexError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_All_cusps_must_be_fillable};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1394, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1394, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1393
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):             # <<<<<<<<<<<<<<
 *             raise IndexError('All cusps must be fillable.')
 *         cdef c_Triangulation* c_new_tri = NULL
*/
  }

  /* "cython/core/triangulation.pyx":1395
 *         if not all(cusp_is_fillable(self.c_triangulation, c) for c in range(n)):
 *             raise IndexError('All cusps must be fillable.')
 *         cdef c_Triangulation* c_new_tri = NULL             # <<<<<<<<<<<<<<
 *         cdef Triangulation filled_tri
 *         cdef Boolean *fill_cusp_spec = NULL
*/
  __pyx_v_c_new_tri = NULL;

  /* "cython/core/triangulation.pyx":1397
 *         cdef c_Triangulation* c_new_tri = NULL
 *         cdef Triangulation filled_tri
 *         cdef Boolean *fill_cusp_spec = NULL             # <<<<<<<<<<<<<<
 *         cdef Boolean fill_by_fold
 *         if method == 'fold':
*/
  __pyx_v_fill_cusp_spec = NULL;

  /* "cython/core/triangulation.pyx":1399
 *         cdef Boolean *fill_cusp_spec = NULL
 *         cdef Boolean fill_by_fold
 *         if method == 'fold':             # <<<<<<<<<<<<<<
 *             fill_by_fold = True
 *         elif method == 'layered':
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_fold, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(4, 1399, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/triangulation.pyx":1400
 *         cdef Boolean fill_by_fold
 *         if method == 'fold':
 *             fill_by_fold = True             # <<<<<<<<<<<<<<
 *         elif method == 'layered':
 *             fill_by_fold = False
*/
    __pyx_v_fill_by_fold = 1;

    /* "cython/core/triangulation.pyx":1399
 *         cdef Boolean *fill_cusp_spec = NULL
 *         cdef Boolean fill_by_fold
 *         if method == 'fold':             # <<<<<<<<<<<<<<
 *             fill_by_fold = True
 *         elif method == 'layered':
*/
    goto __pyx_L5;
  }

  /* "cython/core/triangulation.pyx":1401
 *         if method == 'fold':
 *             fill_by_fold = True
 *         elif method == 'layered':             # <<<<<<<<<<<<<<
 *             fill_by_fold = False
 *             mark_solid_tori = False
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_layered, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(4, 1401, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/triangulation.pyx":1402
 *             fill_by_fold = True
 *         elif method == 'layered':
 *             fill_by_fold = False             # <<<<<<<<<<<<<<
 *             mark_solid_tori = False
 *         elif method == 'layered_and_marked':
*/
    __pyx_v_fill_by_fold = 0;

    /* "cython/core/triangulation.pyx":1403
 *         elif method == 'layered':
 *             fill_by_fold = False
 *             mark_solid_tori = False             # <<<<<<<<<<<<<<
 *         elif method == 'layered_and_marked':
 *             fill_by_fold = False
*/
    __pyx_v_mark_solid_tori = 0;

    /* "cython/core/triangulation.pyx":1401
 *         if method == 'fold':
 *             fill_by_fold = True
 *         elif method == 'layered':             # <<<<<<<<<<<<<<
 *             fill_by_fold = False
 *             mark_solid_tori = False
*/
    goto __pyx_L5;
  }

  /* "cython/core/triangulation.pyx":1404
 *             fill_by_fold = False
 *             mark_solid_tori = False
 *         elif method == 'layered_and_marked':             # <<<<<<<<<<<<<<
 *             fill_by_fold = False
 *             mark_solid_tori = True
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_layered_and_marked, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(4, 1404, __pyx_L1_error)
  if (likely(__pyx_t_6)) {

    /* "cython/core/triangulation.pyx":1405
 *             mark_solid_tori = False
 *         elif method == 'layered_and_marked':
 *             fill_by_fold = False             # <<<<<<<<<<<<<<
 *             mark_solid_tori = True
 *         else:
*/
    __pyx_v_fill_by_fold = 0;

    /* "cython/core/triangulation.pyx":1406
 *         elif method == 'layered_and_marked':
 *             fill_by_fold = False
 *             mark_solid_tori = True             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("The method must be 'fold' or 'layered' or 'layered_and_marked'")
*/
    __pyx_v_mark_solid_tori = 1;

    /* "cython/core/triangulation.pyx":1404
 *             fill_by_fold = False
 *             mark_solid_tori = False
 *         elif method == 'layered_and_marked':             # <<<<<<<<<<<<<<
 *             fill_by_fold = False
 *             mark_solid_tori = True
*/
    goto __pyx_L5;
  }

  /* "cython/core/triangulation.pyx":1408
 *             mark_solid_tori = True
 *         else:
 *             raise ValueError("The method must be 'fold' or 'layered' or 'layered_and_marked'")             # <<<<<<<<<<<<<<
 * 
 *         c_new_tri = subdivide(self.c_triangulation, to_byte_str(self.name() + '_filled'))
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_3 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_method_must_be_fold_or_layer};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1408, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "cython/core/triangulation.pyx":1410
 *             raise ValueError("The method must be 'fold' or 'layered' or 'layered_and_marked'")
 * 
 *         c_new_tri = subdivide(self.c_triangulation, to_byte_str(self.name() + '_filled'))             # <<<<<<<<<<<<<<
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 *         for i in range(n):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_filled); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(4, 1410, __pyx_L1_error)
  __pyx_t_10 = subdivide(__pyx_cur_scope->__pyx_v_self->c_triangulation, __pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_new_tri = __pyx_t_10;

  /* "cython/core/triangulation.pyx":1411
 * 
 *         c_new_tri = subdivide(self.c_triangulation, to_byte_str(self.name() + '_filled'))
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             fill_cusp_spec[i] = True
*/
  __pyx_t_2 = __Pyx_PyLong_FromSize_t((sizeof(Boolean))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_n, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1411, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_fill_cusp_spec = ((Boolean *)malloc(__pyx_t_5));

  /* "cython/core/triangulation.pyx":1412
 *         c_new_tri = subdivide(self.c_triangulation, to_byte_str(self.name() + '_filled'))
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             fill_cusp_spec[i] = True
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_8 = __pyx_builtin_range; 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_n};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1412, __pyx_L1_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_11 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 1412, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1412, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_11);
        ++__pyx_t_11;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1412, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11);
        #endif
        ++__pyx_t_11;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1412, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_12(__pyx_t_8);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1412, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1413
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 *         for i in range(n):
 *             fill_cusp_spec[i] = True             # <<<<<<<<<<<<<<
 * 
 *         close_cusps(c_new_tri, fill_cusp_spec, fill_by_fold, mark_solid_tori)
*/
    __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1413, __pyx_L1_error)
    (__pyx_v_fill_cusp_spec[__pyx_t_13]) = 1;

    /* "cython/core/triangulation.pyx":1412
 *         c_new_tri = subdivide(self.c_triangulation, to_byte_str(self.name() + '_filled'))
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             fill_cusp_spec[i] = True
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/triangulation.pyx":1415
 *             fill_cusp_spec[i] = True
 * 
 *         close_cusps(c_new_tri, fill_cusp_spec, fill_by_fold, mark_solid_tori)             # <<<<<<<<<<<<<<
 *         number_the_tetrahedra(c_new_tri)
 *         number_the_edge_classes(c_new_tri)
*/
  close_cusps(__pyx_v_c_new_tri, __pyx_v_fill_cusp_spec, __pyx_v_fill_by_fold, __pyx_v_mark_solid_tori);

  /* "cython/core/triangulation.pyx":1416
 * 
 *         close_cusps(c_new_tri, fill_cusp_spec, fill_by_fold, mark_solid_tori)
 *         number_the_tetrahedra(c_new_tri)             # <<<<<<<<<<<<<<
 *         number_the_edge_classes(c_new_tri)
 *         create_fake_cusps(c_new_tri)
*/
  number_the_tetrahedra(__pyx_v_c_new_tri);

  /* "cython/core/triangulation.pyx":1417
 *         close_cusps(c_new_tri, fill_cusp_spec, fill_by_fold, mark_solid_tori)
 *         number_the_tetrahedra(c_new_tri)
 *         number_the_edge_classes(c_new_tri)             # <<<<<<<<<<<<<<
 *         create_fake_cusps(c_new_tri)
 *         count_cusps(c_new_tri)
*/
  number_the_edge_classes(__pyx_v_c_new_tri);

  /* "cython/core/triangulation.pyx":1418
 *         number_the_tetrahedra(c_new_tri)
 *         number_the_edge_classes(c_new_tri)
 *         create_fake_cusps(c_new_tri)             # <<<<<<<<<<<<<<
 *         count_cusps(c_new_tri)
 *         filled_tri = _triangulation_class('empty')
*/
  create_fake_cusps(__pyx_v_c_new_tri);

  /* "cython/core/triangulation.pyx":1419
 *         number_the_edge_classes(c_new_tri)
 *         create_fake_cusps(c_new_tri)
 *         count_cusps(c_new_tri)             # <<<<<<<<<<<<<<
 *         filled_tri = _triangulation_class('empty')
 *         filled_tri.set_c_triangulation(c_new_tri)
*/
  count_cusps(__pyx_v_c_new_tri);

  /* "cython/core/triangulation.pyx":1420
 *         create_fake_cusps(c_new_tri)
 *         count_cusps(c_new_tri)
 *         filled_tri = _triangulation_class('empty')             # <<<<<<<<<<<<<<
 *         filled_tri.set_c_triangulation(c_new_tri)
 *         free(fill_cusp_spec)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_triangulation_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(4, 1420, __pyx_L1_error)
  __pyx_v_filled_tri = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "cython/core/triangulation.pyx":1421
 *         count_cusps(c_new_tri)
 *         filled_tri = _triangulation_class('empty')
 *         filled_tri.set_c_triangulation(c_new_tri)             # <<<<<<<<<<<<<<
 *         free(fill_cusp_spec)
 *         return filled_tri
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_filled_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_filled_tri, __pyx_v_c_new_tri); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/triangulation.pyx":1422
 *         filled_tri = _triangulation_class('empty')
 *         filled_tri.set_c_triangulation(c_new_tri)
 *         free(fill_cusp_spec)             # <<<<<<<<<<<<<<
 *         return filled_tri
 * 
*/
  free(__pyx_v_fill_cusp_spec);

  /* "cython/core/triangulation.pyx":1423
 *         filled_tri.set_c_triangulation(c_new_tri)
 *         free(fill_cusp_spec)
 *         return filled_tri             # <<<<<<<<<<<<<<
 * 
 *     def _marked_tetrahedra(self, clear_marks=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_filled_tri);
  __pyx_r = ((PyObject *)__pyx_v_filled_tri);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1353
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self, method='fold'):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._unsimplified_filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF((PyObject *)__pyx_v_filled_tri);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_gb_8SnapPyHP_13Triangulation_34_unsimplified_filled_triangulation_2generator1);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1425
 *         return filled_tri
 * 
 *     def _marked_tetrahedra(self, clear_marks=False):             # <<<<<<<<<<<<<<
 *         cdef int *marked = NULL
 *         n = self.num_tetrahedra()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_95_marked_tetrahedra(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_95_marked_tetrahedra = {"_marked_tetrahedra", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_95_marked_tetrahedra, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_95_marked_tetrahedra(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_clear_marks = 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("_marked_tetrahedra (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_clear_marks,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1425, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1425, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_marked_tetrahedra", 0) < 0) __PYX_ERR(4, 1425, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1425, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_clear_marks = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_marked_tetrahedra", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 1425, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._marked_tetrahedra", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_94_marked_tetrahedra(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_clear_marks);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_94_marked_tetrahedra(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_clear_marks) {
  int *__pyx_v_marked;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_9genexpr25__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_marked_tetrahedra", 0);

  /* "cython/core/triangulation.pyx":1426
 * 
 *     def _marked_tetrahedra(self, clear_marks=False):
 *         cdef int *marked = NULL             # <<<<<<<<<<<<<<
 *         n = self.num_tetrahedra()
 *         marked = <int*>malloc(n*sizeof(int))
*/
  __pyx_v_marked = NULL;

  /* "cython/core/triangulation.pyx":1427
 *     def _marked_tetrahedra(self, clear_marks=False):
 *         cdef int *marked = NULL
 *         n = self.num_tetrahedra()             # <<<<<<<<<<<<<<
 *         marked = <int*>malloc(n*sizeof(int))
 *         unchangeable_tetrahedra(self.c_triangulation, marked)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":1428
 *         cdef int *marked = NULL
 *         n = self.num_tetrahedra()
 *         marked = <int*>malloc(n*sizeof(int))             # <<<<<<<<<<<<<<
 *         unchangeable_tetrahedra(self.c_triangulation, marked)
 *         ans = [marked[i] for i in range(n)]
*/
  __pyx_t_1 = __Pyx_PyLong_FromSize_t((sizeof(int))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyLong_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_marked = ((int *)malloc(__pyx_t_3));

  /* "cython/core/triangulation.pyx":1429
 *         n = self.num_tetrahedra()
 *         marked = <int*>malloc(n*sizeof(int))
 *         unchangeable_tetrahedra(self.c_triangulation, marked)             # <<<<<<<<<<<<<<
 *         ans = [marked[i] for i in range(n)]
 *         free(marked)
*/
  unchangeable_tetrahedra(__pyx_v_self->c_triangulation, __pyx_v_marked); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1429, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1430
 *         marked = <int*>malloc(n*sizeof(int))
 *         unchangeable_tetrahedra(self.c_triangulation, marked)
 *         ans = [marked[i] for i in range(n)]             # <<<<<<<<<<<<<<
 *         free(marked)
 *         if clear_marks:
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1430, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_5 = __pyx_builtin_range; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_n};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1430, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1430, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1430, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1430, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1430, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6));
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1430, __pyx_L5_error)
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1430, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_i, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_9genexpr25__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1430, __pyx_L5_error)
      __pyx_t_1 = __Pyx_PyLong_From_int((__pyx_v_marked[__pyx_t_8])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1430, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(4, 1430, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_i); __pyx_9genexpr25__pyx_v_i = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_i); __pyx_9genexpr25__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_ans = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1431
 *         unchangeable_tetrahedra(self.c_triangulation, marked)
 *         ans = [marked[i] for i in range(n)]
 *         free(marked)             # <<<<<<<<<<<<<<
 *         if clear_marks:
 *             all_tetrahedra_changeable(self.c_triangulation)
*/
  free(__pyx_v_marked);

  /* "cython/core/triangulation.pyx":1432
 *         ans = [marked[i] for i in range(n)]
 *         free(marked)
 *         if clear_marks:             # <<<<<<<<<<<<<<
 *             all_tetrahedra_changeable(self.c_triangulation)
 *         return ans
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_clear_marks); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(4, 1432, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "cython/core/triangulation.pyx":1433
 *         free(marked)
 *         if clear_marks:
 *             all_tetrahedra_changeable(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         return ans
 * 
*/
    all_tetrahedra_changeable(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1433, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1432
 *         ans = [marked[i] for i in range(n)]
 *         free(marked)
 *         if clear_marks:             # <<<<<<<<<<<<<<
 *             all_tetrahedra_changeable(self.c_triangulation)
 *         return ans
*/
  }

  /* "cython/core/triangulation.pyx":1434
 *         if clear_marks:
 *             all_tetrahedra_changeable(self.c_triangulation)
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def edge_valences(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1425
 *         return filled_tri
 * 
 *     def _marked_tetrahedra(self, clear_marks=False):             # <<<<<<<<<<<<<<
 *         cdef int *marked = NULL
 *         n = self.num_tetrahedra()
*/

  /* 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_AddTraceback("SnapPyHP.Triangulation._marked_tetrahedra", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1436
 *         return ans
 * 
 *     def edge_valences(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary whose keys are the valences of the edges
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_97edge_valences(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_8SnapPyHP_13Triangulation_96edge_valences, "\n        Returns a dictionary whose keys are the valences of the edges\n        in the triangulation, and the value associated to a key is the\n        number of edges of that valence.\n\n        >>> M = Triangulation('v3227')\n        >>> M.edge_valences()     # doctest: +SKIP\n        {10: 1, 4: 1, 5: 2, 6: 3}\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_97edge_valences = {"edge_valences", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_97edge_valences, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_96edge_valences};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_97edge_valences(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("edge_valences (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("edge_valences", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("edge_valences", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_96edge_valences(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_96edge_valences(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  int __pyx_v_c;
  int __pyx_v_v;
  PyObject *__pyx_v_ans = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("edge_valences", 0);

  /* "cython/core/triangulation.pyx":1446
 *         {10: 1, 4: 1, 5: 2, 6: 3}
 *         """
 *         cdef int c, v = 1             # <<<<<<<<<<<<<<
 *         ans = {}
 *         if self.c_triangulation is NULL:
*/
  __pyx_v_v = 1;

  /* "cython/core/triangulation.pyx":1447
 *         """
 *         cdef int c, v = 1
 *         ans = {}             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ans = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":1448
 *         cdef int c, v = 1
 *         ans = {}
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         while get_num_edge_classes(self.c_triangulation, v, 1) > 0:
*/
  __pyx_t_2 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/triangulation.pyx":1449
 *         ans = {}
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         while get_num_edge_classes(self.c_triangulation, v, 1) > 0:
 *             c = get_num_edge_classes(self.c_triangulation, v, 0)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1449, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1448
 *         cdef int c, v = 1
 *         ans = {}
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         while get_num_edge_classes(self.c_triangulation, v, 1) > 0:
*/
  }

  /* "cython/core/triangulation.pyx":1450
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         while get_num_edge_classes(self.c_triangulation, v, 1) > 0:             # <<<<<<<<<<<<<<
 *             c = get_num_edge_classes(self.c_triangulation, v, 0)
 *             if c > 0:
*/
  while (1) {
    __pyx_t_6 = get_num_edge_classes(__pyx_v_self->c_triangulation, __pyx_v_v, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1450, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_6 > 0);
    if (!__pyx_t_2) break;

    /* "cython/core/triangulation.pyx":1451
 *             raise ValueError('The Triangulation is empty.')
 *         while get_num_edge_classes(self.c_triangulation, v, 1) > 0:
 *             c = get_num_edge_classes(self.c_triangulation, v, 0)             # <<<<<<<<<<<<<<
 *             if c > 0:
 *                 ans[v] = c
*/
    __pyx_t_6 = get_num_edge_classes(__pyx_v_self->c_triangulation, __pyx_v_v, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1451, __pyx_L1_error)
    __pyx_v_c = __pyx_t_6;

    /* "cython/core/triangulation.pyx":1452
 *         while get_num_edge_classes(self.c_triangulation, v, 1) > 0:
 *             c = get_num_edge_classes(self.c_triangulation, v, 0)
 *             if c > 0:             # <<<<<<<<<<<<<<
 *                 ans[v] = c
 *             v += 1
*/
    __pyx_t_2 = (__pyx_v_c > 0);
    if (__pyx_t_2) {

      /* "cython/core/triangulation.pyx":1453
 *             c = get_num_edge_classes(self.c_triangulation, v, 0)
 *             if c > 0:
 *                 ans[v] = c             # <<<<<<<<<<<<<<
 *             v += 1
 *         return ans
*/
      __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely((PyDict_SetItem(__pyx_v_ans, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(4, 1453, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/triangulation.pyx":1452
 *         while get_num_edge_classes(self.c_triangulation, v, 1) > 0:
 *             c = get_num_edge_classes(self.c_triangulation, v, 0)
 *             if c > 0:             # <<<<<<<<<<<<<<
 *                 ans[v] = c
 *             v += 1
*/
    }

    /* "cython/core/triangulation.pyx":1454
 *             if c > 0:
 *                 ans[v] = c
 *             v += 1             # <<<<<<<<<<<<<<
 *         return ans
 * 
*/
    __pyx_v_v = (__pyx_v_v + 1);
  }

  /* "cython/core/triangulation.pyx":1455
 *                 ans[v] = c
 *             v += 1
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def gluing_equations_pgl(self, N =2, equation_type='all'):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1436
 *         return ans
 * 
 *     def edge_valences(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary whose keys are the valences of the edges
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.edge_valences", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1457
 *         return ans
 * 
 *     def gluing_equations_pgl(self, N =2, equation_type='all'):             # <<<<<<<<<<<<<<
 * 
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_99gluing_equations_pgl(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_8SnapPyHP_13Triangulation_98gluing_equations_pgl, "\n        Returns a NeumannZagierTypeEquations object that contains a matrix\n        encoding the gluing equations for boundary-parabolic PGL(N,C)\n        representations together with explanations of the meaning\n        of the rows and the columns of the matrix.\n\n        This method generalizes gluing_equations() to PGL(N,C)-representations\n        as described in\n        Stavros Garoufalidis, Matthias Goerner, Christian K. Zickert:\n        \"Gluing Equations for PGL(n,C)-Representations of 3-Manifolds\"\n        (http://arxiv.org/abs/1207.6711).\n\n        The result of the :meth:`gluing_equations` can be obtained from\n        the general method by:\n\n        >>> M = Triangulation('m004')\n        >>> M.gluing_equations_pgl().matrix\n        [ 2  1  0  1  0  2]\n        [ 0  1  2  1  2  0]\n        [ 1  0  0  0 -1  0]\n        [ 0  0  0  0 -2  2]\n\n        But besides the matrix, the method also returns explanations of\n        the columns and rows:\n\n        >>> M = Triangulation(\"m004\")\n        >>> M.gluing_equations_pgl()\n        NeumannZagierTypeEquations(\n          [ 2  1  0  1  0  2]\n          [ 0  1  2  1  2  0]\n          [ 1  0  0  0 -1  0]\n          [ 0  0  0  0 -2  2],\n          explain_columns = ['z_0000_0', 'zp_0000_0', 'zpp_0000_0', 'z_0000_1', 'zp_0000_1', 'zpp_0000_1'],\n          explain_rows = ['edge_0_0', 'edge_0_1', 'meridian_0_0', 'longitude_0_0'])\n\n        The first row of the matrix means that the edge equation for\n        edge 0 is\n\n        .. math::\n\n           {z_{0000,0}}^2 * z'_{0000,0} * z_{0000,1} * {z''_{0000,1}}^2 = 1.\n\n        Similarly, the next row encodes the edge equation for the other edge\n        and the next two rows encode peripheral equations.\n\n        Following the SnapPy convention, a ``z`` denotes the cross ratio\n        :math:`z` at the edge (0,1), a ``zp`` the cross ratio :math:`z'` at\n        the edge (0,2) and a ``zpp`` the cross\n        ratio :math:`z''` at the edge (1,2). The ent""ire symbol ``z_xxxx_y`` then\n        denotes the cross ratio belonging to the subsimplex at integral\n        point ``xxxx`` (always ``0000`` for ``N = 2``) of the simplex ``y``.\n\n        Note: the SnapPy convention is different from the paper\n        mentioned above, e.g., compare\n        kernel_code/edge_classes.c with Figure 3. We follow the SnapPy\n        convention here so that all computations done in SnapPy are\n        consistent.\n\n        The explanations of the rows and columns can be obtained explicitly by:\n\n        >>> M.gluing_equations_pgl(N = 3, equation_type = 'peripheral').explain_rows\n        ['meridian_0_0', 'meridian_1_0', 'longitude_0_0', 'longitude_1_0']\n        >>> M.gluing_equations_pgl(N = 2).explain_columns\n        ['z_0000_0', 'zp_0000_0', 'zpp_0000_0', 'z_0000_1', 'zp_0000_1', 'zpp_0000_1']\n\n        A subset of all gluing equations can be obtained by setting the\n        ``equation_type``:\n\n        * all gluing equations: ``all``\n        * non-peripheral equations: ``non_peripheral``\n\n          * edge gluing equations: ``edge``\n          * face gluing equations: ``face``\n          * internal gluing equations: ``internal``\n\n        * cusp gluing equations: ``peripheral``\n\n          * cusp gluing equations for meridians: ``meridian``\n          * cusp gluing equations for longitudes: ``longitude``\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_99gluing_equations_pgl = {"gluing_equations_pgl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_99gluing_equations_pgl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_98gluing_equations_pgl};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_99gluing_equations_pgl(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_N = 0;
  PyObject *__pyx_v_equation_type = 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("gluing_equations_pgl (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_N,&__pyx_mstate_global->__pyx_n_u_equation_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1457, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gluing_equations_pgl", 0) < 0) __PYX_ERR(4, 1457, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    }
    __pyx_v_N = values[0];
    __pyx_v_equation_type = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("gluing_equations_pgl", 0, 0, 2, __pyx_nargs); __PYX_ERR(4, 1457, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.gluing_equations_pgl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_98gluing_equations_pgl(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_N, __pyx_v_equation_type);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_98gluing_equations_pgl(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_equation_type) {
  Integer_matrix_with_explanations __pyx_v_c_matrix;
  PyObject *__pyx_v_equations = NULL;
  PyObject *__pyx_v_explain_rows = NULL;
  PyObject *__pyx_v_explain_cols = NULL;
  PyObject *__pyx_v_eqns = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_cusp_info = NULL;
  PyObject *__pyx_v_to_do = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_9genexpr26__pyx_v_j = NULL;
  PyObject *__pyx_9genexpr27__pyx_v_j = NULL;
  PyObject *__pyx_9genexpr28__pyx_v_j = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16[4];
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gluing_equations_pgl", 0);

  /* "cython/core/triangulation.pyx":1542
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if N < 2 or N > 15:             # <<<<<<<<<<<<<<
 *             raise ValueError('N has to be 2...15')
 * 
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_N, __pyx_mstate_global->__pyx_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1542, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_N, __pyx_mstate_global->__pyx_int_15, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1542, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1543
 * 
 *         if N < 2 or N > 15:
 *             raise ValueError('N has to be 2...15')             # <<<<<<<<<<<<<<
 * 
 *         if equation_type not in ['all',
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_N_has_to_be_2_15};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1543, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1542
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if N < 2 or N > 15:             # <<<<<<<<<<<<<<
 *             raise ValueError('N has to be 2...15')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1545
 *             raise ValueError('N has to be 2...15')
 * 
 *         if equation_type not in ['all',             # <<<<<<<<<<<<<<
 *                                  'non_peripheral',
 *                                  'edge', 'face', 'internal',
*/
  __Pyx_INCREF(__pyx_v_equation_type);
  __pyx_t_2 = __pyx_v_equation_type;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_non_peripheral, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_edge, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_face, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_internal, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_peripheral, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_longitude, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_meridian, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1545, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_1;
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":1550
 *                                  'peripheral',
 *                                  'longitude', 'meridian']:
 *             raise ValueError('Wrong equation_type')             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL:
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Wrong_equation_type};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1550, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1545
 *             raise ValueError('N has to be 2...15')
 * 
 *         if equation_type not in ['all',             # <<<<<<<<<<<<<<
 *                                  'non_peripheral',
 *                                  'edge', 'face', 'internal',
*/
  }

  /* "cython/core/triangulation.pyx":1552
 *             raise ValueError('Wrong equation_type')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_3 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":1553
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         equations = []
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1553, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1552
 *             raise ValueError('Wrong equation_type')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1555
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         equations = []             # <<<<<<<<<<<<<<
 *         explain_rows = []
 *         explain_cols = []
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_equations = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1556
 * 
 *         equations = []
 *         explain_rows = []             # <<<<<<<<<<<<<<
 *         explain_cols = []
 * 
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_rows = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1557
 *         equations = []
 *         explain_rows = []
 *         explain_cols = []             # <<<<<<<<<<<<<<
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'edge']:
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_cols = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1559
 *         explain_cols = []
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'edge']:             # <<<<<<<<<<<<<<
 * 
 *             # Add edge equations
*/
  __Pyx_INCREF(__pyx_v_equation_type);
  __pyx_t_2 = __pyx_v_equation_type;
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1559, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_non_peripheral, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1559, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_edge, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1559, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_1;
  __pyx_L17_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1563
 *             # Add edge equations
 *             get_edge_gluing_equations_pgl(self.c_triangulation,
 *                                           &c_matrix, N)             # <<<<<<<<<<<<<<
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns
*/
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1563, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1562
 * 
 *             # Add edge equations
 *             get_edge_gluing_equations_pgl(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                           &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
*/
    get_edge_gluing_equations_pgl(__pyx_v_self->c_triangulation, (&__pyx_v_c_matrix), __pyx_t_7);

    /* "cython/core/triangulation.pyx":1564
 *             get_edge_gluing_equations_pgl(self.c_triangulation,
 *                                           &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)             # <<<<<<<<<<<<<<
 *             equations += eqns
 *             explain_rows += r
*/
    __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1564, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 1564, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1564, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1564, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1564, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1564, __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_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(4, 1564, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L21_unpacking_done;
      __pyx_L20_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1564, __pyx_L1_error)
      __pyx_L21_unpacking_done:;
    }
    __pyx_v_eqns = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "cython/core/triangulation.pyx":1565
 *                                           &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns             # <<<<<<<<<<<<<<
 *             explain_rows += r
 * 
*/
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_equations, __pyx_v_eqns); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_equations, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1566
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns
 *             explain_rows += r             # <<<<<<<<<<<<<<
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'face']:
*/
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1559
 *         explain_cols = []
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'edge']:             # <<<<<<<<<<<<<<
 * 
 *             # Add edge equations
*/
  }

  /* "cython/core/triangulation.pyx":1568
 *             explain_rows += r
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'face']:             # <<<<<<<<<<<<<<
 * 
 *             # Add face equations
*/
  __Pyx_INCREF(__pyx_v_equation_type);
  __pyx_t_2 = __pyx_v_equation_type;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1568, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_non_peripheral, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1568, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_face, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1568, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L23_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_1;
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":1572
 *             # Add face equations
 *             get_face_gluing_equations_pgl(self.c_triangulation,
 *                                           &c_matrix, N)             # <<<<<<<<<<<<<<
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns
*/
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1572, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1571
 * 
 *             # Add face equations
 *             get_face_gluing_equations_pgl(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                           &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
*/
    get_face_gluing_equations_pgl(__pyx_v_self->c_triangulation, (&__pyx_v_c_matrix), __pyx_t_7);

    /* "cython/core/triangulation.pyx":1573
 *             get_face_gluing_equations_pgl(self.c_triangulation,
 *                                           &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)             # <<<<<<<<<<<<<<
 *             equations += eqns
 *             explain_rows += r
*/
    __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1573, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 1573, __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_INCREF(__pyx_t_8);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1573, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1573, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1573, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(4, 1573, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L27_unpacking_done;
      __pyx_L26_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1573, __pyx_L1_error)
      __pyx_L27_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_eqns, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":1574
 *                                           &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns             # <<<<<<<<<<<<<<
 *             explain_rows += r
 * 
*/
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_equations, __pyx_v_eqns); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_equations, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1575
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns
 *             explain_rows += r             # <<<<<<<<<<<<<<
 * 
 *         if equation_type in [ 'all', 'non_peripheral',  'internal']:
*/
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1568
 *             explain_rows += r
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'face']:             # <<<<<<<<<<<<<<
 * 
 *             # Add face equations
*/
  }

  /* "cython/core/triangulation.pyx":1577
 *             explain_rows += r
 * 
 *         if equation_type in [ 'all', 'non_peripheral',  'internal']:             # <<<<<<<<<<<<<<
 * 
 *             # Add internal equations
*/
  __Pyx_INCREF(__pyx_v_equation_type);
  __pyx_t_2 = __pyx_v_equation_type;
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1577, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L29_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_non_peripheral, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1577, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L29_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_internal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1577, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_1;
  __pyx_L29_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1581
 *             # Add internal equations
 *             get_internal_gluing_equations_pgl(self.c_triangulation,
 *                                               &c_matrix, N)             # <<<<<<<<<<<<<<
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns
*/
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1581, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1580
 * 
 *             # Add internal equations
 *             get_internal_gluing_equations_pgl(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                               &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
*/
    get_internal_gluing_equations_pgl(__pyx_v_self->c_triangulation, (&__pyx_v_c_matrix), __pyx_t_7);

    /* "cython/core/triangulation.pyx":1582
 *             get_internal_gluing_equations_pgl(self.c_triangulation,
 *                                               &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)             # <<<<<<<<<<<<<<
 *             equations += eqns
 *             explain_rows += r
*/
    __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1582, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 1582, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1582, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1582, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1582, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1582, __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_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(4, 1582, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L33_unpacking_done;
      __pyx_L32_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1582, __pyx_L1_error)
      __pyx_L33_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_eqns, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "cython/core/triangulation.pyx":1583
 *                                               &c_matrix, N)
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns             # <<<<<<<<<<<<<<
 *             explain_rows += r
 * 
*/
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_equations, __pyx_v_eqns); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_equations, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1584
 *             eqns, r, explain_cols = convert_and_free_integer_matrix(c_matrix)
 *             equations += eqns
 *             explain_rows += r             # <<<<<<<<<<<<<<
 * 
 *         if equation_type in ['all', 'peripheral', 'longitude', 'meridian']:
*/
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1577
 *             explain_rows += r
 * 
 *         if equation_type in [ 'all', 'non_peripheral',  'internal']:             # <<<<<<<<<<<<<<
 * 
 *             # Add internal equations
*/
  }

  /* "cython/core/triangulation.pyx":1586
 *             explain_rows += r
 * 
 *         if equation_type in ['all', 'peripheral', 'longitude', 'meridian']:             # <<<<<<<<<<<<<<
 * 
 *             # Add peripheral equations
*/
  __Pyx_INCREF(__pyx_v_equation_type);
  __pyx_t_2 = __pyx_v_equation_type;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1586, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L35_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_peripheral, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1586, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L35_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_longitude, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1586, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L35_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_meridian, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1586, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L35_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_1;
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":1590
 *             # Add peripheral equations
 * 
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 cusp_info = self.cusp_info(i)
 * 
*/
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_4 = __pyx_builtin_range; 
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 1590, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1590, __pyx_L1_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_11);
          ++__pyx_t_11;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1590, __pyx_L1_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11);
          #endif
          ++__pyx_t_11;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1590, __pyx_L1_error)
      } else {
        __pyx_t_2 = __pyx_t_12(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1590, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":1591
 * 
 *             for i in range(self.num_cusps()):
 *                 cusp_info = self.cusp_info(i)             # <<<<<<<<<<<<<<
 * 
 *                 to_do = []
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_i};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_cusp_info, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":1593
 *                 cusp_info = self.cusp_info(i)
 * 
 *                 to_do = []             # <<<<<<<<<<<<<<
 *                 # keep a todo list where we add (meridian, longitude)
 *                 # pairs to process later
*/
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":1597
 *                 # pairs to process later
 * 
 *                 if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 * 
 *                     # Add meridians for complete cusps
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_mstate_global->__pyx_n_u_is_complete); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1597, __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(4, 1597, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_3) {

        /* "cython/core/triangulation.pyx":1600
 * 
 *                     # Add meridians for complete cusps
 *                     if equation_type in [ 'meridian', 'peripheral', 'all']:             # <<<<<<<<<<<<<<
 *                         to_do += [ (1,0) ]
 *                         explain_rows += [
*/
        __Pyx_INCREF(__pyx_v_equation_type);
        __pyx_t_2 = __pyx_v_equation_type;
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_meridian, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1600, __pyx_L1_error)
        if (!__pyx_t_1) {
        } else {
          __pyx_t_3 = __pyx_t_1;
          goto __pyx_L43_bool_binop_done;
        }
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_peripheral, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1600, __pyx_L1_error)
        if (!__pyx_t_1) {
        } else {
          __pyx_t_3 = __pyx_t_1;
          goto __pyx_L43_bool_binop_done;
        }
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1600, __pyx_L1_error)
        __pyx_t_3 = __pyx_t_1;
        __pyx_L43_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_1 = __pyx_t_3;
        if (__pyx_t_1) {

          /* "cython/core/triangulation.pyx":1601
 *                     # Add meridians for complete cusps
 *                     if equation_type in [ 'meridian', 'peripheral', 'all']:
 *                         to_do += [ (1,0) ]             # <<<<<<<<<<<<<<
 *                         explain_rows += [
 *                             "meridian_%d_%d" % (j, i) for j in range(N-1) ]
*/
          __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1601, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[5]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_tuple[5]) != (0)) __PYX_ERR(4, 1601, __pyx_L1_error);
          __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_to_do, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1601, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_5));
          __pyx_t_5 = 0;

          /* "cython/core/triangulation.pyx":1602
 *                     if equation_type in [ 'meridian', 'peripheral', 'all']:
 *                         to_do += [ (1,0) ]
 *                         explain_rows += [             # <<<<<<<<<<<<<<
 *                             "meridian_%d_%d" % (j, i) for j in range(N-1) ]
 * 
*/
          { /* enter inner scope */
            __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1602, __pyx_L48_error)
            __Pyx_GOTREF(__pyx_t_5);

            /* "cython/core/triangulation.pyx":1603
 *                         to_do += [ (1,0) ]
 *                         explain_rows += [
 *                             "meridian_%d_%d" % (j, i) for j in range(N-1) ]             # <<<<<<<<<<<<<<
 * 
 *                     # Add longitudes for complete cusps
*/
            __pyx_t_8 = NULL;
            __Pyx_INCREF(__pyx_builtin_range);
            __pyx_t_9 = __pyx_builtin_range; 
            __pyx_t_13 = __Pyx_PyLong_SubtractObjC(__pyx_v_N, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1603, __pyx_L48_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_6 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_13};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1603, __pyx_L48_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
              __pyx_t_9 = __pyx_t_2; __Pyx_INCREF(__pyx_t_9);
              __pyx_t_14 = 0;
              __pyx_t_15 = NULL;
            } else {
              __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1603, __pyx_L48_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1603, __pyx_L48_error)
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            for (;;) {
              if (likely(!__pyx_t_15)) {
                if (likely(PyList_CheckExact(__pyx_t_9))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1603, __pyx_L48_error)
                    #endif
                    if (__pyx_t_14 >= __pyx_temp) break;
                  }
                  __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_14);
                  ++__pyx_t_14;
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1603, __pyx_L48_error)
                    #endif
                    if (__pyx_t_14 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_14));
                  #else
                  __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_14);
                  #endif
                  ++__pyx_t_14;
                }
                if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1603, __pyx_L48_error)
              } else {
                __pyx_t_2 = __pyx_t_15(__pyx_t_9);
                if (unlikely(!__pyx_t_2)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1603, __pyx_L48_error)
                    PyErr_Clear();
                  }
                  break;
                }
              }
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_j, __pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_9genexpr26__pyx_v_j), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1603, __pyx_L48_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_i), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1603, __pyx_L48_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_16[0] = __pyx_mstate_global->__pyx_n_u_meridian_2;
              __pyx_t_16[1] = __pyx_t_2;
              __pyx_t_16[2] = __pyx_mstate_global->__pyx_n_u__21;
              __pyx_t_16[3] = __pyx_t_13;
              __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_16, 4, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
              if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1603, __pyx_L48_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(4, 1602, __pyx_L48_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            }
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_j); __pyx_9genexpr26__pyx_v_j = 0;
            goto __pyx_L52_exit_scope;
            __pyx_L48_error:;
            __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_j); __pyx_9genexpr26__pyx_v_j = 0;
            goto __pyx_L1_error;
            __pyx_L52_exit_scope:;
          } /* exit inner scope */

          /* "cython/core/triangulation.pyx":1602
 *                     if equation_type in [ 'meridian', 'peripheral', 'all']:
 *                         to_do += [ (1,0) ]
 *                         explain_rows += [             # <<<<<<<<<<<<<<
 *                             "meridian_%d_%d" % (j, i) for j in range(N-1) ]
 * 
*/
          __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1602, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_9);
          __pyx_t_9 = 0;

          /* "cython/core/triangulation.pyx":1600
 * 
 *                     # Add meridians for complete cusps
 *                     if equation_type in [ 'meridian', 'peripheral', 'all']:             # <<<<<<<<<<<<<<
 *                         to_do += [ (1,0) ]
 *                         explain_rows += [
*/
        }

        /* "cython/core/triangulation.pyx":1606
 * 
 *                     # Add longitudes for complete cusps
 *                     if equation_type in [ 'longitude', 'peripheral', 'all']:             # <<<<<<<<<<<<<<
 *                         to_do += [ (0,1) ]
 *                         explain_rows += [
*/
        __Pyx_INCREF(__pyx_v_equation_type);
        __pyx_t_9 = __pyx_v_equation_type;
        __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_longitude, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1606, __pyx_L1_error)
        if (!__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_peripheral, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1606, __pyx_L1_error)
        if (!__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_all, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1606, __pyx_L1_error)
        __pyx_t_1 = __pyx_t_3;
        __pyx_L54_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_3 = __pyx_t_1;
        if (__pyx_t_3) {

          /* "cython/core/triangulation.pyx":1607
 *                     # Add longitudes for complete cusps
 *                     if equation_type in [ 'longitude', 'peripheral', 'all']:
 *                         to_do += [ (0,1) ]             # <<<<<<<<<<<<<<
 *                         explain_rows += [
 *                             "longitude_%d_%d" % (j, i) for j in range(N-1) ]
*/
          __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1607, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[4]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_mstate_global->__pyx_tuple[4]) != (0)) __PYX_ERR(4, 1607, __pyx_L1_error);
          __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_to_do, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1607, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_5));
          __pyx_t_5 = 0;

          /* "cython/core/triangulation.pyx":1608
 *                     if equation_type in [ 'longitude', 'peripheral', 'all']:
 *                         to_do += [ (0,1) ]
 *                         explain_rows += [             # <<<<<<<<<<<<<<
 *                             "longitude_%d_%d" % (j, i) for j in range(N-1) ]
 * 
*/
          { /* enter inner scope */
            __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1608, __pyx_L59_error)
            __Pyx_GOTREF(__pyx_t_5);

            /* "cython/core/triangulation.pyx":1609
 *                         to_do += [ (0,1) ]
 *                         explain_rows += [
 *                             "longitude_%d_%d" % (j, i) for j in range(N-1) ]             # <<<<<<<<<<<<<<
 * 
 *                 else:
*/
            __pyx_t_8 = NULL;
            __Pyx_INCREF(__pyx_builtin_range);
            __pyx_t_13 = __pyx_builtin_range; 
            __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_N, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1609, __pyx_L59_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_6 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2};
              __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1609, __pyx_L59_error)
              __Pyx_GOTREF(__pyx_t_9);
            }
            if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
              __pyx_t_13 = __pyx_t_9; __Pyx_INCREF(__pyx_t_13);
              __pyx_t_14 = 0;
              __pyx_t_15 = NULL;
            } else {
              __pyx_t_14 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1609, __pyx_L59_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1609, __pyx_L59_error)
            }
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            for (;;) {
              if (likely(!__pyx_t_15)) {
                if (likely(PyList_CheckExact(__pyx_t_13))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1609, __pyx_L59_error)
                    #endif
                    if (__pyx_t_14 >= __pyx_temp) break;
                  }
                  __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_13, __pyx_t_14);
                  ++__pyx_t_14;
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1609, __pyx_L59_error)
                    #endif
                    if (__pyx_t_14 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_14));
                  #else
                  __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_14);
                  #endif
                  ++__pyx_t_14;
                }
                if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1609, __pyx_L59_error)
              } else {
                __pyx_t_9 = __pyx_t_15(__pyx_t_13);
                if (unlikely(!__pyx_t_9)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1609, __pyx_L59_error)
                    PyErr_Clear();
                  }
                  break;
                }
              }
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_j, __pyx_t_9);
              __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_9genexpr27__pyx_v_j), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1609, __pyx_L59_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_i), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1609, __pyx_L59_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_16[0] = __pyx_mstate_global->__pyx_n_u_longitude_2;
              __pyx_t_16[1] = __pyx_t_9;
              __pyx_t_16[2] = __pyx_mstate_global->__pyx_n_u__21;
              __pyx_t_16[3] = __pyx_t_2;
              __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_16, 4, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
              if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1609, __pyx_L59_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(4, 1608, __pyx_L59_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            }
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_j); __pyx_9genexpr27__pyx_v_j = 0;
            goto __pyx_L63_exit_scope;
            __pyx_L59_error:;
            __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_j); __pyx_9genexpr27__pyx_v_j = 0;
            goto __pyx_L1_error;
            __pyx_L63_exit_scope:;
          } /* exit inner scope */

          /* "cython/core/triangulation.pyx":1608
 *                     if equation_type in [ 'longitude', 'peripheral', 'all']:
 *                         to_do += [ (0,1) ]
 *                         explain_rows += [             # <<<<<<<<<<<<<<
 *                             "longitude_%d_%d" % (j, i) for j in range(N-1) ]
 * 
*/
          __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1608, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_13);
          __pyx_t_13 = 0;

          /* "cython/core/triangulation.pyx":1606
 * 
 *                     # Add longitudes for complete cusps
 *                     if equation_type in [ 'longitude', 'peripheral', 'all']:             # <<<<<<<<<<<<<<
 *                         to_do += [ (0,1) ]
 *                         explain_rows += [
*/
        }

        /* "cython/core/triangulation.pyx":1597
 *                 # pairs to process later
 * 
 *                 if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 * 
 *                     # Add meridians for complete cusps
*/
        goto __pyx_L41;
      }

      /* "cython/core/triangulation.pyx":1614
 * 
 *                     # Add Dehn-filling for incomplete cusp
 *                     to_do += [ cusp_info.filling ]             # <<<<<<<<<<<<<<
 *                     explain_rows += [
 *                         "filling_%d_%d" % (j, i) for j in range(N-1) ]
*/
      /*else*/ {
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_mstate_global->__pyx_n_u_filling); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_13);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_13) != (0)) __PYX_ERR(4, 1614, __pyx_L1_error);
        __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_to_do, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_13));
        __pyx_t_13 = 0;

        /* "cython/core/triangulation.pyx":1615
 *                     # Add Dehn-filling for incomplete cusp
 *                     to_do += [ cusp_info.filling ]
 *                     explain_rows += [             # <<<<<<<<<<<<<<
 *                         "filling_%d_%d" % (j, i) for j in range(N-1) ]
 * 
*/
        { /* enter inner scope */
          __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1615, __pyx_L66_error)
          __Pyx_GOTREF(__pyx_t_13);

          /* "cython/core/triangulation.pyx":1616
 *                     to_do += [ cusp_info.filling ]
 *                     explain_rows += [
 *                         "filling_%d_%d" % (j, i) for j in range(N-1) ]             # <<<<<<<<<<<<<<
 * 
 *                 # process the todo list
*/
          __pyx_t_8 = NULL;
          __Pyx_INCREF(__pyx_builtin_range);
          __pyx_t_2 = __pyx_builtin_range; 
          __pyx_t_9 = __Pyx_PyLong_SubtractObjC(__pyx_v_N, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1616, __pyx_L66_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_6 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1616, __pyx_L66_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
            __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2);
            __pyx_t_14 = 0;
            __pyx_t_15 = NULL;
          } else {
            __pyx_t_14 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1616, __pyx_L66_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1616, __pyx_L66_error)
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          for (;;) {
            if (likely(!__pyx_t_15)) {
              if (likely(PyList_CheckExact(__pyx_t_2))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1616, __pyx_L66_error)
                  #endif
                  if (__pyx_t_14 >= __pyx_temp) break;
                }
                __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_14);
                ++__pyx_t_14;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1616, __pyx_L66_error)
                  #endif
                  if (__pyx_t_14 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_14));
                #else
                __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_14);
                #endif
                ++__pyx_t_14;
              }
              if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1616, __pyx_L66_error)
            } else {
              __pyx_t_5 = __pyx_t_15(__pyx_t_2);
              if (unlikely(!__pyx_t_5)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1616, __pyx_L66_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_j, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_9genexpr28__pyx_v_j), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1616, __pyx_L66_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_i), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1616, __pyx_L66_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_16[0] = __pyx_mstate_global->__pyx_n_u_filling_2;
            __pyx_t_16[1] = __pyx_t_5;
            __pyx_t_16[2] = __pyx_mstate_global->__pyx_n_u__21;
            __pyx_t_16[3] = __pyx_t_9;
            __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_16, 4, 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
            if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1616, __pyx_L66_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_8))) __PYX_ERR(4, 1615, __pyx_L66_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_j); __pyx_9genexpr28__pyx_v_j = 0;
          goto __pyx_L70_exit_scope;
          __pyx_L66_error:;
          __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_j); __pyx_9genexpr28__pyx_v_j = 0;
          goto __pyx_L1_error;
          __pyx_L70_exit_scope:;
        } /* exit inner scope */

        /* "cython/core/triangulation.pyx":1615
 *                     # Add Dehn-filling for incomplete cusp
 *                     to_do += [ cusp_info.filling ]
 *                     explain_rows += [             # <<<<<<<<<<<<<<
 *                         "filling_%d_%d" % (j, i) for j in range(N-1) ]
 * 
*/
        __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L41:;

      /* "cython/core/triangulation.pyx":1619
 * 
 *                 # process the todo list
 *                 for (m, l) in to_do:             # <<<<<<<<<<<<<<
 * 
 *                     get_cusp_equations_pgl(self.c_triangulation,
*/
      __pyx_t_2 = __pyx_v_to_do; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_14 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1619, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        __pyx_t_13 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_14);
        ++__pyx_t_14;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1619, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) {
          PyObject* sequence = __pyx_t_13;
          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(4, 1619, __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_INCREF(__pyx_t_8);
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_9);
          } else {
            __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1619, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_8);
            __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1619, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_9);
          }
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_5 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
          index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L73_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_9)) goto __pyx_L73_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 2) < 0) __PYX_ERR(4, 1619, __pyx_L1_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L74_unpacking_done;
          __pyx_L73_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(4, 1619, __pyx_L1_error)
          __pyx_L74_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "cython/core/triangulation.pyx":1623
 *                     get_cusp_equations_pgl(self.c_triangulation,
 *                                            &c_matrix,
 *                                            N, i, m, l)             # <<<<<<<<<<<<<<
 * 
 *                     eqns, r, explain_cols = (
*/
        __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1623, __pyx_L1_error)
        __pyx_t_17 = __Pyx_PyLong_As_int(__pyx_v_i); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1623, __pyx_L1_error)
        __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_v_m); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1623, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyLong_As_int(__pyx_v_l); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1623, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":1621
 *                 for (m, l) in to_do:
 * 
 *                     get_cusp_equations_pgl(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                            &c_matrix,
 *                                            N, i, m, l)
*/
        get_cusp_equations_pgl(__pyx_v_self->c_triangulation, (&__pyx_v_c_matrix), __pyx_t_7, __pyx_t_17, __pyx_t_18, __pyx_t_19);

        /* "cython/core/triangulation.pyx":1626
 * 
 *                     eqns, r, explain_cols = (
 *                         convert_and_free_integer_matrix(c_matrix))             # <<<<<<<<<<<<<<
 *                     equations += eqns
 * 
*/
        __pyx_t_13 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) {
          PyObject* sequence = __pyx_t_13;
          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(4, 1625, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
            __Pyx_INCREF(__pyx_t_5);
          } else {
            __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1625, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_9);
            __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1625, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_8);
            __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 2);
            if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1625, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_5);
          }
          #else
          __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1625, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1625, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1625, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_20 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1625, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_20);
          index = 0; __pyx_t_9 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_9)) goto __pyx_L75_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_8)) goto __pyx_L75_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          index = 2; __pyx_t_5 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_5)) goto __pyx_L75_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_20), 3) < 0) __PYX_ERR(4, 1625, __pyx_L1_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          goto __pyx_L76_unpacking_done;
          __pyx_L75_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(4, 1625, __pyx_L1_error)
          __pyx_L76_unpacking_done:;
        }

        /* "cython/core/triangulation.pyx":1625
 *                                            N, i, m, l)
 * 
 *                     eqns, r, explain_cols = (             # <<<<<<<<<<<<<<
 *                         convert_and_free_integer_matrix(c_matrix))
 *                     equations += eqns
*/
        __Pyx_XDECREF_SET(__pyx_v_eqns, __pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":1627
 *                     eqns, r, explain_cols = (
 *                         convert_and_free_integer_matrix(c_matrix))
 *                     equations += eqns             # <<<<<<<<<<<<<<
 * 
 *         if equations == []:
*/
        __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_equations, __pyx_v_eqns); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1627, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF_SET(__pyx_v_equations, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "cython/core/triangulation.pyx":1619
 * 
 *                 # process the todo list
 *                 for (m, l) in to_do:             # <<<<<<<<<<<<<<
 * 
 *                     get_cusp_equations_pgl(self.c_triangulation,
*/
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":1590
 *             # Add peripheral equations
 * 
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 cusp_info = self.cusp_info(i)
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1586
 *             explain_rows += r
 * 
 *         if equation_type in ['all', 'peripheral', 'longitude', 'meridian']:             # <<<<<<<<<<<<<<
 * 
 *             # Add peripheral equations
*/
  }

  /* "cython/core/triangulation.pyx":1629
 *                     equations += eqns
 * 
 *         if equations == []:             # <<<<<<<<<<<<<<
 *             # cover cases N = 2, 3 and equation_type = 'internal'
 *             return None
*/
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_equations, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":1631
 *         if equations == []:
 *             # cover cases N = 2, 3 and equation_type = 'internal'
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         return NeumannZagierTypeEquations(matrix(equations),
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1629
 *                     equations += eqns
 * 
 *         if equations == []:             # <<<<<<<<<<<<<<
 *             # cover cases N = 2, 3 and equation_type = 'internal'
 *             return None
*/
  }

  /* "cython/core/triangulation.pyx":1633
 *             return None
 * 
 *         return NeumannZagierTypeEquations(matrix(equations),             # <<<<<<<<<<<<<<
 *                                           explain_rows,
 *                                           explain_cols)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_equations};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }

  /* "cython/core/triangulation.pyx":1635
 *         return NeumannZagierTypeEquations(matrix(equations),
 *                                           explain_rows,
 *                                           explain_cols)             # <<<<<<<<<<<<<<
 * 
 *     def _ptolemy_equations_identified_face_classes(self):
*/
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_5, __pyx_v_explain_rows, __pyx_v_explain_cols};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1457
 *         return ans
 * 
 *     def gluing_equations_pgl(self, N =2, equation_type='all'):             # <<<<<<<<<<<<<<
 * 
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.gluing_equations_pgl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_equations);
  __Pyx_XDECREF(__pyx_v_explain_rows);
  __Pyx_XDECREF(__pyx_v_explain_cols);
  __Pyx_XDECREF(__pyx_v_eqns);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_cusp_info);
  __Pyx_XDECREF(__pyx_v_to_do);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_j);
  __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_j);
  __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1637
 *                                           explain_cols)
 * 
 *     def _ptolemy_equations_identified_face_classes(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function returns an identification structure where s_f_t gets
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_101_ptolemy_equations_identified_face_classes(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_8SnapPyHP_13Triangulation_100_ptolemy_equations_identified_face_classes, "\n        This function returns an identification structure where s_f_t gets\n        identified with -s_g_u if face f of tetrahedron t is glued to face g of\n        tetrahedron u.\n\n        We can represent a 2-cohomology class H^2(M,boundary M) by denoting by\n        s_f_t the value the 2-cohomology class takes on the face f of\n        tetrahedron t with the orientation being the one induced from the\n        orientation of the tetrahedron.\n        Because a face class of the triangulation has two representatives\n        (tet_index, face_index) and the gluing is orientation-reversing on the\n        face, one s will be the negative of another s.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_101_ptolemy_equations_identified_face_classes = {"_ptolemy_equations_identified_face_classes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_101_ptolemy_equations_identified_face_classes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_100_ptolemy_equations_identified_face_classes};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_101_ptolemy_equations_identified_face_classes(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("_ptolemy_equations_identified_face_classes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_identified_face_classes", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_ptolemy_equations_identified_face_classes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_100_ptolemy_equations_identified_face_classes(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_100_ptolemy_equations_identified_face_classes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  Identification_of_variables __pyx_v_c_vars;
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ptolemy_equations_identified_face_classes", 0);

  /* "cython/core/triangulation.pyx":1654
 *         cdef Identification_of_variables c_vars
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1655
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         number_the_tetrahedra(self.c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1655, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1654
 *         cdef Identification_of_variables c_vars
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1657
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         number_the_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_identified_face_classes(
*/
  number_the_tetrahedra(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":1659
 *         number_the_tetrahedra(self.c_triangulation)
 * 
 *         get_ptolemy_equations_identified_face_classes(             # <<<<<<<<<<<<<<
 *             self.c_triangulation, &c_vars)
 * 
*/
  get_ptolemy_equations_identified_face_classes(__pyx_v_self->c_triangulation, (&__pyx_v_c_vars));

  /* "cython/core/triangulation.pyx":1662
 *             self.c_triangulation, &c_vars)
 * 
 *         return convert_and_free_identification_of_variables(c_vars)             # <<<<<<<<<<<<<<
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_identification_of_variables(__pyx_v_c_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1637
 *                                           explain_cols)
 * 
 *     def _ptolemy_equations_identified_face_classes(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function returns an identification structure where s_f_t gets
*/

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

/* "cython/core/triangulation.pyx":1664
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,             # <<<<<<<<<<<<<<
 *                                                   obstruction_class = None):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_103_ptolemy_equations_identified_coordinates(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_8SnapPyHP_13Triangulation_102_ptolemy_equations_identified_coordinates, "\n        Ptolemy coordinates that need to be identified for the given\n        triangulation when computing pSL(N,C) representations.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_103_ptolemy_equations_identified_coordinates = {"_ptolemy_equations_identified_coordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_103_ptolemy_equations_identified_coordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_102_ptolemy_equations_identified_coordinates};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_103_ptolemy_equations_identified_coordinates(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_N = 0;
  PyObject *__pyx_v_obstruction_class = 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("_ptolemy_equations_identified_coordinates (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_N,&__pyx_mstate_global->__pyx_n_u_obstruction_class,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1664, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1664, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1664, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_ptolemy_equations_identified_coordinates", 0) < 0) __PYX_ERR(4, 1664, __pyx_L3_error)

      /* "cython/core/triangulation.pyx":1665
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,
 *                                                   obstruction_class = None):             # <<<<<<<<<<<<<<
 * 
 *         """
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_identified_coordinates", 0, 1, 2, i); __PYX_ERR(4, 1664, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1664, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1664, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_N = values[0];
    __pyx_v_obstruction_class = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_identified_coordinates", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 1664, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._ptolemy_equations_identified_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_102_ptolemy_equations_identified_coordinates(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_N, __pyx_v_obstruction_class);

  /* "cython/core/triangulation.pyx":1664
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,             # <<<<<<<<<<<<<<
 *                                                   obstruction_class = None):
 * 
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_102_ptolemy_equations_identified_coordinates(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_obstruction_class) {
  Identification_of_variables __pyx_v_c_vars;
  int *__pyx_v_c_obstruction_class;
  int __pyx_v_T;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ptolemy_equations_identified_coordinates", 0);

  /* "cython/core/triangulation.pyx":1673
 * 
 *         cdef Identification_of_variables c_vars
 *         cdef int *c_obstruction_class = NULL             # <<<<<<<<<<<<<<
 *         cdef int T
 * 
*/
  __pyx_v_c_obstruction_class = NULL;

  /* "cython/core/triangulation.pyx":1676
 *         cdef int T
 * 
 *         if N < 2 or N > 15:             # <<<<<<<<<<<<<<
 *             raise ValueError('N has to be 2...15')
 * 
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_N, __pyx_mstate_global->__pyx_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1676, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_N, __pyx_mstate_global->__pyx_int_15, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1676, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 1676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1677
 * 
 *         if N < 2 or N > 15:
 *             raise ValueError('N has to be 2...15')             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL:
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_N_has_to_be_2_15};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1677, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1677, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1676
 *         cdef int T
 * 
 *         if N < 2 or N > 15:             # <<<<<<<<<<<<<<
 *             raise ValueError('N has to be 2...15')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1679
 *             raise ValueError('N has to be 2...15')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1680
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         if obstruction_class:
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1680, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1679
 *             raise ValueError('N has to be 2...15')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1682
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         if obstruction_class:             # <<<<<<<<<<<<<<
 *             T = get_num_tetrahedra(self.c_triangulation)
 *             if 2 * T != len(obstruction_class):
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obstruction_class); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 1682, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1683
 * 
 *         if obstruction_class:
 *             T = get_num_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 *             if 2 * T != len(obstruction_class):
 *                 raise ValueError('Obstruction class has wrong length')
*/
    __pyx_t_7 = get_num_tetrahedra(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1683, __pyx_L1_error)
    __pyx_v_T = __pyx_t_7;

    /* "cython/core/triangulation.pyx":1684
 *         if obstruction_class:
 *             T = get_num_tetrahedra(self.c_triangulation)
 *             if 2 * T != len(obstruction_class):             # <<<<<<<<<<<<<<
 *                 raise ValueError('Obstruction class has wrong length')
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))
*/
    __pyx_t_8 = PyObject_Length(__pyx_v_obstruction_class); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 1684, __pyx_L1_error)
    __pyx_t_1 = ((2 * __pyx_v_T) != __pyx_t_8);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":1685
 *             T = get_num_tetrahedra(self.c_triangulation)
 *             if 2 * T != len(obstruction_class):
 *                 raise ValueError('Obstruction class has wrong length')             # <<<<<<<<<<<<<<
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))
 *             for i, c in enumerate(obstruction_class):
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_5 = __pyx_builtin_ValueError; 
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Obstruction_class_has_wrong_leng};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1685, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 1685, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":1684
 *         if obstruction_class:
 *             T = get_num_tetrahedra(self.c_triangulation)
 *             if 2 * T != len(obstruction_class):             # <<<<<<<<<<<<<<
 *                 raise ValueError('Obstruction class has wrong length')
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))
*/
    }

    /* "cython/core/triangulation.pyx":1686
 *             if 2 * T != len(obstruction_class):
 *                 raise ValueError('Obstruction class has wrong length')
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))             # <<<<<<<<<<<<<<
 *             for i, c in enumerate(obstruction_class):
 *                 c_obstruction_class[i] = c
*/
    __pyx_v_c_obstruction_class = ((int *)malloc(((2 * __pyx_v_T) * (sizeof(int)))));

    /* "cython/core/triangulation.pyx":1687
 *                 raise ValueError('Obstruction class has wrong length')
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))
 *             for i, c in enumerate(obstruction_class):             # <<<<<<<<<<<<<<
 *                 c_obstruction_class[i] = c
 * 
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_2 = __pyx_mstate_global->__pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_obstruction_class)) || PyTuple_CheckExact(__pyx_v_obstruction_class)) {
      __pyx_t_5 = __pyx_v_obstruction_class; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_obstruction_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1687, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1687, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 1687, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1687, __pyx_L1_error)
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 1687, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":1688
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))
 *             for i, c in enumerate(obstruction_class):
 *                 c_obstruction_class[i] = c             # <<<<<<<<<<<<<<
 * 
 *         number_the_tetrahedra(self.c_triangulation)
*/
      __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_c); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1688, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1688, __pyx_L1_error)
      (__pyx_v_c_obstruction_class[__pyx_t_10]) = __pyx_t_7;

      /* "cython/core/triangulation.pyx":1687
 *                 raise ValueError('Obstruction class has wrong length')
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))
 *             for i, c in enumerate(obstruction_class):             # <<<<<<<<<<<<<<
 *                 c_obstruction_class[i] = c
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1682
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         if obstruction_class:             # <<<<<<<<<<<<<<
 *             T = get_num_tetrahedra(self.c_triangulation)
 *             if 2 * T != len(obstruction_class):
*/
  }

  /* "cython/core/triangulation.pyx":1690
 *                 c_obstruction_class[i] = c
 * 
 *         number_the_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_identified_coordinates(
*/
  number_the_tetrahedra(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":1693
 * 
 *         get_ptolemy_equations_identified_coordinates(
 *             self.c_triangulation, &c_vars, N, c_obstruction_class)             # <<<<<<<<<<<<<<
 * 
 *         free(c_obstruction_class)
*/
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1693, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1692
 *         number_the_tetrahedra(self.c_triangulation)
 * 
 *         get_ptolemy_equations_identified_coordinates(             # <<<<<<<<<<<<<<
 *             self.c_triangulation, &c_vars, N, c_obstruction_class)
 * 
*/
  get_ptolemy_equations_identified_coordinates(__pyx_v_self->c_triangulation, (&__pyx_v_c_vars), __pyx_t_7, __pyx_v_c_obstruction_class);

  /* "cython/core/triangulation.pyx":1695
 *             self.c_triangulation, &c_vars, N, c_obstruction_class)
 * 
 *         free(c_obstruction_class)             # <<<<<<<<<<<<<<
 * 
 *         return convert_and_free_identification_of_variables(c_vars)
*/
  free(__pyx_v_c_obstruction_class);

  /* "cython/core/triangulation.pyx":1697
 *         free(c_obstruction_class)
 * 
 *         return convert_and_free_identification_of_variables(c_vars)             # <<<<<<<<<<<<<<
 * 
 *     def _ptolemy_equations_action_by_decoration_change(self, int N):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_identification_of_variables(__pyx_v_c_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1664
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,             # <<<<<<<<<<<<<<
 *                                                   obstruction_class = None):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._ptolemy_equations_identified_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1699
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_action_by_decoration_change(self, int N):             # <<<<<<<<<<<<<<
 *         """
 *         We can change a decoration by multiplying a coset of a cusp by a
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_105_ptolemy_equations_action_by_decoration_change(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_8SnapPyHP_13Triangulation_104_ptolemy_equations_action_by_decoration_change, "\n        We can change a decoration by multiplying a coset of a cusp by a\n        diagonal matrix. Let a diagonal matrix SL(n,C) with diagonal\n        entries 1 1 ... z 1 ... 1 1/z (z at position j) act on cusp i. It\n        changes some Ptolemy coordinate c_p_t by some power z^n.\n        This is expressed in the following matrix as the entry in row\n        labelled c_p_t and the column labelled diagonal_entry_j_on_cusp_i.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_105_ptolemy_equations_action_by_decoration_change = {"_ptolemy_equations_action_by_decoration_change", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_105_ptolemy_equations_action_by_decoration_change, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_104_ptolemy_equations_action_by_decoration_change};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_105_ptolemy_equations_action_by_decoration_change(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
) {
  int __pyx_v_N;
  #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("_ptolemy_equations_action_by_decoration_change (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_N,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1699, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_ptolemy_equations_action_by_decoration_change", 0) < 0) __PYX_ERR(4, 1699, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_action_by_decoration_change", 1, 1, 1, i); __PYX_ERR(4, 1699, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1699, __pyx_L3_error)
    }
    __pyx_v_N = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1699, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_action_by_decoration_change", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 1699, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._ptolemy_equations_action_by_decoration_change", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_104_ptolemy_equations_action_by_decoration_change(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_N);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_104_ptolemy_equations_action_by_decoration_change(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, int __pyx_v_N) {
  Integer_matrix_with_explanations __pyx_v_c_matrix;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_explain_rows = NULL;
  PyObject *__pyx_v_explain_cols = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ptolemy_equations_action_by_decoration_change", 0);

  /* "cython/core/triangulation.pyx":1711
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1712
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         number_the_tetrahedra(self.c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1712, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1712, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1711
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1714
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         number_the_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_action_by_decoration_change(
*/
  number_the_tetrahedra(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":1716
 *         number_the_tetrahedra(self.c_triangulation)
 * 
 *         get_ptolemy_equations_action_by_decoration_change(             # <<<<<<<<<<<<<<
 *             self.c_triangulation,N, &c_matrix)
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(
*/
  get_ptolemy_equations_action_by_decoration_change(__pyx_v_self->c_triangulation, __pyx_v_N, (&__pyx_v_c_matrix));

  /* "cython/core/triangulation.pyx":1718
 *         get_ptolemy_equations_action_by_decoration_change(
 *             self.c_triangulation,N, &c_matrix)
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(             # <<<<<<<<<<<<<<
 *             c_matrix)
 * 
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1718, __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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1718, __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_INCREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1718, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1718, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1718, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(4, 1718, __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(4, 1718, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_rows = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_cols = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":1721
 *             c_matrix)
 * 
 *         return m, explain_rows, explain_cols             # <<<<<<<<<<<<<<
 * 
 *     def _ptolemy_equations_boundary_map_3(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m) != (0)) __PYX_ERR(4, 1721, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows) != (0)) __PYX_ERR(4, 1721, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols) != (0)) __PYX_ERR(4, 1721, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1699
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_action_by_decoration_change(self, int N):             # <<<<<<<<<<<<<<
 *         """
 *         We can change a decoration by multiplying a coset of a cusp by a
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._ptolemy_equations_action_by_decoration_change", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_explain_rows);
  __Pyx_XDECREF(__pyx_v_explain_cols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1723
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_3(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_3 -> C_2 in cellular homology represented as matrix
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_107_ptolemy_equations_boundary_map_3(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_8SnapPyHP_13Triangulation_106_ptolemy_equations_boundary_map_3, "\n        Boundary map C_3 -> C_2 in cellular homology represented as matrix\n\n        The following map represents the boundary map in the cellular chain\n        complex when representing a linear map as a matrix m acting on a column\n        vector v by left-multiplication m * v. With right-multiplication acting\n        on row vectors, the matrix represents the coboundary map in the cochain\n        complex.\n\n        The basis for C_3 are just the oriented tetrahedra of the triangulation.\n        The basis for C_2 are the face classes, see\n        _ptolemy_equations_identified_face_classes.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_107_ptolemy_equations_boundary_map_3 = {"_ptolemy_equations_boundary_map_3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_107_ptolemy_equations_boundary_map_3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_106_ptolemy_equations_boundary_map_3};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_107_ptolemy_equations_boundary_map_3(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("_ptolemy_equations_boundary_map_3 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_boundary_map_3", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_ptolemy_equations_boundary_map_3", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_106_ptolemy_equations_boundary_map_3(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_106_ptolemy_equations_boundary_map_3(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  Integer_matrix_with_explanations __pyx_v_c_matrix;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_explain_rows = NULL;
  PyObject *__pyx_v_explain_cols = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_3", 0);

  /* "cython/core/triangulation.pyx":1740
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1741
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         number_the_tetrahedra(self.c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1741, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1740
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1743
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         number_the_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_boundary_map_3(self.c_triangulation, &c_matrix)
*/
  number_the_tetrahedra(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":1745
 *         number_the_tetrahedra(self.c_triangulation)
 * 
 *         get_ptolemy_equations_boundary_map_3(self.c_triangulation, &c_matrix)             # <<<<<<<<<<<<<<
 * 
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(
*/
  get_ptolemy_equations_boundary_map_3(__pyx_v_self->c_triangulation, (&__pyx_v_c_matrix));

  /* "cython/core/triangulation.pyx":1747
 *         get_ptolemy_equations_boundary_map_3(self.c_triangulation, &c_matrix)
 * 
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(             # <<<<<<<<<<<<<<
 *             c_matrix)
 * 
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1747, __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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1747, __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_INCREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1747, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1747, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1747, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(4, 1747, __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(4, 1747, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_rows = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_cols = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":1750
 *             c_matrix)
 * 
 *         return m, explain_rows, explain_cols             # <<<<<<<<<<<<<<
 * 
 *     def _ptolemy_equations_boundary_map_2(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m) != (0)) __PYX_ERR(4, 1750, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows) != (0)) __PYX_ERR(4, 1750, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols) != (0)) __PYX_ERR(4, 1750, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1723
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_3(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_3 -> C_2 in cellular homology represented as matrix
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._ptolemy_equations_boundary_map_3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_explain_rows);
  __Pyx_XDECREF(__pyx_v_explain_cols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1752
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_2 -> C_1 in cellular homology represented as matrix.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_109_ptolemy_equations_boundary_map_2(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_8SnapPyHP_13Triangulation_108_ptolemy_equations_boundary_map_2, "\n        Boundary map C_2 -> C_1 in cellular homology represented as matrix.\n\n        Also see _ptolemy_equations_boundary_map_3.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_109_ptolemy_equations_boundary_map_2 = {"_ptolemy_equations_boundary_map_2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_109_ptolemy_equations_boundary_map_2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_108_ptolemy_equations_boundary_map_2};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_109_ptolemy_equations_boundary_map_2(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("_ptolemy_equations_boundary_map_2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_boundary_map_2", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_ptolemy_equations_boundary_map_2", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_108_ptolemy_equations_boundary_map_2(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_108_ptolemy_equations_boundary_map_2(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  Integer_matrix_with_explanations __pyx_v_c_matrix;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_explain_rows = NULL;
  PyObject *__pyx_v_explain_cols = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_2", 0);

  /* "cython/core/triangulation.pyx":1761
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1762
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         number_the_tetrahedra(self.c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1762, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1761
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1764
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         number_the_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_boundary_map_2(self.c_triangulation, &c_matrix)
*/
  number_the_tetrahedra(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":1766
 *         number_the_tetrahedra(self.c_triangulation)
 * 
 *         get_ptolemy_equations_boundary_map_2(self.c_triangulation, &c_matrix)             # <<<<<<<<<<<<<<
 * 
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(
*/
  get_ptolemy_equations_boundary_map_2(__pyx_v_self->c_triangulation, (&__pyx_v_c_matrix));

  /* "cython/core/triangulation.pyx":1768
 *         get_ptolemy_equations_boundary_map_2(self.c_triangulation, &c_matrix)
 * 
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(             # <<<<<<<<<<<<<<
 *             c_matrix)
 * 
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1768, __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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1768, __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_INCREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1768, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1768, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1768, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(4, 1768, __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(4, 1768, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_rows = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_cols = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":1771
 *             c_matrix)
 * 
 *         return m, explain_rows, explain_cols             # <<<<<<<<<<<<<<
 * 
 *     def _ptolemy_equations_boundary_map_1(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m) != (0)) __PYX_ERR(4, 1771, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows) != (0)) __PYX_ERR(4, 1771, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols) != (0)) __PYX_ERR(4, 1771, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1752
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_2 -> C_1 in cellular homology represented as matrix.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._ptolemy_equations_boundary_map_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_explain_rows);
  __Pyx_XDECREF(__pyx_v_explain_cols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1773
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_1 -> C_0 in cellular homology represented as matrix.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_111_ptolemy_equations_boundary_map_1(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_8SnapPyHP_13Triangulation_110_ptolemy_equations_boundary_map_1, "\n        Boundary map C_1 -> C_0 in cellular homology represented as matrix.\n        This will compute the homology of the cell complex obtained when\n        gluing together the tetrahedra and not of the cusped manifold.\n\n        Also see _ptolemy_equations_boundary_map_3.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_111_ptolemy_equations_boundary_map_1 = {"_ptolemy_equations_boundary_map_1", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_111_ptolemy_equations_boundary_map_1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_110_ptolemy_equations_boundary_map_1};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_111_ptolemy_equations_boundary_map_1(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("_ptolemy_equations_boundary_map_1 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_boundary_map_1", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_ptolemy_equations_boundary_map_1", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_110_ptolemy_equations_boundary_map_1(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_110_ptolemy_equations_boundary_map_1(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  Integer_matrix_with_explanations __pyx_v_c_matrix;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_explain_rows = NULL;
  PyObject *__pyx_v_explain_cols = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_1", 0);

  /* "cython/core/triangulation.pyx":1784
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1785
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         number_the_tetrahedra(self.c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1785, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1784
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":1787
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         number_the_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_boundary_map_1(self.c_triangulation, &c_matrix)
*/
  number_the_tetrahedra(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":1789
 *         number_the_tetrahedra(self.c_triangulation)
 * 
 *         get_ptolemy_equations_boundary_map_1(self.c_triangulation, &c_matrix)             # <<<<<<<<<<<<<<
 * 
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(
*/
  get_ptolemy_equations_boundary_map_1(__pyx_v_self->c_triangulation, (&__pyx_v_c_matrix));

  /* "cython/core/triangulation.pyx":1791
 *         get_ptolemy_equations_boundary_map_1(self.c_triangulation, &c_matrix)
 * 
 *         m, explain_rows, explain_cols = convert_and_free_integer_matrix(             # <<<<<<<<<<<<<<
 *             c_matrix)
 * 
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1791, __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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1791, __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_INCREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1791, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1791, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1791, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(4, 1791, __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(4, 1791, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_rows = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_cols = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":1794
 *             c_matrix)
 * 
 *         return m, explain_rows, explain_cols             # <<<<<<<<<<<<<<
 * 
 *     def ptolemy_obstruction_classes(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m) != (0)) __PYX_ERR(4, 1794, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows) != (0)) __PYX_ERR(4, 1794, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols) != (0)) __PYX_ERR(4, 1794, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1773
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_1 -> C_0 in cellular homology represented as matrix.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._ptolemy_equations_boundary_map_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_explain_rows);
  __Pyx_XDECREF(__pyx_v_explain_cols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1796
 *         return m, explain_rows, explain_cols
 * 
 *     def ptolemy_obstruction_classes(self):             # <<<<<<<<<<<<<<
 * 
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_113ptolemy_obstruction_classes(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_8SnapPyHP_13Triangulation_112ptolemy_obstruction_classes, "\n        Returns the obstruction classes needed to compute\n        pSL(N,C) = SL(N,C)/{+1,-1} representations for even N, i.e., it\n        returns a list with a representative cocycle for each class in\n        H^2(M, boundary M; Z/2). The first element in the list is always\n        representing the trivial obstruction class.\n\n        For example, 4_1 has two obstruction classes:\n\n        >>> M = Manifold(\"4_1\")\n        >>> c = M.ptolemy_obstruction_classes()\n        >>> len(c)\n        2\n\n        The primary use of these obstruction classes is to construct\n        the Ptolemy variety as described in Definition 1.7 of\n        Stavros Garoufalidis, Dylan Thurston, Christian K. Zickert:\n        \"The Complex Volume of SL(n,C)-Representations of 3-Manifolds\"\n        (http://arxiv.org/abs/1111.2828).\n\n        For example, to construct the Ptolemy variety for\n        PSL(2,C)-representations of 4_1 that do not lift to boundary-parabolic\n        SL(2,C)-representations, use:\n\n        >>> p = M.ptolemy_variety(N = 2, obstruction_class = c[1])\n\n        Or the following short-cut:\n\n        >>> p = M.ptolemy_variety(2, obstruction_class = 1)\n\n        Note that this obstruction class only makes sense for even N:\n\n        >>> p = M.ptolemy_variety(3, obstruction_class = c[1])\n        Traceback (most recent call last):\n        ...\n        AssertionError: PtolemyObstructionClass only makes sense for even N, try PtolemyGeneralizedObstructionClass\n\n        To obtain PGL(N,C)-representations for N > 2, use the generalized\n        obstruction class:\n\n        >>> c = M.ptolemy_generalized_obstruction_classes(3)\n        >>> p = M.ptolemy_variety(3, obstruction_class = c[1])\n\n        The original obstruction class encodes a representing cocycle in Z/2 as follows:\n\n        >>> c = M.ptolemy_obstruction_classes()\n        >>> c[1]\n        PtolemyObstructionClass(s_0_0 + 1, s_1_0 - 1, s_2_0 - 1, s_3_0 + 1, s_0_0 - s_0_1, s_1_0 - s_3_1, s_2_0 -"" s_2_1, s_3_0 - s_1_1)\n\n        This means that the cocycle to represent this obstruction class in Z/2\n        takes value 1 in Z/2 on face 0 of tetrahedra 0 (because s_0_0 = -1)\n        and value 0 in Z/2 on face 1 of tetrahedra 0 (because s_1_0 = +1).\n\n        Face 3 of tetrahedra 0 and face 1 of tetrahedra 1 are identified,\n        hence the cocycle takes the same value on those two faces (s_3_0 = s_1_1).\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_113ptolemy_obstruction_classes = {"ptolemy_obstruction_classes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_113ptolemy_obstruction_classes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_112ptolemy_obstruction_classes};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_113ptolemy_obstruction_classes(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("ptolemy_obstruction_classes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("ptolemy_obstruction_classes", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("ptolemy_obstruction_classes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_112ptolemy_obstruction_classes(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_112ptolemy_obstruction_classes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ptolemy_obstruction_classes", 0);

  /* "cython/core/triangulation.pyx":1856
 *         """
 * 
 *         return ptolemyManifoldMethods.get_ptolemy_obstruction_classes(self)             # <<<<<<<<<<<<<<
 * 
 *     def ptolemy_generalized_obstruction_classes(self, N):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ptolemyManifoldMethods); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_ptolemy_obstruction_classes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1796
 *         return m, explain_rows, explain_cols
 * 
 *     def ptolemy_obstruction_classes(self):             # <<<<<<<<<<<<<<
 * 
 *         """
*/

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

/* "cython/core/triangulation.pyx":1858
 *         return ptolemyManifoldMethods.get_ptolemy_obstruction_classes(self)
 * 
 *     def ptolemy_generalized_obstruction_classes(self, N):             # <<<<<<<<<<<<<<
 * 
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_115ptolemy_generalized_obstruction_classes(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_8SnapPyHP_13Triangulation_114ptolemy_generalized_obstruction_classes, "\n        Returns the obstruction classes needed to compute\n        PGL(N,C)-representations for any N, i.e., it returns a list with\n        a representative cocycle for each element in\n        H^2(M, boundary M; Z/N) / (Z/N)^* where (Z/N)^* are the units in Z/N.\n        The first element in the list always corresponds to the trivial\n        obstruction class.\n        The generalized ptolemy obstruction classes are thus a generalization\n        of the ptolemy obstruction classes that allow to find all\n        boundary-unipotent\n        PGL(N,C)-representations including those that do not lift to\n        boundary-unipotent SL(N,C)-representations for N odd or\n        SL(N,C)/{+1,-1}-representations for N even.\n\n        For example, 4_1 has three obstruction classes up to equivalence:\n\n        >>> M = Manifold(\"4_1\")\n        >>> c = M.ptolemy_generalized_obstruction_classes(4)\n        >>> len(c)\n        3\n\n        For 4_1, we only get three obstruction classes even though we have\n        H^2(M, boundary M; Z/4) = Z/4 because the two obstruction classes\n        1 in Z/4 and -1 in Z/4 are related by a unit and thus give\n        isomorphic Ptolemy varieties.\n\n        The primary use of an obstruction class sigma is to construct the\n        Ptolemy variety of sigma. This variety computes boundary-unipotent\n        PGL(N,C)-representations whose obstruction class to a\n        boundary-unipotent lift to SL(N,C) is sigma.\n\n        For example for 4_1, there are 2 obstruction classes for N = 3:\n\n        >>> M = Manifold(\"4_1\")\n        >>> c = M.ptolemy_generalized_obstruction_classes(3)\n        >>> len(c)\n        2\n\n        The Ptolemy variety parametrizing boundary-unipotent\n        SL(3,C)-representations of 4_1 is obtained by\n\n        >>> p = M.ptolemy_variety(N = 3, obstruction_class = c[0])\n\n        and the Ptolemy variety parametrizing boundary-unipotent\n        PSL(3,C)-representations of 4_1 that do not lift to\n        b""oundary-unipotent SL(3,C)-representations is obtained by\n\n        >>> p = M.ptolemy_variety(N = 3, obstruction_class = c[1])\n\n        The cocycle representing the non-trivial obstruction class looks as\n        follows:\n\n        >>> c[1]\n        PtolemyGeneralizedObstructionClass([2, 0, 0, 1])\n\n        This means that the cocycle takes the value -1 in Z/3 on the first face\n        class and 1 on the fourth face class but zero on every other of the\n        four face classes.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_115ptolemy_generalized_obstruction_classes = {"ptolemy_generalized_obstruction_classes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_115ptolemy_generalized_obstruction_classes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_114ptolemy_generalized_obstruction_classes};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_115ptolemy_generalized_obstruction_classes(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_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("ptolemy_generalized_obstruction_classes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_N,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1858, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ptolemy_generalized_obstruction_classes", 0) < 0) __PYX_ERR(4, 1858, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ptolemy_generalized_obstruction_classes", 1, 1, 1, i); __PYX_ERR(4, 1858, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1858, __pyx_L3_error)
    }
    __pyx_v_N = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ptolemy_generalized_obstruction_classes", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 1858, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.ptolemy_generalized_obstruction_classes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_114ptolemy_generalized_obstruction_classes(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_N);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_114ptolemy_generalized_obstruction_classes(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ptolemy_generalized_obstruction_classes", 0);

  /* "cython/core/triangulation.pyx":1919
 *         four face classes.
 *         """
 *         return (             # <<<<<<<<<<<<<<
 *             ptolemyManifoldMethods.get_generalized_ptolemy_obstruction_classes(
 *                 self, N))
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/triangulation.pyx":1920
 *         """
 *         return (
 *             ptolemyManifoldMethods.get_generalized_ptolemy_obstruction_classes(             # <<<<<<<<<<<<<<
 *                 self, N))
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ptolemyManifoldMethods); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_generalized_ptolemy_obstruct); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1921
 *         return (
 *             ptolemyManifoldMethods.get_generalized_ptolemy_obstruction_classes(
 *                 self, N))             # <<<<<<<<<<<<<<
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,
*/
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_N};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1858
 *         return ptolemyManifoldMethods.get_ptolemy_obstruction_classes(self)
 * 
 *     def ptolemy_generalized_obstruction_classes(self, N):             # <<<<<<<<<<<<<<
 * 
 *         """
*/

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

/* "cython/core/triangulation.pyx":1923
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_117ptolemy_variety(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_8SnapPyHP_13Triangulation_116ptolemy_variety, "\n        M.ptolemy_variety(N, obstruction_class = None, simplify = True, eliminate_fixed_ptolemys = False)\n\n        Returns a Ptolemy variety as described in\n\n        * Stavros Garoufalidis, Dyland Thurston, Christian K. Zickert:\n          \"The Complex Volume of SL(n,C)-Representations of 3-Manifolds\"\n          (http://arxiv.org/abs/1111.2828)\n        * Stavros Garoufalidis, Matthias Goerner, Christian K. Zickert:\n          \"Gluing Equations for PGL(n,C)-Representations of 3-Manifolds \"\n          (http://arxiv.org/abs/1207.6711)\n\n        The variety can be exported to magma or sage and solved there. The\n        solutions can be processed to compute invariants. The method can also\n        be used to automatically look up precomputed solutions from the\n        database at http://ptolemy.unhyperbolic.org/data .\n\n        Example for m011 and PSL(2,C)-representations:\n\n        >>> M = Manifold(\"m011\")\n\n        Obtain all Ptolemy varieties for PSL(2,C)-representations:\n\n        >>> p = M.ptolemy_variety(2, obstruction_class = 'all')\n\n        There are two Ptolemy varieties for the two obstruction classes:\n\n        >>> len(p)\n        2\n\n        Retrieve the solutions from the database\n\n        >>> sols = p.retrieve_solutions() #doctest: +SKIP\n\n        Compute the solutions using magma (default in SnapPy)\n\n        >>> sols = p.compute_solutions(engine = 'magma') #doctest: +SKIP\n\n        Compute the solutions using singular (default in sage)\n\n        >>> sols = p.compute_solutions(engine = 'sage') #doctest: +SKIP\n\n        Note that magma is significantly faster.\n\n        Compute all resulting complex volumes\n\n        >>> cvols = sols.complex_volume_numerical() #doctest: +SKIP\n        >>> cvols  #doctest: +SKIP\n        [[[-4.29405713186238 E-16 + 0.725471193740844*I,\n           -0.942707362776931 + 0.459731436553693*I,\n           0.942707362776931 + 0.459731436553693*I]],\n         [[3.94159248086745 E-15 + 0.31268268751""8267*I,\n           4.64549527022581 E-15 + 0.680993020093457*I,\n           -2.78183391239608 - 0.496837853805869*I,\n           2.78183391239608 - 0.496837853805869*I]]]\n\n        Show complex volumes as a non-nested list:\n\n        >>> cvols.flatten(depth=2) #doctest: +SKIP\n        [-4.29405713186238 E-16 + 0.725471193740844*I,\n         -0.942707362776931 + 0.459731436553693*I,\n         0.942707362776931 + 0.459731436553693*I,\n         3.94159248086745 E-15 + 0.312682687518267*I,\n         4.64549527022581 E-15 + 0.680993020093457*I,\n         -2.78183391239608 - 0.496837853805869*I,\n         2.78183391239608 - 0.496837853805869*I]\n\n        For more examples, go to http://ptolemy.unhyperbolic.org/\n\n        === Optional Arguments ===\n\n        obstruction_class --- class from Definition 1.7 of (1).\n        None for trivial class or a value returned from ptolemy_obstruction_classes.\n        Short cuts: obstruction_class = 'all' returns a list of Ptolemy varieties\n        for each obstruction. For easier iteration, can set obstruction_class to\n        an integer.\n\n        simplify --- boolean to indicate whether to simplify the equations which\n        significantly reduces the number of variables.\n        Simplifying means that several identified Ptolemy coordinates x = y = z = ...\n        are eliminated instead of adding relations x - y = 0, y - z = 0, ...\n\n        eliminate_fixed_ptolemys --- boolean to indicate whether to eliminate\n        the Ptolemy coordinates that are set to 1 for fixing the decoration.\n        Even though this simplifies the resulting representation, setting it to\n        True can cause magma to run longer when finding a Groebner basis.\n\n        === Examples for 4_1 ===\n\n        >>> M = Manifold(\"4_1\")\n\n        Get the varieties for all obstruction classes at once (use\n        help(varieties[0]) for more information):\n\n        >>> varieties = M.ptolemy_variety(2, obstruction_class = \"all\")\n\n        Pr""int the variety as an ideal (sage object) for the non-trivial class:\n\n        >>> varieties[1].ideal    #doctest: +SKIP\n        Ideal (-c_0011_0^2 + c_0011_0*c_0101_0 + c_0101_0^2, -c_0011_0^2 - c_0011_0*c_0101_0 + c_0101_0^2, c_0011_0 - 1) of Multivariate Polynomial Ring in c_0011_0, c_0101_0 over Rational Field\n\n        Print the equations of the variety for the non-trivial class:\n\n        >>> for eqn in varieties[1].equations:\n        ...     print(eqn)          #doctest: +NORMALIZE_WHITESPACE\n             - c_0011_0 * c_0101_0 + c_0011_0^2 + c_0101_0^2\n             c_0011_0 * c_0101_0 - c_0011_0^2 - c_0101_0^2\n             - 1 + c_0011_0\n\n        Generate a magma file to compute Primary Decomposition for N = 3:\n\n        >>> p = M.ptolemy_variety(3)\n        >>> s = p.to_magma()\n        >>> print(s.split(\"ring and ideal\")[1].strip())     #doctest: +ELLIPSIS\n        R<c_0012_0, c_0012_1, c_0102_0, c_0111_0, c_0201_0, c_1011_0, c_1011_1, c_1101_0> := PolynomialRing(RationalField(), 8, \"grevlex\");\n        MyIdeal := ideal<R |\n                  c_0012_0 * c_1101_0 + c_0102_0 * c_0111_0 - c_0102_0 * c_1011_0,\n            ...\n\n        === If you have a magma installation ===\n\n        Call p.compute_solutions() to automatically call magma on the above output\n        and produce exact solutions!!!\n\n        >>> try:\n        ...     sols = p.compute_solutions()\n        ... except:\n        ...     # magma failed, use precomputed_solutions\n        ...     sols = None\n\n        Check solutions against manifold\n        >>> if sols:\n        ...     dummy = sols.check_against_manifold()\n\n        === If you do not have a magma installation ===\n\n        Load a precomputed example from magma which is provided with the package:\n\n        >>> from snappy.ptolemy.processMagmaFile import _magma_output_for_4_1__sl3, solutions_from_magma\n        >>> print(_magma_output_for_4_1__sl3)      #doctest: +ELLIPSIS\n        <BLANKLINE>\n        ==TRIAN""GULATION=BEGINS==\n        % Triangulation\n        4_1\n        ...\n\n        Parse the file and produce solutions:\n\n        >>> sols = solutions_from_magma(_magma_output_for_4_1__sl3)\n\n        >>> dummy = sols.check_against_manifold()\n\n        === Continue here whether you have or do not have magma ===\n\n        Pick the first solution of the three different solutions (up to Galois\n        conjugates):\n\n        >>> len(sols)\n        3\n        >>> solution = sols[0]\n\n        Read the exact value for c_1020_0 (help(solution) for more information\n        on how to compute cross ratios, volumes and other invariants):\n\n        >>> solution['c_1020_0']\n        Mod(-1/2*x - 3/2, x^2 + 3*x + 4)\n\n        Example of simplified vs non-simplified variety for N = 4:\n\n        >>> simplified = M.ptolemy_variety(4, obstruction_class = 1)\n        >>> full = M.ptolemy_variety(4, obstruction_class = 1, simplify = False)\n        >>> len(simplified.variables), len(full.variables)\n        (21, 63)\n        >>> len(simplified.equations), len(full.equations)\n        (24, 72)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_117ptolemy_variety = {"ptolemy_variety", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_117ptolemy_variety, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_116ptolemy_variety};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_117ptolemy_variety(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_N = 0;
  PyObject *__pyx_v_obstruction_class = 0;
  PyObject *__pyx_v_simplify = 0;
  PyObject *__pyx_v_eliminate_fixed_ptolemys = 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("ptolemy_variety (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_N,&__pyx_mstate_global->__pyx_n_u_obstruction_class,&__pyx_mstate_global->__pyx_n_u_simplify,&__pyx_mstate_global->__pyx_n_u_eliminate_fixed_ptolemys,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1923, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 1923, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1923, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1923, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1923, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ptolemy_variety", 0) < 0) __PYX_ERR(4, 1923, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/triangulation.pyx":1924
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,
 *                         simplify = True, eliminate_fixed_ptolemys = False):             # <<<<<<<<<<<<<<
 * 
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ptolemy_variety", 0, 1, 4, i); __PYX_ERR(4, 1923, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 1923, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1923, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1923, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1923, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/triangulation.pyx":1923
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/triangulation.pyx":1924
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,
 *                         simplify = True, eliminate_fixed_ptolemys = False):             # <<<<<<<<<<<<<<
 * 
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_N = values[0];
    __pyx_v_obstruction_class = values[1];
    __pyx_v_simplify = values[2];
    __pyx_v_eliminate_fixed_ptolemys = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ptolemy_variety", 0, 1, 4, __pyx_nargs); __PYX_ERR(4, 1923, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.ptolemy_variety", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_116ptolemy_variety(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_N, __pyx_v_obstruction_class, __pyx_v_simplify, __pyx_v_eliminate_fixed_ptolemys);

  /* "cython/core/triangulation.pyx":1923
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_116ptolemy_variety(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_obstruction_class, PyObject *__pyx_v_simplify, PyObject *__pyx_v_eliminate_fixed_ptolemys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ptolemy_variety", 0);

  /* "cython/core/triangulation.pyx":2103
 *         """
 * 
 *         return ptolemyManifoldMethods.get_ptolemy_variety(             # <<<<<<<<<<<<<<
 *             self, N, obstruction_class,
 *             simplify = simplify,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ptolemyManifoldMethods); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_ptolemy_variety); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2106
 *             self, N, obstruction_class,
 *             simplify = simplify,
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)             # <<<<<<<<<<<<<<
 * 
 *     def gluing_equations(self,form='log'):
*/
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_N, __pyx_v_obstruction_class};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_simplify, __pyx_v_simplify, __pyx_t_3, __pyx_callargs+4, 0) < 0) __PYX_ERR(4, 2103, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eliminate_fixed_ptolemys, __pyx_v_eliminate_fixed_ptolemys, __pyx_t_3, __pyx_callargs+4, 1) < 0) __PYX_ERR(4, 2103, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1923
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
*/

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

/* "cython/core/triangulation.pyx":2108
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)
 * 
 *     def gluing_equations(self,form='log'):             # <<<<<<<<<<<<<<
 *         """
 *         In the default mode, this function returns a matrix with rows
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_119gluing_equations(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_8SnapPyHP_13Triangulation_118gluing_equations, "\n        In the default mode, this function returns a matrix with rows\n        of the form\n\n                  a b c  d e f  ...\n\n        which means\n\n            a*log(z0) + b*log(1/(1-z0)) + c*log((z0-1)/z0) + d*log(z1) +... = 2 pi i\n\n        for an edge equation, and (same) = 0 for a cusp equation.\n        Here, the cusp equations come at the bottom of the matrix, and\n        are listed in the form: meridian of cusp 0, longitude of cusp\n        0, meridian of cusp 1, longitude of cusp 1,...\n\n        In terms of the tetrahedra, a is the invariant of the edge\n        (2,3), b the invariant of the edge (0,2) and c is the\n        invariant of the edge (1,2).  See kernel_code/edge_classes.c\n        for a detailed account of the convention used.\n\n        If the optional argument form='rect' is given, then this\n        function returns a list of tuples of the form:\n\n           ( [a0, a1,..,a_n], [b_0, b_1,...,b_n], c)\n\n        where this corresponds to the equation\n\n           z0^a0 (1 - z0)^b0 z1^a1(1 - z1)^b1 ...  = c\n\n        where c = 1 or -1.\n\n        >>> M = Triangulation('m004(2,3)')\n        >>> M.gluing_equations()\n        [ 2  1  0  1  0  2]\n        [ 0  1  2  1  2  0]\n        [ 2  0  0  0 -8  6]\n        >>> M.gluing_equations(form='rect')\n        [([2, -1], [-1, 2], 1), ([-2, 1], [1, -2], 1), ([2, -6], [0, 14], 1)]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_119gluing_equations = {"gluing_equations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_119gluing_equations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_118gluing_equations};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_119gluing_equations(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_form = 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("gluing_equations (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_form,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2108, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gluing_equations", 0) < 0) __PYX_ERR(4, 2108, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_log));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_log));
    }
    __pyx_v_form = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("gluing_equations", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 2108, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.gluing_equations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_118gluing_equations(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_form);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_118gluing_equations(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_form) {
  int **__pyx_v_c_eqns;
  int __pyx_v_num_rows;
  int __pyx_v_num_cols;
  int *__pyx_v_eqn;
  PyObject *__pyx_v_eqns = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_cusp_info = NULL;
  PyObject *__pyx_v_to_do = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_rect = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_r = NULL;
  int __pyx_9genexpr29__pyx_v_i;
  int __pyx_9genexpr30__pyx_v_j;
  int __pyx_9genexpr31__pyx_v_j;
  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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gluing_equations", 0);

  /* "cython/core/triangulation.pyx":2153
 *         cdef int* eqn
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         c_eqns = get_gluing_equations(self.c_triangulation,
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2154
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         c_eqns = get_gluing_equations(self.c_triangulation,
 *                                       &num_rows, &num_cols)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 2154, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2153
 *         cdef int* eqn
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         c_eqns = get_gluing_equations(self.c_triangulation,
*/
  }

  /* "cython/core/triangulation.pyx":2155
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         c_eqns = get_gluing_equations(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                       &num_rows, &num_cols)
 *         eqns = [ [ c_eqns[i][j] for j in range(num_cols) ]
*/
  __pyx_v_c_eqns = get_gluing_equations(__pyx_v_self->c_triangulation, (&__pyx_v_num_rows), (&__pyx_v_num_cols));

  /* "cython/core/triangulation.pyx":2157
 *         c_eqns = get_gluing_equations(self.c_triangulation,
 *                                       &num_rows, &num_cols)
 *         eqns = [ [ c_eqns[i][j] for j in range(num_cols) ]             # <<<<<<<<<<<<<<
 *                  for i in range(num_rows) ]
 *         free_gluing_equations(c_eqns, num_rows)
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/triangulation.pyx":2158
 *                                       &num_rows, &num_cols)
 *         eqns = [ [ c_eqns[i][j] for j in range(num_cols) ]
 *                  for i in range(num_rows) ]             # <<<<<<<<<<<<<<
 *         free_gluing_equations(c_eqns, num_rows)
 * 
*/
    __pyx_t_6 = __pyx_v_num_rows;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_9genexpr29__pyx_v_i = __pyx_t_8;
      { /* enter inner scope */

        /* "cython/core/triangulation.pyx":2157
 *         c_eqns = get_gluing_equations(self.c_triangulation,
 *                                       &num_rows, &num_cols)
 *         eqns = [ [ c_eqns[i][j] for j in range(num_cols) ]             # <<<<<<<<<<<<<<
 *                  for i in range(num_rows) ]
 *         free_gluing_equations(c_eqns, num_rows)
*/
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2157, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __pyx_v_num_cols;
        __pyx_t_10 = __pyx_t_9;
        for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
          __pyx_9genexpr30__pyx_v_j = __pyx_t_11;
          __pyx_t_3 = __Pyx_PyLong_From_int(((__pyx_v_c_eqns[__pyx_9genexpr29__pyx_v_i])[__pyx_9genexpr30__pyx_v_j])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2157, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(4, 2157, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 2157, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_v_eqns = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2159
 *         eqns = [ [ c_eqns[i][j] for j in range(num_cols) ]
 *                  for i in range(num_rows) ]
 *         free_gluing_equations(c_eqns, num_rows)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.num_cusps()):
*/
  free_gluing_equations(__pyx_v_c_eqns, __pyx_v_num_rows);

  /* "cython/core/triangulation.pyx":2161
 *         free_gluing_equations(c_eqns, num_rows)
 * 
 *         for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_3 = __pyx_builtin_range; 
  __pyx_t_13 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_13);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
    __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
  }
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_12};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_14 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 2161, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2161, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_14);
        ++__pyx_t_14;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2161, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_14);
        #endif
        ++__pyx_t_14;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2161, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_15(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2161, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2162
 * 
 *         for i in range(self.num_cusps()):
 *             cusp_info = self.cusp_info(i)             # <<<<<<<<<<<<<<
 *             if cusp_info.is_complete:
 *                 to_do = [(1,0), (0,1)]
*/
    __pyx_t_12 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_i};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_cusp_info, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2163
 *         for i in range(self.num_cusps()):
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 *                 to_do = [(1,0), (0,1)]
 *             else:
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_mstate_global->__pyx_n_u_is_complete); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2163, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2164
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:
 *                 to_do = [(1,0), (0,1)]             # <<<<<<<<<<<<<<
 *             else:
 *                 to_do = [cusp_info.filling]
*/
      __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[5]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_tuple[5]) != (0)) __PYX_ERR(4, 2164, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[4]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_tuple[4]) != (0)) __PYX_ERR(4, 2164, __pyx_L1_error);
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2163
 *         for i in range(self.num_cusps()):
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 *                 to_do = [(1,0), (0,1)]
 *             else:
*/
      goto __pyx_L10;
    }

    /* "cython/core/triangulation.pyx":2166
 *                 to_do = [(1,0), (0,1)]
 *             else:
 *                 to_do = [cusp_info.filling]             # <<<<<<<<<<<<<<
 *             for (m, l) in to_do:
 *                 eqn = get_cusp_equation(self.c_triangulation,
*/
    /*else*/ {
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_mstate_global->__pyx_n_u_filling); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2) != (0)) __PYX_ERR(4, 2166, __pyx_L1_error);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_12));
      __pyx_t_12 = 0;
    }
    __pyx_L10:;

    /* "cython/core/triangulation.pyx":2167
 *             else:
 *                 to_do = [cusp_info.filling]
 *             for (m, l) in to_do:             # <<<<<<<<<<<<<<
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)
*/
    __pyx_t_12 = __pyx_v_to_do; __Pyx_INCREF(__pyx_t_12);
    __pyx_t_16 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2167, __pyx_L1_error)
        #endif
        if (__pyx_t_16 >= __pyx_temp) break;
      }
      __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_16);
      ++__pyx_t_16;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2167, __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(4, 2167, __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_INCREF(__pyx_t_4);
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_13);
        } else {
          __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2167, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 2167, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_13);
        }
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 2167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_17 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 2167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17);
        index = 0; __pyx_t_4 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_13 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_13)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 2) < 0) __PYX_ERR(4, 2167, __pyx_L1_error)
        __pyx_t_18 = NULL;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        goto __pyx_L14_unpacking_done;
        __pyx_L13_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_18 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(4, 2167, __pyx_L1_error)
        __pyx_L14_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_13);
      __pyx_t_13 = 0;

      /* "cython/core/triangulation.pyx":2169
 *             for (m, l) in to_do:
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)             # <<<<<<<<<<<<<<
 *                 eqns.append([eqn[j] for j in range(num_rows)])
 *                 free_cusp_equation(eqn)
*/
      __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2169, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2169, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2169, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2168
 *                 to_do = [cusp_info.filling]
 *             for (m, l) in to_do:
 *                 eqn = get_cusp_equation(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         i, int(m), int(l), &num_rows)
 *                 eqns.append([eqn[j] for j in range(num_rows)])
*/
      __pyx_v_eqn = get_cusp_equation(__pyx_v_self->c_triangulation, __pyx_t_6, __pyx_t_7, __pyx_t_8, (&__pyx_v_num_rows));

      /* "cython/core/triangulation.pyx":2170
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)
 *                 eqns.append([eqn[j] for j in range(num_rows)])             # <<<<<<<<<<<<<<
 *                 free_cusp_equation(eqn)
 * 
*/
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __pyx_v_num_rows;
        __pyx_t_7 = __pyx_t_8;
        for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
          __pyx_9genexpr31__pyx_v_j = __pyx_t_6;
          __pyx_t_13 = __Pyx_PyLong_From_int((__pyx_v_eqn[__pyx_9genexpr31__pyx_v_j])); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 2170, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_13))) __PYX_ERR(4, 2170, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      } /* exit inner scope */
      __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_eqns, __pyx_t_2); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(4, 2170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2171
 *                                         i, int(m), int(l), &num_rows)
 *                 eqns.append([eqn[j] for j in range(num_rows)])
 *                 free_cusp_equation(eqn)             # <<<<<<<<<<<<<<
 * 
 *         if form == 'log':
*/
      free_cusp_equation(__pyx_v_eqn);

      /* "cython/core/triangulation.pyx":2167
 *             else:
 *                 to_do = [cusp_info.filling]
 *             for (m, l) in to_do:             # <<<<<<<<<<<<<<
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)
*/
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":2161
 *         free_gluing_equations(c_eqns, num_rows)
 * 
 *         for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2173
 *                 free_cusp_equation(eqn)
 * 
 *         if form == 'log':             # <<<<<<<<<<<<<<
 *             return matrix(eqns)
 * 
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_form, __pyx_mstate_global->__pyx_n_u_log, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2173, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2174
 * 
 *         if form == 'log':
 *             return matrix(eqns)             # <<<<<<<<<<<<<<
 * 
 *         if form != 'rect':
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_12);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_eqns};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2173
 *                 free_cusp_equation(eqn)
 * 
 *         if form == 'log':             # <<<<<<<<<<<<<<
 *             return matrix(eqns)
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2176
 *             return matrix(eqns)
 * 
 *         if form != 'rect':             # <<<<<<<<<<<<<<
 *             raise ValueError("Equations are available in 'log' and "
 *                              "'rect' forms only.")
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_form, __pyx_mstate_global->__pyx_n_u_rect, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2176, __pyx_L1_error)
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2177
 * 
 *         if form != 'rect':
 *             raise ValueError("Equations are available in 'log' and "             # <<<<<<<<<<<<<<
 *                              "'rect' forms only.")
 *         rect = []
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_12 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Equations_are_available_in_log_a};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 2177, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2176
 *             return matrix(eqns)
 * 
 *         if form != 'rect':             # <<<<<<<<<<<<<<
 *             raise ValueError("Equations are available in 'log' and "
 *                              "'rect' forms only.")
*/
  }

  /* "cython/core/triangulation.pyx":2179
 *             raise ValueError("Equations are available in 'log' and "
 *                              "'rect' forms only.")
 *         rect = []             # <<<<<<<<<<<<<<
 *         for row in eqns:
 *             n = self.num_tetrahedra()
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_rect = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2180
 *                              "'rect' forms only.")
 *         rect = []
 *         for row in eqns:             # <<<<<<<<<<<<<<
 *             n = self.num_tetrahedra()
 *             a, b = [0,]*n, [0,]*n
*/
  __pyx_t_3 = __pyx_v_eqns; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_14 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2180, __pyx_L1_error)
      #endif
      if (__pyx_t_14 >= __pyx_temp) break;
    }
    __pyx_t_12 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_14);
    ++__pyx_t_14;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_12);
    __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":2181
 *         rect = []
 *         for row in eqns:
 *             n = self.num_tetrahedra()             # <<<<<<<<<<<<<<
 *             a, b = [0,]*n, [0,]*n
 *             c = 1
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_12);
    __pyx_t_12 = 0;

    /* "cython/core/triangulation.pyx":2182
 *         for row in eqns:
 *             n = self.num_tetrahedra()
 *             a, b = [0,]*n, [0,]*n             # <<<<<<<<<<<<<<
 *             c = 1
 *             for j in range(n):
*/
    __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(4, 2182, __pyx_L1_error);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_12, __pyx_v_n); if (unlikely(!__pyx_temp)) __PYX_ERR(4, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_12);
      __pyx_t_12 = __pyx_temp;
    }
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(4, 2182, __pyx_L1_error);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_n); if (unlikely(!__pyx_temp)) __PYX_ERR(4, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_temp;
    }
    __Pyx_XDECREF_SET(__pyx_v_a, ((PyObject*)__pyx_t_12));
    __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_b, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2183
 *             n = self.num_tetrahedra()
 *             a, b = [0,]*n, [0,]*n
 *             c = 1             # <<<<<<<<<<<<<<
 *             for j in range(n):
 *                 r = row[3*j + 2]
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_mstate_global->__pyx_int_1);

    /* "cython/core/triangulation.pyx":2184
 *             a, b = [0,]*n, [0,]*n
 *             c = 1
 *             for j in range(n):             # <<<<<<<<<<<<<<
 *                 r = row[3*j + 2]
 *                 a[j] = row[3*j] - r
*/
    __pyx_t_12 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_13 = __pyx_builtin_range; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_n};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_13 = __pyx_t_2; __Pyx_INCREF(__pyx_t_13);
      __pyx_t_16 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 2184, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_13))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2184, __pyx_L1_error)
            #endif
            if (__pyx_t_16 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_13, __pyx_t_16);
          ++__pyx_t_16;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2184, __pyx_L1_error)
            #endif
            if (__pyx_t_16 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_16));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_16);
          #endif
          ++__pyx_t_16;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2184, __pyx_L1_error)
      } else {
        __pyx_t_2 = __pyx_t_15(__pyx_t_13);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2184, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2185
 *             c = 1
 *             for j in range(n):
 *                 r = row[3*j + 2]             # <<<<<<<<<<<<<<
 *                 a[j] = row[3*j] - r
 *                 b[j] = -row[3*j + 1] + r
*/
      __pyx_t_2 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_j, 3, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_row, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2186
 *             for j in range(n):
 *                 r = row[3*j + 2]
 *                 a[j] = row[3*j] - r             # <<<<<<<<<<<<<<
 *                 b[j] = -row[3*j + 1] + r
 *                 c *= -1 if r % 2 else 1
*/
      __pyx_t_2 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_j, 3, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_row, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Subtract(__pyx_t_12, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely((PyObject_SetItem(__pyx_v_a, __pyx_v_j, __pyx_t_2) < 0))) __PYX_ERR(4, 2186, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2187
 *                 r = row[3*j + 2]
 *                 a[j] = row[3*j] - r
 *                 b[j] = -row[3*j + 1] + r             # <<<<<<<<<<<<<<
 *                 c *= -1 if r % 2 else 1
 *             rect.append( (a, b, c) )
*/
      __pyx_t_2 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_j, 3, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_row, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_12, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely((PyObject_SetItem(__pyx_v_b, __pyx_v_j, __pyx_t_2) < 0))) __PYX_ERR(4, 2187, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2188
 *                 a[j] = row[3*j] - r
 *                 b[j] = -row[3*j + 1] + r
 *                 c *= -1 if r % 2 else 1             # <<<<<<<<<<<<<<
 *             rect.append( (a, b, c) )
 *         return rect
*/
      __pyx_t_12 = __Pyx_PyLong_RemainderObjC(__pyx_v_r, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2188, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
        __pyx_t_2 = __pyx_mstate_global->__pyx_int_neg_1;
      } else {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
        __pyx_t_2 = __pyx_mstate_global->__pyx_int_1;
      }
      __pyx_t_12 = PyNumber_InPlaceMultiply(__pyx_v_c, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "cython/core/triangulation.pyx":2184
 *             a, b = [0,]*n, [0,]*n
 *             c = 1
 *             for j in range(n):             # <<<<<<<<<<<<<<
 *                 r = row[3*j + 2]
 *                 a[j] = row[3*j] - r
*/
    }
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cython/core/triangulation.pyx":2189
 *                 b[j] = -row[3*j + 1] + r
 *                 c *= -1 if r % 2 else 1
 *             rect.append( (a, b, c) )             # <<<<<<<<<<<<<<
 *         return rect
 * 
*/
    __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 2189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_INCREF(__pyx_v_a);
    __Pyx_GIVEREF(__pyx_v_a);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_a) != (0)) __PYX_ERR(4, 2189, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_b) != (0)) __PYX_ERR(4, 2189, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_c) != (0)) __PYX_ERR(4, 2189, __pyx_L1_error);
    __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_rect, __pyx_t_13); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(4, 2189, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cython/core/triangulation.pyx":2180
 *                              "'rect' forms only.")
 *         rect = []
 *         for row in eqns:             # <<<<<<<<<<<<<<
 *             n = self.num_tetrahedra()
 *             a, b = [0,]*n, [0,]*n
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2190
 *                 c *= -1 if r % 2 else 1
 *             rect.append( (a, b, c) )
 *         return rect             # <<<<<<<<<<<<<<
 * 
 *     cdef big_homology(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rect);
  __pyx_r = __pyx_v_rect;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2108
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)
 * 
 *     def gluing_equations(self,form='log'):             # <<<<<<<<<<<<<<
 *         """
 *         In the default mode, this function returns a matrix with rows
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.gluing_equations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_eqns);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_cusp_info);
  __Pyx_XDECREF(__pyx_v_to_do);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_rect);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2192
 *         return rect
 * 
 *     cdef big_homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an AbelianGroup representing the first integral
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_big_homology(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_v_relation_matrix = 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("big_homology", 0);

  /* "cython/core/triangulation.pyx":2204
 *         """
 * 
 *         relation_matrix = self.c_presentation_matrix()             # <<<<<<<<<<<<<<
 *         return AbelianGroup(relation_matrix.simplified_matrix())
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->c_presentation_matrix(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_relation_matrix = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2205
 * 
 *         relation_matrix = self.c_presentation_matrix()
 *         return AbelianGroup(relation_matrix.simplified_matrix())             # <<<<<<<<<<<<<<
 * 
 *     cdef c_presentation_matrix(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup); 
  __pyx_t_5 = __pyx_v_relation_matrix;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_simplified_matrix, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2205, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2192
 *         return rect
 * 
 *     cdef big_homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an AbelianGroup representing the first integral
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.big_homology", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_relation_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2207
 *         return AbelianGroup(relation_matrix.simplified_matrix())
 * 
 *     cdef c_presentation_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         See _presentation_matrix.
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_c_presentation_matrix(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  int __pyx_v_num_generators;
  EdgeClass *__pyx_v_edge;
  PositionedTet __pyx_v_ptet;
  PositionedTet __pyx_v_ptet0;
  GeneratorStatus __pyx_v_status;
  Tetrahedron *__pyx_v_tet;
  VertexIndex __pyx_v_vertex;
  FaceIndex __pyx_v_side;
  Orientation __pyx_v_orientation;
  int __pyx_v_row;
  int __pyx_v_column;
  int __pyx_v_num_edges;
  int __pyx_v_m;
  int __pyx_v_l;
  struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_relation_matrix = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  EdgeClass *__pyx_t_8;
  Tetrahedron *__pyx_t_9;
  VertexIndex __pyx_t_10;
  FaceIndex __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Orientation __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_presentation_matrix", 0);

  /* "cython/core/triangulation.pyx":2212
 *         """
 * 
 *         if not all_Dehn_coefficients_are_integers(self.c_triangulation):             # <<<<<<<<<<<<<<
 *             raise ValueError('All Dehn filling coefficients must be integers')
 *         choose_generators(self.c_triangulation, 0, 0)
*/
  __pyx_t_1 = (!(all_Dehn_coefficients_are_integers(__pyx_v_self->c_triangulation) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2213
 * 
 *         if not all_Dehn_coefficients_are_integers(self.c_triangulation):
 *             raise ValueError('All Dehn filling coefficients must be integers')             # <<<<<<<<<<<<<<
 *         choose_generators(self.c_triangulation, 0, 0)
 *         num_generators = self.c_triangulation.num_generators
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_All_Dehn_filling_coefficients_mu};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 2213, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2212
 *         """
 * 
 *         if not all_Dehn_coefficients_are_integers(self.c_triangulation):             # <<<<<<<<<<<<<<
 *             raise ValueError('All Dehn filling coefficients must be integers')
 *         choose_generators(self.c_triangulation, 0, 0)
*/
  }

  /* "cython/core/triangulation.pyx":2214
 *         if not all_Dehn_coefficients_are_integers(self.c_triangulation):
 *             raise ValueError('All Dehn filling coefficients must be integers')
 *         choose_generators(self.c_triangulation, 0, 0)             # <<<<<<<<<<<<<<
 *         num_generators = self.c_triangulation.num_generators
 *         cdef EdgeClass* edge
*/
  choose_generators(__pyx_v_self->c_triangulation, 0, 0);

  /* "cython/core/triangulation.pyx":2215
 *             raise ValueError('All Dehn filling coefficients must be integers')
 *         choose_generators(self.c_triangulation, 0, 0)
 *         num_generators = self.c_triangulation.num_generators             # <<<<<<<<<<<<<<
 *         cdef EdgeClass* edge
 *         cdef PositionedTet ptet, ptet0
*/
  __pyx_t_6 = __pyx_v_self->c_triangulation->num_generators;
  __pyx_v_num_generators = __pyx_t_6;

  /* "cython/core/triangulation.pyx":2224
 *         cdef Orientation orientation
 *         cdef int row, column, num_edges, m, l
 *         relation_matrix = PresentationMatrix(0, num_generators)             # <<<<<<<<<<<<<<
 *         edge = self.c_triangulation.edge_list_begin.next
 *         # find the edge relations
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix); 
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_num_generators); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_0, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2224, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_relation_matrix = ((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2225
 *         cdef int row, column, num_edges, m, l
 *         relation_matrix = PresentationMatrix(0, num_generators)
 *         edge = self.c_triangulation.edge_list_begin.next             # <<<<<<<<<<<<<<
 *         # find the edge relations
 *         while edge != &(self.c_triangulation.edge_list_end):
*/
  __pyx_t_8 = __pyx_v_self->c_triangulation->edge_list_begin.next;
  __pyx_v_edge = __pyx_t_8;

  /* "cython/core/triangulation.pyx":2227
 *         edge = self.c_triangulation.edge_list_begin.next
 *         # find the edge relations
 *         while edge != &(self.c_triangulation.edge_list_end):             # <<<<<<<<<<<<<<
 *             row = relation_matrix.rows
 *             relation_matrix.add_rows(1)
*/
  while (1) {
    __pyx_t_1 = (__pyx_v_edge != (&__pyx_v_self->c_triangulation->edge_list_end));
    if (!__pyx_t_1) break;

    /* "cython/core/triangulation.pyx":2228
 *         # find the edge relations
 *         while edge != &(self.c_triangulation.edge_list_end):
 *             row = relation_matrix.rows             # <<<<<<<<<<<<<<
 *             relation_matrix.add_rows(1)
 *             set_left_edge(edge, &ptet0)
*/
    __pyx_t_6 = __pyx_v_relation_matrix->rows;
    __pyx_v_row = __pyx_t_6;

    /* "cython/core/triangulation.pyx":2229
 *         while edge != &(self.c_triangulation.edge_list_end):
 *             row = relation_matrix.rows
 *             relation_matrix.add_rows(1)             # <<<<<<<<<<<<<<
 *             set_left_edge(edge, &ptet0)
 *             ptet = ptet0
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_relation_matrix);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add_rows, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2230
 *             row = relation_matrix.rows
 *             relation_matrix.add_rows(1)
 *             set_left_edge(edge, &ptet0)             # <<<<<<<<<<<<<<
 *             ptet = ptet0
 *             while True:
*/
    set_left_edge(__pyx_v_edge, (&__pyx_v_ptet0));

    /* "cython/core/triangulation.pyx":2231
 *             relation_matrix.add_rows(1)
 *             set_left_edge(edge, &ptet0)
 *             ptet = ptet0             # <<<<<<<<<<<<<<
 *             while True:
 *                 column = ptet.tet.generator_index[ptet.near_face]
*/
    __pyx_v_ptet = __pyx_v_ptet0;

    /* "cython/core/triangulation.pyx":2232
 *             set_left_edge(edge, &ptet0)
 *             ptet = ptet0
 *             while True:             # <<<<<<<<<<<<<<
 *                 column = ptet.tet.generator_index[ptet.near_face]
 *                 status = ptet.tet.generator_status[ptet.near_face]
*/
    while (1) {

      /* "cython/core/triangulation.pyx":2233
 *             ptet = ptet0
 *             while True:
 *                 column = ptet.tet.generator_index[ptet.near_face]             # <<<<<<<<<<<<<<
 *                 status = ptet.tet.generator_status[ptet.near_face]
 *                 if status == outbound_generator:
*/
      __pyx_v_column = (__pyx_v_ptet.tet->generator_index[__pyx_v_ptet.near_face]);

      /* "cython/core/triangulation.pyx":2234
 *             while True:
 *                 column = ptet.tet.generator_index[ptet.near_face]
 *                 status = ptet.tet.generator_status[ptet.near_face]             # <<<<<<<<<<<<<<
 *                 if status == outbound_generator:
 *                     relation_matrix[row, column] += 1
*/
      __pyx_v_status = (__pyx_v_ptet.tet->generator_status[__pyx_v_ptet.near_face]);

      /* "cython/core/triangulation.pyx":2235
 *                 column = ptet.tet.generator_index[ptet.near_face]
 *                 status = ptet.tet.generator_status[ptet.near_face]
 *                 if status == outbound_generator:             # <<<<<<<<<<<<<<
 *                     relation_matrix[row, column] += 1
 *                 elif status == inbound_generator:
*/
      __pyx_t_1 = (__pyx_v_status == outbound_generator);
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2236
 *                 status = ptet.tet.generator_status[ptet.near_face]
 *                 if status == outbound_generator:
 *                     relation_matrix[row, column] += 1             # <<<<<<<<<<<<<<
 *                 elif status == inbound_generator:
 *                     relation_matrix[row, column] -= 1
*/
        __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_2);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(4, 2236, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3) != (0)) __PYX_ERR(4, 2236, __pyx_L1_error);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_7, __pyx_t_2) < 0))) __PYX_ERR(4, 2236, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cython/core/triangulation.pyx":2235
 *                 column = ptet.tet.generator_index[ptet.near_face]
 *                 status = ptet.tet.generator_status[ptet.near_face]
 *                 if status == outbound_generator:             # <<<<<<<<<<<<<<
 *                     relation_matrix[row, column] += 1
 *                 elif status == inbound_generator:
*/
        goto __pyx_L8;
      }

      /* "cython/core/triangulation.pyx":2237
 *                 if status == outbound_generator:
 *                     relation_matrix[row, column] += 1
 *                 elif status == inbound_generator:             # <<<<<<<<<<<<<<
 *                     relation_matrix[row, column] -= 1
 *                 elif status != not_a_generator:
*/
      __pyx_t_1 = (__pyx_v_status == inbound_generator);
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2238
 *                     relation_matrix[row, column] += 1
 *                 elif status == inbound_generator:
 *                     relation_matrix[row, column] -= 1             # <<<<<<<<<<<<<<
 *                 elif status != not_a_generator:
 *                     raise RuntimeError('Invalid generator status')
*/
        __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_row); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_column); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(4, 2238, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_2);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(4, 2238, __pyx_L1_error);
        __pyx_t_7 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyLong_SubtractObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_3, __pyx_t_7) < 0))) __PYX_ERR(4, 2238, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cython/core/triangulation.pyx":2237
 *                 if status == outbound_generator:
 *                     relation_matrix[row, column] += 1
 *                 elif status == inbound_generator:             # <<<<<<<<<<<<<<
 *                     relation_matrix[row, column] -= 1
 *                 elif status != not_a_generator:
*/
        goto __pyx_L8;
      }

      /* "cython/core/triangulation.pyx":2239
 *                 elif status == inbound_generator:
 *                     relation_matrix[row, column] -= 1
 *                 elif status != not_a_generator:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('Invalid generator status')
 *                 veer_left(&ptet)
*/
      __pyx_t_1 = (__pyx_v_status != not_a_generator);
      if (unlikely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2240
 *                     relation_matrix[row, column] -= 1
 *                 elif status != not_a_generator:
 *                     raise RuntimeError('Invalid generator status')             # <<<<<<<<<<<<<<
 *                 veer_left(&ptet)
 *                 if same_positioned_tet(&ptet, &ptet0):
*/
        __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_builtin_RuntimeError);
        __pyx_t_2 = __pyx_builtin_RuntimeError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_Invalid_generator_status};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2240, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(4, 2240, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":2239
 *                 elif status == inbound_generator:
 *                     relation_matrix[row, column] -= 1
 *                 elif status != not_a_generator:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('Invalid generator status')
 *                 veer_left(&ptet)
*/
      }
      __pyx_L8:;

      /* "cython/core/triangulation.pyx":2241
 *                 elif status != not_a_generator:
 *                     raise RuntimeError('Invalid generator status')
 *                 veer_left(&ptet)             # <<<<<<<<<<<<<<
 *                 if same_positioned_tet(&ptet, &ptet0):
 *                     break
*/
      veer_left((&__pyx_v_ptet));

      /* "cython/core/triangulation.pyx":2242
 *                     raise RuntimeError('Invalid generator status')
 *                 veer_left(&ptet)
 *                 if same_positioned_tet(&ptet, &ptet0):             # <<<<<<<<<<<<<<
 *                     break
 *             row += 1
*/
      __pyx_t_1 = (same_positioned_tet((&__pyx_v_ptet), (&__pyx_v_ptet0)) != 0);
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2243
 *                 veer_left(&ptet)
 *                 if same_positioned_tet(&ptet, &ptet0):
 *                     break             # <<<<<<<<<<<<<<
 *             row += 1
 *             edge = edge.next
*/
        goto __pyx_L7_break;

        /* "cython/core/triangulation.pyx":2242
 *                     raise RuntimeError('Invalid generator status')
 *                 veer_left(&ptet)
 *                 if same_positioned_tet(&ptet, &ptet0):             # <<<<<<<<<<<<<<
 *                     break
 *             row += 1
*/
      }
    }
    __pyx_L7_break:;

    /* "cython/core/triangulation.pyx":2244
 *                 if same_positioned_tet(&ptet, &ptet0):
 *                     break
 *             row += 1             # <<<<<<<<<<<<<<
 *             edge = edge.next
 *         # find the cusp relations
*/
    __pyx_v_row = (__pyx_v_row + 1);

    /* "cython/core/triangulation.pyx":2245
 *                     break
 *             row += 1
 *             edge = edge.next             # <<<<<<<<<<<<<<
 *         # find the cusp relations
 *         num_edges = relation_matrix.rows
*/
    __pyx_t_8 = __pyx_v_edge->next;
    __pyx_v_edge = __pyx_t_8;
  }

  /* "cython/core/triangulation.pyx":2247
 *             edge = edge.next
 *         # find the cusp relations
 *         num_edges = relation_matrix.rows             # <<<<<<<<<<<<<<
 *         relation_matrix.add_rows(self.num_cusps())
 *         tet = self.c_triangulation.tet_list_begin.next
*/
  __pyx_t_6 = __pyx_v_relation_matrix->rows;
  __pyx_v_num_edges = __pyx_t_6;

  /* "cython/core/triangulation.pyx":2248
 *         # find the cusp relations
 *         num_edges = relation_matrix.rows
 *         relation_matrix.add_rows(self.num_cusps())             # <<<<<<<<<<<<<<
 *         tet = self.c_triangulation.tet_list_begin.next
 *         while tet != &(self.c_triangulation.tet_list_end):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_relation_matrix);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add_rows, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2249
 *         num_edges = relation_matrix.rows
 *         relation_matrix.add_rows(self.num_cusps())
 *         tet = self.c_triangulation.tet_list_begin.next             # <<<<<<<<<<<<<<
 *         while tet != &(self.c_triangulation.tet_list_end):
 *             for vertex in range(4):
*/
  __pyx_t_9 = __pyx_v_self->c_triangulation->tet_list_begin.next;
  __pyx_v_tet = __pyx_t_9;

  /* "cython/core/triangulation.pyx":2250
 *         relation_matrix.add_rows(self.num_cusps())
 *         tet = self.c_triangulation.tet_list_begin.next
 *         while tet != &(self.c_triangulation.tet_list_end):             # <<<<<<<<<<<<<<
 *             for vertex in range(4):
 *                 if tet.cusp[vertex].is_complete:
*/
  while (1) {
    __pyx_t_1 = (__pyx_v_tet != (&__pyx_v_self->c_triangulation->tet_list_end));
    if (!__pyx_t_1) break;

    /* "cython/core/triangulation.pyx":2251
 *         tet = self.c_triangulation.tet_list_begin.next
 *         while tet != &(self.c_triangulation.tet_list_end):
 *             for vertex in range(4):             # <<<<<<<<<<<<<<
 *                 if tet.cusp[vertex].is_complete:
 *                     continue
*/
    for (__pyx_t_10 = 0; __pyx_t_10 < 4; __pyx_t_10+=1) {
      __pyx_v_vertex = __pyx_t_10;

      /* "cython/core/triangulation.pyx":2252
 *         while tet != &(self.c_triangulation.tet_list_end):
 *             for vertex in range(4):
 *                 if tet.cusp[vertex].is_complete:             # <<<<<<<<<<<<<<
 *                     continue
 *                 for side in range(4):
*/
      __pyx_t_1 = ((__pyx_v_tet->cusp[__pyx_v_vertex])->is_complete != 0);
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2253
 *             for vertex in range(4):
 *                 if tet.cusp[vertex].is_complete:
 *                     continue             # <<<<<<<<<<<<<<
 *                 for side in range(4):
 *                     if side == vertex:
*/
        goto __pyx_L12_continue;

        /* "cython/core/triangulation.pyx":2252
 *         while tet != &(self.c_triangulation.tet_list_end):
 *             for vertex in range(4):
 *                 if tet.cusp[vertex].is_complete:             # <<<<<<<<<<<<<<
 *                     continue
 *                 for side in range(4):
*/
      }

      /* "cython/core/triangulation.pyx":2254
 *                 if tet.cusp[vertex].is_complete:
 *                     continue
 *                 for side in range(4):             # <<<<<<<<<<<<<<
 *                     if side == vertex:
 *                         continue
*/
      for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
        __pyx_v_side = __pyx_t_11;

        /* "cython/core/triangulation.pyx":2255
 *                     continue
 *                 for side in range(4):
 *                     if side == vertex:             # <<<<<<<<<<<<<<
 *                         continue
 *                     if tet.generator_status[side] != inbound_generator:
*/
        __pyx_t_1 = (__pyx_v_side == __pyx_v_vertex);
        if (__pyx_t_1) {

          /* "cython/core/triangulation.pyx":2256
 *                 for side in range(4):
 *                     if side == vertex:
 *                         continue             # <<<<<<<<<<<<<<
 *                     if tet.generator_status[side] != inbound_generator:
 *                         continue
*/
          goto __pyx_L15_continue;

          /* "cython/core/triangulation.pyx":2255
 *                     continue
 *                 for side in range(4):
 *                     if side == vertex:             # <<<<<<<<<<<<<<
 *                         continue
 *                     if tet.generator_status[side] != inbound_generator:
*/
        }

        /* "cython/core/triangulation.pyx":2257
 *                     if side == vertex:
 *                         continue
 *                     if tet.generator_status[side] != inbound_generator:             # <<<<<<<<<<<<<<
 *                         continue
 *                     for orientation in (right_handed, left_handed):
*/
        __pyx_t_1 = ((__pyx_v_tet->generator_status[__pyx_v_side]) != inbound_generator);
        if (__pyx_t_1) {

          /* "cython/core/triangulation.pyx":2258
 *                         continue
 *                     if tet.generator_status[side] != inbound_generator:
 *                         continue             # <<<<<<<<<<<<<<
 *                     for orientation in (right_handed, left_handed):
 *                         row = num_edges + tet.cusp[vertex].index
*/
          goto __pyx_L15_continue;

          /* "cython/core/triangulation.pyx":2257
 *                     if side == vertex:
 *                         continue
 *                     if tet.generator_status[side] != inbound_generator:             # <<<<<<<<<<<<<<
 *                         continue
 *                     for orientation in (right_handed, left_handed):
*/
        }

        /* "cython/core/triangulation.pyx":2259
 *                     if tet.generator_status[side] != inbound_generator:
 *                         continue
 *                     for orientation in (right_handed, left_handed):             # <<<<<<<<<<<<<<
 *                         row = num_edges + tet.cusp[vertex].index
 *                         column = tet.generator_index[side]
*/
        __pyx_t_3 = __Pyx_PyLong_From_Orientation(right_handed); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyLong_From_Orientation(left_handed); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3) != (0)) __PYX_ERR(4, 2259, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7) != (0)) __PYX_ERR(4, 2259, __pyx_L1_error);
        __pyx_t_3 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7);
        __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        for (;;) {
          if (__pyx_t_12 >= 2) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12);
          #endif
          ++__pyx_t_12;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2259, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyLong_As_Orientation(__pyx_t_2); if (unlikely((__pyx_t_13 == ((Orientation)-1)) && PyErr_Occurred())) __PYX_ERR(4, 2259, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_orientation = __pyx_t_13;

          /* "cython/core/triangulation.pyx":2260
 *                         continue
 *                     for orientation in (right_handed, left_handed):
 *                         row = num_edges + tet.cusp[vertex].index             # <<<<<<<<<<<<<<
 *                         column = tet.generator_index[side]
 *                         m = <int>tet.cusp[vertex].m
*/
          __pyx_v_row = (__pyx_v_num_edges + (__pyx_v_tet->cusp[__pyx_v_vertex])->index);

          /* "cython/core/triangulation.pyx":2261
 *                     for orientation in (right_handed, left_handed):
 *                         row = num_edges + tet.cusp[vertex].index
 *                         column = tet.generator_index[side]             # <<<<<<<<<<<<<<
 *                         m = <int>tet.cusp[vertex].m
 *                         l = <int>tet.cusp[vertex].l
*/
          __pyx_v_column = (__pyx_v_tet->generator_index[__pyx_v_side]);

          /* "cython/core/triangulation.pyx":2262
 *                         row = num_edges + tet.cusp[vertex].index
 *                         column = tet.generator_index[side]
 *                         m = <int>tet.cusp[vertex].m             # <<<<<<<<<<<<<<
 *                         l = <int>tet.cusp[vertex].l
 *                         relation_matrix[row, column] += (
*/
          __pyx_v_m = ((int)(__pyx_v_tet->cusp[__pyx_v_vertex])->m);

          /* "cython/core/triangulation.pyx":2263
 *                         column = tet.generator_index[side]
 *                         m = <int>tet.cusp[vertex].m
 *                         l = <int>tet.cusp[vertex].l             # <<<<<<<<<<<<<<
 *                         relation_matrix[row, column] += (
 *                             m * tet.curve[0][orientation][vertex][side]
*/
          __pyx_v_l = ((int)(__pyx_v_tet->cusp[__pyx_v_vertex])->l);

          /* "cython/core/triangulation.pyx":2264
 *                         m = <int>tet.cusp[vertex].m
 *                         l = <int>tet.cusp[vertex].l
 *                         relation_matrix[row, column] += (             # <<<<<<<<<<<<<<
 *                             m * tet.curve[0][orientation][vertex][side]
 *                             + l * tet.curve[1][orientation][vertex][side])
*/
          __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2) != (0)) __PYX_ERR(4, 2264, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_3);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(4, 2264, __pyx_L1_error);
          __pyx_t_2 = 0;
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);

          /* "cython/core/triangulation.pyx":2266
 *                         relation_matrix[row, column] += (
 *                             m * tet.curve[0][orientation][vertex][side]
 *                             + l * tet.curve[1][orientation][vertex][side])             # <<<<<<<<<<<<<<
 *             tet = tet.next
 * 
*/
          __pyx_t_2 = __Pyx_PyLong_From_int(((__pyx_v_m * ((((__pyx_v_tet->curve[0])[__pyx_v_orientation])[__pyx_v_vertex])[__pyx_v_side])) + (__pyx_v_l * ((((__pyx_v_tet->curve[1])[__pyx_v_orientation])[__pyx_v_vertex])[__pyx_v_side])))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);

          /* "cython/core/triangulation.pyx":2264
 *                         m = <int>tet.cusp[vertex].m
 *                         l = <int>tet.cusp[vertex].l
 *                         relation_matrix[row, column] += (             # <<<<<<<<<<<<<<
 *                             m * tet.curve[0][orientation][vertex][side]
 *                             + l * tet.curve[1][orientation][vertex][side])
*/
          __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 2264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_4, __pyx_t_14) < 0))) __PYX_ERR(4, 2264, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "cython/core/triangulation.pyx":2259
 *                     if tet.generator_status[side] != inbound_generator:
 *                         continue
 *                     for orientation in (right_handed, left_handed):             # <<<<<<<<<<<<<<
 *                         row = num_edges + tet.cusp[vertex].index
 *                         column = tet.generator_index[side]
*/
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_L15_continue:;
      }
      __pyx_L12_continue:;
    }

    /* "cython/core/triangulation.pyx":2267
 *                             m * tet.curve[0][orientation][vertex][side]
 *                             + l * tet.curve[1][orientation][vertex][side])
 *             tet = tet.next             # <<<<<<<<<<<<<<
 * 
 *         return relation_matrix
*/
    __pyx_t_9 = __pyx_v_tet->next;
    __pyx_v_tet = __pyx_t_9;
  }

  /* "cython/core/triangulation.pyx":2269
 *             tet = tet.next
 * 
 *         return relation_matrix             # <<<<<<<<<<<<<<
 * 
 *     def _presentation_matrix(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_relation_matrix);
  __pyx_r = ((PyObject *)__pyx_v_relation_matrix);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2207
 *         return AbelianGroup(relation_matrix.simplified_matrix())
 * 
 *     cdef c_presentation_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         See _presentation_matrix.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.c_presentation_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_relation_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2271
 *         return relation_matrix
 * 
 *     def _presentation_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Computes the presentation matrix for the first integral
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_121_presentation_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_8SnapPyHP_13Triangulation_120_presentation_matrix, "\n        Computes the presentation matrix for the first integral\n        homology group of the underlying (Dehn filled) manifold.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_121_presentation_matrix = {"_presentation_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_121_presentation_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_120_presentation_matrix};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_121_presentation_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("_presentation_matrix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_presentation_matrix", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_presentation_matrix", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_120_presentation_matrix(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_120_presentation_matrix(struct __pyx_obj_8SnapPyHP_Triangulation *__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("_presentation_matrix", 0);

  /* "cython/core/triangulation.pyx":2276
 *         homology group of the underlying (Dehn filled) manifold.
 *         """
 *         return self.c_presentation_matrix()             # <<<<<<<<<<<<<<
 * 
 *     cdef csmall_homology(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->c_presentation_matrix(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2271
 *         return relation_matrix
 * 
 *     def _presentation_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Computes the presentation matrix for the first integral
*/

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

/* "cython/core/triangulation.pyx":2278
 *         return self.c_presentation_matrix()
 * 
 *     cdef csmall_homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an AbelianGroup representing the first integral
*/

static PyObject *__pyx_f_8SnapPyHP_13Triangulation_csmall_homology(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  RelationMatrix __pyx_v_R;
  int __pyx_v_n;
  PyObject *__pyx_v_relations = NULL;
  long __pyx_v_m;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csmall_homology", 0);

  /* "cython/core/triangulation.pyx":2292
 *         cdef int n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         homology_presentation(self.c_triangulation, &R)
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2293
 * 
 *         if self.c_triangulation is NULL:
 *             return AbelianGroup()             # <<<<<<<<<<<<<<
 *         homology_presentation(self.c_triangulation, &R)
 *         relations = []
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
    __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup); 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2293, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2292
 *         cdef int n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         homology_presentation(self.c_triangulation, &R)
*/
  }

  /* "cython/core/triangulation.pyx":2294
 *         if self.c_triangulation is NULL:
 *             return AbelianGroup()
 *         homology_presentation(self.c_triangulation, &R)             # <<<<<<<<<<<<<<
 *         relations = []
 *         if R.relations != NULL:
*/
  homology_presentation(__pyx_v_self->c_triangulation, (&__pyx_v_R)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2294, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2295
 *             return AbelianGroup()
 *         homology_presentation(self.c_triangulation, &R)
 *         relations = []             # <<<<<<<<<<<<<<
 *         if R.relations != NULL:
 *             if R.num_rows == 0:
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_relations = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2296
 *         homology_presentation(self.c_triangulation, &R)
 *         relations = []
 *         if R.relations != NULL:             # <<<<<<<<<<<<<<
 *             if R.num_rows == 0:
 *                 relations = [0,] * R.num_columns
*/
  __pyx_t_1 = (__pyx_v_R.relations != NULL);
  if (likely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2297
 *         relations = []
 *         if R.relations != NULL:
 *             if R.num_rows == 0:             # <<<<<<<<<<<<<<
 *                 relations = [0,] * R.num_columns
 *             else:
*/
    __pyx_t_1 = (__pyx_v_R.num_rows == 0);
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2298
 *         if R.relations != NULL:
 *             if R.num_rows == 0:
 *                 relations = [0,] * R.num_columns             # <<<<<<<<<<<<<<
 *             else:
 *                 for m from 0 <= m < R.num_rows:
*/
      __pyx_t_2 = PyList_New(1 * ((__pyx_v_R.num_columns<0) ? 0:__pyx_v_R.num_columns)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      { Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < __pyx_v_R.num_columns; __pyx_temp++) {
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(4, 2298, __pyx_L1_error);
        }
      }
      __Pyx_DECREF_SET(__pyx_v_relations, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2297
 *         relations = []
 *         if R.relations != NULL:
 *             if R.num_rows == 0:             # <<<<<<<<<<<<<<
 *                 relations = [0,] * R.num_columns
 *             else:
*/
      goto __pyx_L5;
    }

    /* "cython/core/triangulation.pyx":2300
 *                 relations = [0,] * R.num_columns
 *             else:
 *                 for m from 0 <= m < R.num_rows:             # <<<<<<<<<<<<<<
 *                     row = []
 *                     for n from 0 <= n < R.num_columns:
*/
    /*else*/ {
      __pyx_t_6 = __pyx_v_R.num_rows;
      for (__pyx_v_m = 0; __pyx_v_m < __pyx_t_6; __pyx_v_m++) {

        /* "cython/core/triangulation.pyx":2301
 *             else:
 *                 for m from 0 <= m < R.num_rows:
 *                     row = []             # <<<<<<<<<<<<<<
 *                     for n from 0 <= n < R.num_columns:
 *                         row.append(R.relations[m][n])
*/
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2302
 *                 for m from 0 <= m < R.num_rows:
 *                     row = []
 *                     for n from 0 <= n < R.num_columns:             # <<<<<<<<<<<<<<
 *                         row.append(R.relations[m][n])
 *                     relations.append(row)
*/
        __pyx_t_7 = __pyx_v_R.num_columns;
        for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_7; __pyx_v_n++) {

          /* "cython/core/triangulation.pyx":2303
 *                     row = []
 *                     for n from 0 <= n < R.num_columns:
 *                         row.append(R.relations[m][n])             # <<<<<<<<<<<<<<
 *                     relations.append(row)
 *                 free_relations(&R)
*/
          __pyx_t_2 = __Pyx_PyLong_From_MatrixEntry(((__pyx_v_R.relations[__pyx_v_m])[__pyx_v_n])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2303, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_row, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 2303, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }

        /* "cython/core/triangulation.pyx":2304
 *                     for n from 0 <= n < R.num_columns:
 *                         row.append(R.relations[m][n])
 *                     relations.append(row)             # <<<<<<<<<<<<<<
 *                 free_relations(&R)
 *         else:
*/
        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_relations, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 2304, __pyx_L1_error)
      }

      /* "cython/core/triangulation.pyx":2305
 *                         row.append(R.relations[m][n])
 *                     relations.append(row)
 *                 free_relations(&R)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("The SnapPea kernel couldn't compute "
*/
      free_relations((&__pyx_v_R)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2305, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "cython/core/triangulation.pyx":2296
 *         homology_presentation(self.c_triangulation, &R)
 *         relations = []
 *         if R.relations != NULL:             # <<<<<<<<<<<<<<
 *             if R.num_rows == 0:
 *                 relations = [0,] * R.num_columns
*/
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":2307
 *                 free_relations(&R)
 *         else:
 *             raise RuntimeError("The SnapPea kernel couldn't compute "             # <<<<<<<<<<<<<<
 *                                "the homology presentation matrix")
 *         return AbelianGroup(relations)
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_SnapPea_kernel_couldn_t_comp};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 2307, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "cython/core/triangulation.pyx":2309
 *             raise RuntimeError("The SnapPea kernel couldn't compute "
 *                                "the homology presentation matrix")
 *         return AbelianGroup(relations)             # <<<<<<<<<<<<<<
 * 
 *     def homology(self) -> AbelianGroup:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup); 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_relations};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2309, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2278
 *         return self.c_presentation_matrix()
 * 
 *     cdef csmall_homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an AbelianGroup representing the first integral
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.csmall_homology", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_relations);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2311
 *         return AbelianGroup(relations)
 * 
 *     def homology(self) -> AbelianGroup:             # <<<<<<<<<<<<<<
 *         """
 *         Returns an :class:`AbelianGroup` representing the first integral
*/

/* Python wrapper */
static struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_pw_8SnapPyHP_13Triangulation_123homology(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_8SnapPyHP_13Triangulation_122homology, "\n        Returns an :class:`AbelianGroup` representing the first integral\n        homology group of the underlying (Dehn filled) manifold.\n\n        >>> M = Triangulation('m003')\n        >>> M.homology()\n        Z/5 + Z\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_123homology = {"homology", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_123homology, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_122homology};
static struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_pw_8SnapPyHP_13Triangulation_123homology(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;
  struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("homology (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("homology", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("homology", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_122homology(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_pf_8SnapPyHP_13Triangulation_122homology(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  AbelianGroup *__pyx_v_H;
  int __pyx_v_n;
  PyObject *__pyx_v_coefficient_list = NULL;
  PyObject *__pyx_v_result = NULL;
  struct __pyx_obj_8SnapPyHP_AbelianGroup *__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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  AbelianGroup *__pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("homology", 0);

  /* "cython/core/triangulation.pyx":2321
 * 
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('homology')
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/triangulation.pyx":2322
 *         """
 *         try:
 *             return self._cache.lookup('homology')             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_5 = __pyx_v_self->_cache;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_homology};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_lookup, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2322, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup))))) __PYX_ERR(4, 2322, __pyx_L3_error)
      __pyx_r = ((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/triangulation.pyx":2321
 * 
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('homology')
 *         except KeyError:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":2323
 *         try:
 *             return self._cache.lookup('homology')
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "cython/core/triangulation.pyx":2321
 * 
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('homology')
 *         except KeyError:
*/
    __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;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  }

  /* "cython/core/triangulation.pyx":2329
 *         cdef int n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
*/
  __pyx_t_8 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_8) {

    /* "cython/core/triangulation.pyx":2330
 * 
 *         if self.c_triangulation is NULL:
 *             return AbelianGroup()             # <<<<<<<<<<<<<<
 *         H = homology(self.c_triangulation)
 *         if H != NULL:
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
    __pyx_t_9 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup); 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2330, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }
    __pyx_r = ((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2329
 *         cdef int n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
*/
  }

  /* "cython/core/triangulation.pyx":2331
 *         if self.c_triangulation is NULL:
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if H != NULL:
 *             coefficient_list = []
*/
  __pyx_t_10 = homology(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2331, __pyx_L1_error)
  __pyx_v_H = __pyx_t_10;

  /* "cython/core/triangulation.pyx":2332
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
 *         if H != NULL:             # <<<<<<<<<<<<<<
 *             coefficient_list = []
 *             compress_abelian_group(H)
*/
  __pyx_t_8 = (__pyx_v_H != NULL);
  if (__pyx_t_8) {

    /* "cython/core/triangulation.pyx":2333
 *         H = homology(self.c_triangulation)
 *         if H != NULL:
 *             coefficient_list = []             # <<<<<<<<<<<<<<
 *             compress_abelian_group(H)
 *             for n from 0 <= n < H.num_torsion_coefficients:
*/
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_coefficient_list = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2334
 *         if H != NULL:
 *             coefficient_list = []
 *             compress_abelian_group(H)             # <<<<<<<<<<<<<<
 *             for n from 0 <= n < H.num_torsion_coefficients:
 *                 coefficient_list.append(H.torsion_coefficients[n])
*/
    compress_abelian_group(__pyx_v_H); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2334, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2335
 *             coefficient_list = []
 *             compress_abelian_group(H)
 *             for n from 0 <= n < H.num_torsion_coefficients:             # <<<<<<<<<<<<<<
 *                 coefficient_list.append(H.torsion_coefficients[n])
 *             free_abelian_group(H)
*/
    __pyx_t_7 = __pyx_v_H->num_torsion_coefficients;
    for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_7; __pyx_v_n++) {

      /* "cython/core/triangulation.pyx":2336
 *             compress_abelian_group(H)
 *             for n from 0 <= n < H.num_torsion_coefficients:
 *                 coefficient_list.append(H.torsion_coefficients[n])             # <<<<<<<<<<<<<<
 *             free_abelian_group(H)
 *             result = AbelianGroup(elementary_divisors=coefficient_list)
*/
      __pyx_t_4 = __Pyx_PyLong_From_long((__pyx_v_H->torsion_coefficients[__pyx_v_n])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_coefficient_list, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(4, 2336, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "cython/core/triangulation.pyx":2337
 *             for n from 0 <= n < H.num_torsion_coefficients:
 *                 coefficient_list.append(H.torsion_coefficients[n])
 *             free_abelian_group(H)             # <<<<<<<<<<<<<<
 *             result = AbelianGroup(elementary_divisors=coefficient_list)
 *         else:
*/
    free_abelian_group(__pyx_v_H); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2337, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2338
 *                 coefficient_list.append(H.torsion_coefficients[n])
 *             free_abelian_group(H)
 *             result = AbelianGroup(elementary_divisors=coefficient_list)             # <<<<<<<<<<<<<<
 *         else:
 *             try:
*/
    __pyx_t_9 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
    __pyx_t_5 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup); 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, NULL};
      __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_v_coefficient_list, __pyx_t_12, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 2338, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2338, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }
    __pyx_v_result = ((PyObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2332
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
 *         if H != NULL:             # <<<<<<<<<<<<<<
 *             coefficient_list = []
 *             compress_abelian_group(H)
*/
    goto __pyx_L12;
  }

  /* "cython/core/triangulation.pyx":2340
 *             result = AbelianGroup(elementary_divisors=coefficient_list)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 result = self.csmall_homology()
 *             except RuntimeError:
*/
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      /*try:*/ {

        /* "cython/core/triangulation.pyx":2341
 *         else:
 *             try:
 *                 result = self.csmall_homology()             # <<<<<<<<<<<<<<
 *             except RuntimeError:
 *                 result = self.big_homology()
*/
        __pyx_t_4 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->csmall_homology(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2341, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_v_result = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2340
 *             result = AbelianGroup(elementary_divisors=coefficient_list)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 result = self.csmall_homology()
 *             except RuntimeError:
*/
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L20_try_end;
      __pyx_L15_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/triangulation.pyx":2342
 *             try:
 *                 result = self.csmall_homology()
 *             except RuntimeError:             # <<<<<<<<<<<<<<
 *                 result = self.big_homology()
 *         return self._cache.save(result, 'homology')
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("SnapPyHP.Triangulation.homology", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_12) < 0) __PYX_ERR(4, 2342, __pyx_L17_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_12);

        /* "cython/core/triangulation.pyx":2343
 *                 result = self.csmall_homology()
 *             except RuntimeError:
 *                 result = self.big_homology()             # <<<<<<<<<<<<<<
 *         return self._cache.save(result, 'homology')
 * 
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->big_homology(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2343, __pyx_L17_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L16_exception_handled;
      }
      goto __pyx_L17_except_error;

      /* "cython/core/triangulation.pyx":2340
 *             result = AbelianGroup(elementary_divisors=coefficient_list)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 result = self.csmall_homology()
 *             except RuntimeError:
*/
      __pyx_L17_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      goto __pyx_L1_error;
      __pyx_L16_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      __pyx_L20_try_end:;
    }
  }
  __pyx_L12:;

  /* "cython/core/triangulation.pyx":2344
 *             except RuntimeError:
 *                 result = self.big_homology()
 *         return self._cache.save(result, 'homology')             # <<<<<<<<<<<<<<
 * 
 *     def fundamental_group(
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __pyx_v_self->_cache;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_result, __pyx_mstate_global->__pyx_n_u_homology};
    __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_save, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
  }
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup))))) __PYX_ERR(4, 2344, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_t_12);
  __pyx_t_12 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2311
 *         return AbelianGroup(relations)
 * 
 *     def homology(self) -> AbelianGroup:             # <<<<<<<<<<<<<<
 *         """
 *         Returns an :class:`AbelianGroup` representing the first integral
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.homology", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_coefficient_list);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2346
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_125fundamental_group(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_8SnapPyHP_13Triangulation_124fundamental_group, "\n        Returns a :class:`FundamentalGroup` object representing the fundamental\n        group of the manifold.  If integer Dehn surgery parameters\n        have been set, then the corresponding peripheral elements are\n        killed.\n\n        >>> M = Triangulation('m004')\n        >>> G = M.fundamental_group()\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaabABBAb\n        >>> G.peripheral_curves()\n        [('ab', 'aBAbABab')]\n\n        There are four optional arguments all of which default to True:\n\n        - simplify_presentation\n        - fillings_may_affect_generators\n        - minimize_number_of_generators\n        - try_hard_to_shorten_relators\n\n        >>> M.fundamental_group(False, False, False)\n        Generators:\n           a,b,c\n        Relators:\n           CbAcB\n           BacA\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_125fundamental_group = {"fundamental_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_125fundamental_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_124fundamental_group};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_125fundamental_group(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_simplify_presentation = 0;
  PyObject *__pyx_v_fillings_may_affect_generators = 0;
  PyObject *__pyx_v_minimize_number_of_generators = 0;
  PyObject *__pyx_v_try_hard_to_shorten_relators = 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("fundamental_group (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_simplify_presentation,&__pyx_mstate_global->__pyx_n_u_fillings_may_affect_generators,&__pyx_mstate_global->__pyx_n_u_minimize_number_of_generators,&__pyx_mstate_global->__pyx_n_u_try_hard_to_shorten_relators,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2346, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fundamental_group", 0) < 0) __PYX_ERR(4, 2346, __pyx_L3_error)

      /* "cython/core/triangulation.pyx":2348
 *     def fundamental_group(
 *             self,
 *             simplify_presentation : bool = True,             # <<<<<<<<<<<<<<
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2349
 *             self,
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,             # <<<<<<<<<<<<<<
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2350
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,             # <<<<<<<<<<<<<<
 *             try_hard_to_shorten_relators : bool = True
 *             ) -> FundamentalGroup:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2351
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True             # <<<<<<<<<<<<<<
 *             ) -> FundamentalGroup:
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/triangulation.pyx":2348
 *     def fundamental_group(
 *             self,
 *             simplify_presentation : bool = True,             # <<<<<<<<<<<<<<
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2349
 *             self,
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,             # <<<<<<<<<<<<<<
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2350
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,             # <<<<<<<<<<<<<<
 *             try_hard_to_shorten_relators : bool = True
 *             ) -> FundamentalGroup:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2351
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True             # <<<<<<<<<<<<<<
 *             ) -> FundamentalGroup:
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_simplify_presentation = values[0];
    __pyx_v_fillings_may_affect_generators = values[1];
    __pyx_v_minimize_number_of_generators = values[2];
    __pyx_v_try_hard_to_shorten_relators = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fundamental_group", 0, 0, 4, __pyx_nargs); __PYX_ERR(4, 2346, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.fundamental_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_124fundamental_group(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_simplify_presentation, __pyx_v_fillings_may_affect_generators, __pyx_v_minimize_number_of_generators, __pyx_v_try_hard_to_shorten_relators);

  /* "cython/core/triangulation.pyx":2346
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_124fundamental_group(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_simplify_presentation, PyObject *__pyx_v_fillings_may_affect_generators, PyObject *__pyx_v_minimize_number_of_generators, PyObject *__pyx_v_try_hard_to_shorten_relators) {
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fundamental_group", 0);

  /* "cython/core/triangulation.pyx":2383
 *            BacA
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         args = (simplify_presentation, fillings_may_affect_generators,
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2384
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         args = (simplify_presentation, fillings_may_affect_generators,
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2384, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 2384, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2383
 *            BacA
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         args = (simplify_presentation, fillings_may_affect_generators,
*/
  }

  /* "cython/core/triangulation.pyx":2385
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         args = (simplify_presentation, fillings_may_affect_generators,             # <<<<<<<<<<<<<<
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:
*/
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_simplify_presentation);
  __Pyx_GIVEREF(__pyx_v_simplify_presentation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_simplify_presentation) != (0)) __PYX_ERR(4, 2385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_fillings_may_affect_generators);
  __Pyx_GIVEREF(__pyx_v_fillings_may_affect_generators);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fillings_may_affect_generators) != (0)) __PYX_ERR(4, 2385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_minimize_number_of_generators);
  __Pyx_GIVEREF(__pyx_v_minimize_number_of_generators);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_minimize_number_of_generators) != (0)) __PYX_ERR(4, 2385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_try_hard_to_shorten_relators);
  __Pyx_GIVEREF(__pyx_v_try_hard_to_shorten_relators);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_try_hard_to_shorten_relators) != (0)) __PYX_ERR(4, 2385, __pyx_L1_error);
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2387
 *         args = (simplify_presentation, fillings_may_affect_generators,
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/triangulation.pyx":2388
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2388, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyNumber_Add(__pyx_mstate_global->__pyx_tuple[15], __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2388, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2388, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L8_try_return;

      /* "cython/core/triangulation.pyx":2387
 *         args = (simplify_presentation, fillings_may_affect_generators,
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2389
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;

    /* "cython/core/triangulation.pyx":2387
 *         args = (simplify_presentation, fillings_may_affect_generators,
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:
*/
    __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_L8_try_return:;
    __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_L0;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
  }

  /* "cython/core/triangulation.pyx":2392
 *             pass
 * 
 *         return self._cache.save(FundamentalGroup(self, *args),             # <<<<<<<<<<<<<<
 *                                 'fundamental_group', *args)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_mstate_global->__pyx_n_u_save); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FundamentalGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(4, 2392, __pyx_L1_error);
  __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2392, __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_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(4, 2392, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fundamental_group);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fundamental_group);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_n_u_fundamental_group) != (0)) __PYX_ERR(4, 2392, __pyx_L1_error);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2393
 * 
 *         return self._cache.save(FundamentalGroup(self, *args),
 *                                 'fundamental_group', *args)             # <<<<<<<<<<<<<<
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Triangulation':
*/
  __pyx_t_2 = PyNumber_Add(__pyx_t_10, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cython/core/triangulation.pyx":2392
 *             pass
 * 
 *         return self._cache.save(FundamentalGroup(self, *args),             # <<<<<<<<<<<<<<
 *                                 'fundamental_group', *args)
 * 
*/
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2346
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.fundamental_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2395
 *                                 'fundamental_group', *args)
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Triangulation':             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`Triangulation` representing the finite cover specified
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_127cover(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_8SnapPyHP_13Triangulation_126cover, "\n        Returns a :class:`Triangulation` representing the finite cover specified\n        by a transitive permutation representation.  The representation is\n        specified by a list of permutations, one for each generator of the\n        simplified presentation of the fundamental group.  Each permutation is\n        specified as a list ``P`` such that ``set(P) == set(range(d))`` where\n        ``d`` is the degree of the cover.\n\n        >>> M = Triangulation('m004')\n        >>> N0 = M.cover([[1, 3, 0, 4, 2], [0, 2, 1, 4, 3]])\n        >>> N0.homology()\n        Z + Z + Z\n        >>> N0.cover_info()['type']\n        'irregular'\n        >>> N0.cover_info()['base']\n        'm004'\n        >>> N0.cover_info()['degree']\n        5\n\n        Within Sage the permutations can also be of type\n        ``PermutationGroupElement``, in which case they act on the set\n        ``range(1, d + 1)``.  Or, you can specify a GAP or Magma subgroup\n        of the fundamental group.  For more examples, see the docstring for\n        :meth:`Manifold.cover`.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_127cover = {"cover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_127cover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_126cover};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_127cover(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_permutation_rep = 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("cover (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_permutation_rep,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2395, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cover", 0) < 0) __PYX_ERR(4, 2395, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cover", 1, 1, 1, i); __PYX_ERR(4, 2395, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2395, __pyx_L3_error)
    }
    __pyx_v_permutation_rep = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cover", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 2395, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_126cover(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_permutation_rep);

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

/* "cython/core/triangulation.pyx":2466
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):             # <<<<<<<<<<<<<<
 *                 permutation_rep = [[x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep]
*/

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_5cover_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 2466, __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_8SnapPyHP_13Triangulation_5cover_2generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_cover_locals_genexpr, __pyx_mstate_global->__pyx_n_u_SnapPyHP); if (unlikely(!gen)) __PYX_ERR(4, 2466, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPyHP.Triangulation.cover.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_8SnapPyHP_13Triangulation_5cover_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 2466, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(4, 2466, __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(4, 2466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2466, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2466, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2466, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2466, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2466, __pyx_L1_error)
          PyErr_Clear();
        }
        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_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PermutationGroupElement); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_p, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 2466, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __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_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __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;
}

/* "cython/core/triangulation.pyx":2395
 *                                 'fundamental_group', *args)
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Triangulation':             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`Triangulation` representing the finite cover specified
*/

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_126cover(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_permutation_rep) {
  RepresentationIntoSn *__pyx_v_c_representation;
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_cover = 0;
  PyObject *__pyx_v_GG = NULL;
  PyObject *__pyx_v_coset_action = NULL;
  PyObject *__pyx_v_gap_image_gens = NULL;
  PyObject *__pyx_v_Q = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_input_type = NULL;
  PyObject *__pyx_v_G = NULL;
  Py_ssize_t __pyx_v_degree;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_9genexpr32__pyx_v_g = NULL;
  PyObject *__pyx_gb_8SnapPyHP_13Triangulation_5cover_2generator2 = 0;
  PyObject *__pyx_9genexpr34__pyx_v_perm = NULL;
  PyObject *__pyx_9genexpr35__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __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;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  RepresentationIntoSn *__pyx_t_16;
  GroupPresentation *__pyx_t_17;
  Triangulation *__pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cover", 0);
  __Pyx_INCREF(__pyx_v_permutation_rep);

  /* "cython/core/triangulation.pyx":2425
 *         cdef Triangulation cover
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         # For Sage, we need to check if we have been given some
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2426
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         # For Sage, we need to check if we have been given some
 *         # alternate inputs
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 2426, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2425
 *         cdef Triangulation cover
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         # For Sage, we need to check if we have been given some
*/
  }

  /* "cython/core/triangulation.pyx":2430
 *         # alternate inputs
 * 
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             if is_GapElement(permutation_rep):
 *                 if permutation_rep.IsSubgroupFpGroup():
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2431
 * 
 *         if _within_sage:
 *             if is_GapElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 if permutation_rep.IsSubgroupFpGroup():
 *                     GG = gap(self.fundamental_group())
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_GapElement); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_permutation_rep};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2431, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2432
 *         if _within_sage:
 *             if is_GapElement(permutation_rep):
 *                 if permutation_rep.IsSubgroupFpGroup():             # <<<<<<<<<<<<<<
 *                     GG = gap(self.fundamental_group())
 *                     coset_action = GG.FactorCosetAction(permutation_rep)
*/
      __pyx_t_3 = __pyx_v_permutation_rep;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_IsSubgroupFpGroup, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2432, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2433
 *             if is_GapElement(permutation_rep):
 *                 if permutation_rep.IsSubgroupFpGroup():
 *                     GG = gap(self.fundamental_group())             # <<<<<<<<<<<<<<
 *                     coset_action = GG.FactorCosetAction(permutation_rep)
 *                     gap_image_gens = coset_action.Image().GeneratorsOfGroup()
*/
        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gap); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2433, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2433, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2433, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_v_GG = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2434
 *                 if permutation_rep.IsSubgroupFpGroup():
 *                     GG = gap(self.fundamental_group())
 *                     coset_action = GG.FactorCosetAction(permutation_rep)             # <<<<<<<<<<<<<<
 *                     gap_image_gens = coset_action.Image().GeneratorsOfGroup()
 *                     Q = PermutationGroup(gap_image_gens)
*/
        __pyx_t_4 = __pyx_v_GG;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_permutation_rep};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_FactorCosetAction, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2434, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_v_coset_action = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2435
 *                     GG = gap(self.fundamental_group())
 *                     coset_action = GG.FactorCosetAction(permutation_rep)
 *                     gap_image_gens = coset_action.Image().GeneratorsOfGroup()             # <<<<<<<<<<<<<<
 *                     Q = PermutationGroup(gap_image_gens)
 *                     return self.cover([Q(g) for g in gap_image_gens ])
*/
        __pyx_t_3 = __pyx_v_coset_action;
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Image, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2435, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_4 = __pyx_t_6;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_GeneratorsOfGroup, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2435, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_v_gap_image_gens = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2436
 *                     coset_action = GG.FactorCosetAction(permutation_rep)
 *                     gap_image_gens = coset_action.Image().GeneratorsOfGroup()
 *                     Q = PermutationGroup(gap_image_gens)             # <<<<<<<<<<<<<<
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif (permutation_rep.IsToPermGroupHomomorphismByImages() or
*/
        __pyx_t_6 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PermutationGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_6);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_gap_image_gens};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2436, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_v_Q = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2437
 *                     gap_image_gens = coset_action.Image().GeneratorsOfGroup()
 *                     Q = PermutationGroup(gap_image_gens)
 *                     return self.cover([Q(g) for g in gap_image_gens ])             # <<<<<<<<<<<<<<
 *                 elif (permutation_rep.IsToPermGroupHomomorphismByImages() or
 *                       permutation_rep.IsCompositionMappingRep()):
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_4);
        { /* enter inner scope */
          __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2437, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (likely(PyList_CheckExact(__pyx_v_gap_image_gens)) || PyTuple_CheckExact(__pyx_v_gap_image_gens)) {
            __pyx_t_3 = __pyx_v_gap_image_gens; __Pyx_INCREF(__pyx_t_3);
            __pyx_t_8 = 0;
            __pyx_t_9 = NULL;
          } else {
            __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_gap_image_gens); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2437, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2437, __pyx_L9_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_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2437, __pyx_L9_error)
                  #endif
                  if (__pyx_t_8 >= __pyx_temp) break;
                }
                __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_8);
                ++__pyx_t_8;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2437, __pyx_L9_error)
                  #endif
                  if (__pyx_t_8 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8));
                #else
                __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8);
                #endif
                ++__pyx_t_8;
              }
              if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2437, __pyx_L9_error)
            } else {
              __pyx_t_7 = __pyx_t_9(__pyx_t_3);
              if (unlikely(!__pyx_t_7)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2437, __pyx_L9_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_g, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_10 = NULL;
            __Pyx_INCREF(__pyx_v_Q);
            __pyx_t_11 = __pyx_v_Q; 
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_11))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
              assert(__pyx_t_10);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr32__pyx_v_g};
              __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2437, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_7);
            }
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_7))) __PYX_ERR(4, 2437, __pyx_L9_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_g); __pyx_9genexpr32__pyx_v_g = 0;
          goto __pyx_L13_exit_scope;
          __pyx_L9_error:;
          __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_g); __pyx_9genexpr32__pyx_v_g = 0;
          goto __pyx_L1_error;
          __pyx_L13_exit_scope:;
        } /* exit inner scope */
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cover, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

        /* "cython/core/triangulation.pyx":2432
 *         if _within_sage:
 *             if is_GapElement(permutation_rep):
 *                 if permutation_rep.IsSubgroupFpGroup():             # <<<<<<<<<<<<<<
 *                     GG = gap(self.fundamental_group())
 *                     coset_action = GG.FactorCosetAction(permutation_rep)
*/
      }

      /* "cython/core/triangulation.pyx":2438
 *                     Q = PermutationGroup(gap_image_gens)
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif (permutation_rep.IsToPermGroupHomomorphismByImages() or             # <<<<<<<<<<<<<<
 *                       permutation_rep.IsCompositionMappingRep()):
 *                     f = permutation_rep
*/
      __pyx_t_6 = __pyx_v_permutation_rep;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_IsToPermGroupHomomorphismByImage, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 2438, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!__pyx_t_12) {
      } else {
        __pyx_t_1 = __pyx_t_12;
        goto __pyx_L14_bool_binop_done;
      }

      /* "cython/core/triangulation.pyx":2439
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif (permutation_rep.IsToPermGroupHomomorphismByImages() or
 *                       permutation_rep.IsCompositionMappingRep()):             # <<<<<<<<<<<<<<
 *                     f = permutation_rep
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
*/
      __pyx_t_6 = __pyx_v_permutation_rep;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_IsCompositionMappingRep, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2439, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 2439, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = __pyx_t_12;
      __pyx_L14_bool_binop_done:;

      /* "cython/core/triangulation.pyx":2438
 *                     Q = PermutationGroup(gap_image_gens)
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif (permutation_rep.IsToPermGroupHomomorphismByImages() or             # <<<<<<<<<<<<<<
 *                       permutation_rep.IsCompositionMappingRep()):
 *                     f = permutation_rep
*/
      if (likely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2440
 *                 elif (permutation_rep.IsToPermGroupHomomorphismByImages() or
 *                       permutation_rep.IsCompositionMappingRep()):
 *                     f = permutation_rep             # <<<<<<<<<<<<<<
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
 *                 else:
*/
        __Pyx_INCREF(__pyx_v_permutation_rep);
        __pyx_v_f = __pyx_v_permutation_rep;

        /* "cython/core/triangulation.pyx":2441
 *                       permutation_rep.IsCompositionMappingRep()):
 *                     f = permutation_rep
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError('Cover specified by unrecognized GAP type')
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_3 = __pyx_v_f;
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_13 = __pyx_v_f;
        __Pyx_INCREF(__pyx_t_13);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
          __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Image, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
        }
        __pyx_t_11 = __pyx_t_10;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_int_1};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Stabilizer, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_PreImage, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cover, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

        /* "cython/core/triangulation.pyx":2438
 *                     Q = PermutationGroup(gap_image_gens)
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif (permutation_rep.IsToPermGroupHomomorphismByImages() or             # <<<<<<<<<<<<<<
 *                       permutation_rep.IsCompositionMappingRep()):
 *                     f = permutation_rep
*/
      }

      /* "cython/core/triangulation.pyx":2443
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
 *                 else:
 *                     raise ValueError('Cover specified by unrecognized GAP type')             # <<<<<<<<<<<<<<
 * 
 *             elif is_MagmaElement(permutation_rep):
*/
      /*else*/ {
        __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_6 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Cover_specified_by_unrecognized};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2443, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(4, 2443, __pyx_L1_error)
      }

      /* "cython/core/triangulation.pyx":2431
 * 
 *         if _within_sage:
 *             if is_GapElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 if permutation_rep.IsSubgroupFpGroup():
 *                     GG = gap(self.fundamental_group())
*/
    }

    /* "cython/core/triangulation.pyx":2445
 *                     raise ValueError('Cover specified by unrecognized GAP type')
 * 
 *             elif is_MagmaElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 input_type = repr(permutation_rep.Type())
 *                 if input_type == 'GrpFP':
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_MagmaElement); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_permutation_rep};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2445, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2446
 * 
 *             elif is_MagmaElement(permutation_rep):
 *                 input_type = repr(permutation_rep.Type())             # <<<<<<<<<<<<<<
 *                 if input_type == 'GrpFP':
 *                     GG = magma(self.fundamental_group())
*/
      __pyx_t_4 = __pyx_v_permutation_rep;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Type, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_4 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_input_type = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2447
 *             elif is_MagmaElement(permutation_rep):
 *                 input_type = repr(permutation_rep.Type())
 *                 if input_type == 'GrpFP':             # <<<<<<<<<<<<<<
 *                     GG = magma(self.fundamental_group())
 *                     f = GG.CosetAction(permutation_rep)
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_input_type, __pyx_mstate_global->__pyx_n_u_GrpFP, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2447, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2448
 *                 input_type = repr(permutation_rep.Type())
 *                 if input_type == 'GrpFP':
 *                     GG = magma(self.fundamental_group())             # <<<<<<<<<<<<<<
 *                     f = GG.CosetAction(permutation_rep)
 *                 elif input_type == 'HomGrp':
*/
        __pyx_t_2 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_magma); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2448, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2448, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_2);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2448, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_v_GG = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2449
 *                 if input_type == 'GrpFP':
 *                     GG = magma(self.fundamental_group())
 *                     f = GG.CosetAction(permutation_rep)             # <<<<<<<<<<<<<<
 *                 elif input_type == 'HomGrp':
 *                     f = permutation_rep
*/
        __pyx_t_6 = __pyx_v_GG;
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_permutation_rep};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_CosetAction, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2449, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_v_f = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2447
 *             elif is_MagmaElement(permutation_rep):
 *                 input_type = repr(permutation_rep.Type())
 *                 if input_type == 'GrpFP':             # <<<<<<<<<<<<<<
 *                     GG = magma(self.fundamental_group())
 *                     f = GG.CosetAction(permutation_rep)
*/
        goto __pyx_L16;
      }

      /* "cython/core/triangulation.pyx":2450
 *                     GG = magma(self.fundamental_group())
 *                     f = GG.CosetAction(permutation_rep)
 *                 elif input_type == 'HomGrp':             # <<<<<<<<<<<<<<
 *                     f = permutation_rep
 *                     if not repr(f.Image().Type()) == 'GrpPerm':
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_input_type, __pyx_mstate_global->__pyx_n_u_HomGrp, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2450, __pyx_L1_error)
      if (likely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2451
 *                     f = GG.CosetAction(permutation_rep)
 *                 elif input_type == 'HomGrp':
 *                     f = permutation_rep             # <<<<<<<<<<<<<<
 *                     if not repr(f.Image().Type()) == 'GrpPerm':
 *                         raise TypeError('The homomorphism image is not '
*/
        __Pyx_INCREF(__pyx_v_permutation_rep);
        __pyx_v_f = __pyx_v_permutation_rep;

        /* "cython/core/triangulation.pyx":2452
 *                 elif input_type == 'HomGrp':
 *                     f = permutation_rep
 *                     if not repr(f.Image().Type()) == 'GrpPerm':             # <<<<<<<<<<<<<<
 *                         raise TypeError('The homomorphism image is not '
 *                                         'a permutation group.')
*/
        __pyx_t_2 = __pyx_v_f;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Image, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __pyx_t_6 = __pyx_t_7;
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Type, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_t_7 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_GrpPerm, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2452, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_12 = (!__pyx_t_1);
        if (unlikely(__pyx_t_12)) {

          /* "cython/core/triangulation.pyx":2453
 *                     f = permutation_rep
 *                     if not repr(f.Image().Type()) == 'GrpPerm':
 *                         raise TypeError('The homomorphism image is not '             # <<<<<<<<<<<<<<
 *                                         'a permutation group.')
 *                 else:
*/
          __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_builtin_TypeError);
          __pyx_t_6 = __pyx_builtin_TypeError; 
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_homomorphism_image_is_not_a};
            __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2453, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_Raise(__pyx_t_7, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(4, 2453, __pyx_L1_error)

          /* "cython/core/triangulation.pyx":2452
 *                 elif input_type == 'HomGrp':
 *                     f = permutation_rep
 *                     if not repr(f.Image().Type()) == 'GrpPerm':             # <<<<<<<<<<<<<<
 *                         raise TypeError('The homomorphism image is not '
 *                                         'a permutation group.')
*/
        }

        /* "cython/core/triangulation.pyx":2450
 *                     GG = magma(self.fundamental_group())
 *                     f = GG.CosetAction(permutation_rep)
 *                 elif input_type == 'HomGrp':             # <<<<<<<<<<<<<<
 *                     f = permutation_rep
 *                     if not repr(f.Image().Type()) == 'GrpPerm':
*/
        goto __pyx_L16;
      }

      /* "cython/core/triangulation.pyx":2456
 *                                         'a permutation group.')
 *                 else:
 *                     raise TypeError('That Magma type not recognized.')             # <<<<<<<<<<<<<<
 * 
 *                 magma.eval("""\
*/
      /*else*/ {
        __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_builtin_TypeError);
        __pyx_t_4 = __pyx_builtin_TypeError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_That_Magma_type_not_recognized};
          __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2456, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(4, 2456, __pyx_L1_error)
      }
      __pyx_L16:;

      /* "cython/core/triangulation.pyx":2458
 *                     raise TypeError('That Magma type not recognized.')
 * 
 *                 magma.eval("""\             # <<<<<<<<<<<<<<
 *                      FormatHomForSnapPea := function(f)
 *                          subone := function(L)   return [x - 1 : x in L]; end function;
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_magma); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_eval); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_FormatHomForSnapPea_function_f};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2458, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/triangulation.pyx":2463
 *                          return [subone(Eltseq(f(g))) : g in Generators(Domain(f))];
 *                        end function;""")
 *                 permutation_rep = f.FormatHomForSnapPea().sage()             # <<<<<<<<<<<<<<
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
*/
      __pyx_t_6 = __pyx_v_f;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_FormatHomForSnapPea, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_2 = __pyx_t_4;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sage, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_DECREF_SET(__pyx_v_permutation_rep, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/triangulation.pyx":2445
 *                     raise ValueError('Cover specified by unrecognized GAP type')
 * 
 *             elif is_MagmaElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 input_type = repr(permutation_rep.Type())
 *                 if input_type == 'GrpFP':
*/
      goto __pyx_L5;
    }

    /* "cython/core/triangulation.pyx":2466
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):             # <<<<<<<<<<<<<<
 *                 permutation_rep = [[x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep]
*/
    __pyx_t_7 = __pyx_pf_8SnapPyHP_13Triangulation_5cover_genexpr(NULL, __pyx_v_permutation_rep); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 2466, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_12) {

      /* "cython/core/triangulation.pyx":2467
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):
 *                 permutation_rep = [[x - 1 for x in perm.domain()]             # <<<<<<<<<<<<<<
 *                                    for perm in permutation_rep]
 * 
*/
      { /* enter inner scope */
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2467, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "cython/core/triangulation.pyx":2468
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):
 *                 permutation_rep = [[x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep]             # <<<<<<<<<<<<<<
 * 
 *         G = self.fundamental_group()
*/
        if (likely(PyList_CheckExact(__pyx_v_permutation_rep)) || PyTuple_CheckExact(__pyx_v_permutation_rep)) {
          __pyx_t_7 = __pyx_v_permutation_rep; __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_permutation_rep); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2468, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2468, __pyx_L20_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2468, __pyx_L20_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8);
              ++__pyx_t_8;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2468, __pyx_L20_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8));
              #else
              __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8);
              #endif
              ++__pyx_t_8;
            }
            if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2468, __pyx_L20_error)
          } else {
            __pyx_t_2 = __pyx_t_9(__pyx_t_7);
            if (unlikely(!__pyx_t_2)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2468, __pyx_L20_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_perm, __pyx_t_2);
          __pyx_t_2 = 0;
          { /* enter inner scope */

            /* "cython/core/triangulation.pyx":2467
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):
 *                 permutation_rep = [[x - 1 for x in perm.domain()]             # <<<<<<<<<<<<<<
 *                                    for perm in permutation_rep]
 * 
*/
            __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2467, __pyx_L25_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = __pyx_9genexpr34__pyx_v_perm;
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
              __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_domain, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2467, __pyx_L25_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
              __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3);
              __pyx_t_14 = 0;
              __pyx_t_15 = NULL;
            } else {
              __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2467, __pyx_L25_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 2467, __pyx_L25_error)
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            for (;;) {
              if (likely(!__pyx_t_15)) {
                if (likely(PyList_CheckExact(__pyx_t_3))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2467, __pyx_L25_error)
                    #endif
                    if (__pyx_t_14 >= __pyx_temp) break;
                  }
                  __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_14);
                  ++__pyx_t_14;
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2467, __pyx_L25_error)
                    #endif
                    if (__pyx_t_14 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14));
                  #else
                  __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_14);
                  #endif
                  ++__pyx_t_14;
                }
                if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2467, __pyx_L25_error)
              } else {
                __pyx_t_6 = __pyx_t_15(__pyx_t_3);
                if (unlikely(!__pyx_t_6)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2467, __pyx_L25_error)
                    PyErr_Clear();
                  }
                  break;
                }
              }
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_x, __pyx_t_6);
              __pyx_t_6 = 0;
              __pyx_t_6 = __Pyx_PyLong_SubtractObjC(__pyx_9genexpr35__pyx_v_x, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2467, __pyx_L25_error)
              __Pyx_GOTREF(__pyx_t_6);
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 2467, __pyx_L25_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_x); __pyx_9genexpr35__pyx_v_x = 0;
            goto __pyx_L29_exit_scope;
            __pyx_L25_error:;
            __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_x); __pyx_9genexpr35__pyx_v_x = 0;
            goto __pyx_L20_error;
            __pyx_L29_exit_scope:;
          } /* exit inner scope */
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 2467, __pyx_L20_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "cython/core/triangulation.pyx":2468
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):
 *                 permutation_rep = [[x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep]             # <<<<<<<<<<<<<<
 * 
 *         G = self.fundamental_group()
*/
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_perm); __pyx_9genexpr34__pyx_v_perm = 0;
        goto __pyx_L31_exit_scope;
        __pyx_L20_error:;
        __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_perm); __pyx_9genexpr34__pyx_v_perm = 0;
        goto __pyx_L1_error;
        __pyx_L31_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_permutation_rep, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2466
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif all(isinstance(p, PermutationGroupElement) for p in permutation_rep):             # <<<<<<<<<<<<<<
 *                 permutation_rep = [[x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep]
*/
    }
    __pyx_L5:;

    /* "cython/core/triangulation.pyx":2430
 *         # alternate inputs
 * 
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             if is_GapElement(permutation_rep):
 *                 if permutation_rep.IsSubgroupFpGroup():
*/
  }

  /* "cython/core/triangulation.pyx":2470
 *                                    for perm in permutation_rep]
 * 
 *         G = self.fundamental_group()             # <<<<<<<<<<<<<<
 *         c_representation = self.build_rep_into_Sn(permutation_rep)
 *         degree = len(permutation_rep[0]) if len(permutation_rep) > 0 else 1
*/
  __pyx_t_7 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_G = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2471
 * 
 *         G = self.fundamental_group()
 *         c_representation = self.build_rep_into_Sn(permutation_rep)             # <<<<<<<<<<<<<<
 *         degree = len(permutation_rep[0]) if len(permutation_rep) > 0 else 1
 * 
*/
  __pyx_t_16 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_self->__pyx_vtab)->build_rep_into_Sn(__pyx_v_self, __pyx_v_permutation_rep); if (unlikely(__pyx_t_16 == ((RepresentationIntoSn *)0) && PyErr_Occurred())) __PYX_ERR(4, 2471, __pyx_L1_error)
  __pyx_v_c_representation = __pyx_t_16;

  /* "cython/core/triangulation.pyx":2472
 *         G = self.fundamental_group()
 *         c_representation = self.build_rep_into_Sn(permutation_rep)
 *         degree = len(permutation_rep[0]) if len(permutation_rep) > 0 else 1             # <<<<<<<<<<<<<<
 * 
 *         # The next call has the effect of initializing aspects of
*/
  __pyx_t_14 = PyObject_Length(__pyx_v_permutation_rep); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2472, __pyx_L1_error)
  __pyx_t_12 = (__pyx_t_14 > 0);
  if (__pyx_t_12) {
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_permutation_rep, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2472, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __pyx_t_14;
  } else {
    __pyx_t_8 = 1;
  }
  __pyx_v_degree = __pyx_t_8;

  /* "cython/core/triangulation.pyx":2479
 *         # because the resulting FundamentalGroup object calls the kernel
 *         # function "fundamental_group" on a copy of self.c_triangulation.
 *         free_group_presentation(compute_unsimplified_presentation(self.c_triangulation))             # <<<<<<<<<<<<<<
 * 
 *         c_triangulation = construct_cover(self.c_triangulation,
*/
  __pyx_t_17 = compute_unsimplified_presentation(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2479, __pyx_L1_error)
  free_group_presentation(__pyx_t_17); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2479, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2481
 *         free_group_presentation(compute_unsimplified_presentation(self.c_triangulation))
 * 
 *         c_triangulation = construct_cover(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                           c_representation,
 *                                           <int>degree)
*/
  __pyx_t_18 = construct_cover(__pyx_v_self->c_triangulation, __pyx_v_c_representation, ((int)__pyx_v_degree)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2481, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_18;

  /* "cython/core/triangulation.pyx":2484
 *                                           c_representation,
 *                                           <int>degree)
 *         cover = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         cover.set_c_triangulation(c_triangulation)
 *         cover._cover_info = info = {
*/
  __pyx_t_7 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(4, 2484, __pyx_L1_error)
  __pyx_v_cover = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2485
 *                                           <int>degree)
 *         cover = self.__class__('empty')
 *         cover.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         cover._cover_info = info = {
 *             'base'   : self.name(),
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_cover->__pyx_vtab)->set_c_triangulation(__pyx_v_cover, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2487
 *         cover.set_c_triangulation(c_triangulation)
 *         cover._cover_info = info = {
 *             'base'   : self.name(),             # <<<<<<<<<<<<<<
 *             'type'   : cover_types[c_representation.covering_type],
 *             'degree' : degree
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_base, __pyx_t_7) < 0) __PYX_ERR(4, 2487, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/triangulation.pyx":2488
 *         cover._cover_info = info = {
 *             'base'   : self.name(),
 *             'type'   : cover_types[c_representation.covering_type],             # <<<<<<<<<<<<<<
 *             'degree' : degree
 *             }
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cover_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyLong_From_CoveringType(__pyx_v_c_representation->covering_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_3) < 0) __PYX_ERR(4, 2487, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2489
 *             'base'   : self.name(),
 *             'type'   : cover_types[c_representation.covering_type],
 *             'degree' : degree             # <<<<<<<<<<<<<<
 *             }
 *         cover.set_name(self.name() +'~' + info['type'][:3])
*/
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_degree); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_degree, __pyx_t_3) < 0) __PYX_ERR(4, 2487, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2486
 *         cover = self.__class__('empty')
 *         cover.set_c_triangulation(c_triangulation)
 *         cover._cover_info = info = {             # <<<<<<<<<<<<<<
 *             'base'   : self.name(),
 *             'type'   : cover_types[c_representation.covering_type],
*/
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_cover->_cover_info);
  __Pyx_DECREF(__pyx_v_cover->_cover_info);
  __pyx_v_cover->_cover_info = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_info = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2491
 *             'degree' : degree
 *             }
 *         cover.set_name(self.name() +'~' + info['type'][:3])             # <<<<<<<<<<<<<<
 *         free_representation(c_representation,
 *                             G.num_original_generators(),
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_cover);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__24); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_info, __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 3, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2493
 *         cover.set_name(self.name() +'~' + info['type'][:3])
 *         free_representation(c_representation,
 *                             G.num_original_generators(),             # <<<<<<<<<<<<<<
 *                             self.num_cusps())
 *         return cover
*/
  __pyx_t_2 = __pyx_v_G;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_original_generators, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_19 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2494
 *         free_representation(c_representation,
 *                             G.num_original_generators(),
 *                             self.num_cusps())             # <<<<<<<<<<<<<<
 *         return cover
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_20 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2492
 *             }
 *         cover.set_name(self.name() +'~' + info['type'][:3])
 *         free_representation(c_representation,             # <<<<<<<<<<<<<<
 *                             G.num_original_generators(),
 *                             self.num_cusps())
*/
  free_representation(__pyx_v_c_representation, __pyx_t_19, __pyx_t_20); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2492, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2495
 *                             G.num_original_generators(),
 *                             self.num_cusps())
 *         return cover             # <<<<<<<<<<<<<<
 * 
 *     def covers(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_cover);
  __pyx_r = ((PyObject *)__pyx_v_cover);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2395
 *                                 'fundamental_group', *args)
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Triangulation':             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`Triangulation` representing the finite cover specified
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cover);
  __Pyx_XDECREF(__pyx_v_GG);
  __Pyx_XDECREF(__pyx_v_coset_action);
  __Pyx_XDECREF(__pyx_v_gap_image_gens);
  __Pyx_XDECREF(__pyx_v_Q);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_input_type);
  __Pyx_XDECREF(__pyx_v_G);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_g);
  __Pyx_XDECREF(__pyx_gb_8SnapPyHP_13Triangulation_5cover_2generator2);
  __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_perm);
  __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_permutation_rep);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2497
 *         return cover
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_129covers(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_8SnapPyHP_13Triangulation_128covers, "\n        Returns a list of Triangulations corresponding to all of the\n        finite covers of the given degree.  The default method is\n        'low_index' for general covers and 'snappea' for cyclic\n        covers.  The former uses Sim's algorithm while the latter\n        uses the original Snappea algorithm.\n\n        WARNING: If the degree is large this might take a very, very,\n        very long time.\n\n        >>> M = Triangulation('m003')\n        >>> covers = M.covers(4)\n        >>> sorted(N.homology() for N in covers)\n        [Z/3 + Z/15 + Z, Z/5 + Z + Z]\n\n        It is faster to look just at cyclic covers.\n\n        >>> covers = M.covers(4, cover_type='cyclic')\n        >>> [(N, N.homology()) for N in covers]\n        [(m003~cyc~0(0,0), Z/3 + Z/15 + Z)]\n\n        Here we check that we get the same number of covers with the\n        'snappea' and 'low_index' methods.\n\n        >>> M = Triangulation('m125')\n        >>> len(M.covers(5))\n        19\n        >>> len(M.covers(5, method='snappea'))\n        19\n\n        If you are using Sage, you can use GAP to find the subgroups,\n        which is often much faster, by specifying the optional\n        argument method = 'gap' If you have Magma installed, you can\n        used it to do the heavy lifting by specifying method='magma'.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_129covers = {"covers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_129covers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_128covers};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_129covers(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_degree = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_cover_type = 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("covers (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,&__pyx_mstate_global->__pyx_n_u_method,&__pyx_mstate_global->__pyx_n_u_cover_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2497, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2497, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2497, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2497, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "covers", 0) < 0) __PYX_ERR(4, 2497, __pyx_L3_error)

      /* "cython/core/triangulation.pyx":2500
 *             self,
 *             degree,
 *             method : typing.Optional[str] = None,             # <<<<<<<<<<<<<<
 *             cover_type : str ='all'
 *         ) -> 'list[snappy.Triangulation]':
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_all));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("covers", 0, 1, 3, i); __PYX_ERR(4, 2497, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2497, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2497, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2497, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_all));
    }
    __pyx_v_degree = values[0];
    __pyx_v_method = ((PyObject*)values[1]);
    __pyx_v_cover_type = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("covers", 0, 1, 3, __pyx_nargs); __PYX_ERR(4, 2497, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method), (&PyUnicode_Type), 1, "method", 2))) __PYX_ERR(4, 2500, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cover_type), (&PyUnicode_Type), 0, "cover_type", 2))) __PYX_ERR(4, 2501, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_128covers(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_degree, __pyx_v_method, __pyx_v_cover_type);

  /* "cython/core/triangulation.pyx":2497
 *         return cover
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_128covers(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type) {
  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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("covers", 0);
  __Pyx_INCREF(__pyx_v_method);

  /* "cython/core/triangulation.pyx":2538
 *         used it to do the heavy lifting by specifying method='magma'.
 *         """
 *         if degree < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cover degree should be at least 1')
 * 
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_degree, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2538, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 2538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/triangulation.pyx":2539
 *         """
 *         if degree < 1:
 *             raise ValueError('Cover degree should be at least 1')             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cover_degree_should_be_at_least};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 2539, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2538
 *         used it to do the heavy lifting by specifying method='magma'.
 *         """
 *         if degree < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cover degree should be at least 1')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2541
 *             raise ValueError('Cover degree should be at least 1')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if cover_type not in ('cyclic', 'all'):
*/
  __pyx_t_2 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/triangulation.pyx":2542
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if cover_type not in ('cyclic', 'all'):
 *             raise ValueError("Supported cover_types are 'all' "
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_3 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 2542, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2541
 *             raise ValueError('Cover degree should be at least 1')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if cover_type not in ('cyclic', 'all'):
*/
  }

  /* "cython/core/triangulation.pyx":2543
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if cover_type not in ('cyclic', 'all'):             # <<<<<<<<<<<<<<
 *             raise ValueError("Supported cover_types are 'all' "
 *                              "and 'cyclic'.")
*/
  __Pyx_INCREF(__pyx_v_cover_type);
  __pyx_t_6 = __pyx_v_cover_type;
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_cyclic, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 2543, __pyx_L1_error)
  if (__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_all, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 2543, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __pyx_t_2;
  if (unlikely(__pyx_t_7)) {

    /* "cython/core/triangulation.pyx":2544
 *             raise ValueError('The Triangulation is empty.')
 *         if cover_type not in ('cyclic', 'all'):
 *             raise ValueError("Supported cover_types are 'all' "             # <<<<<<<<<<<<<<
 *                              "and 'cyclic'.")
 *         if method is None:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Supported_cover_types_are_all_an};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 2544, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2543
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if cover_type not in ('cyclic', 'all'):             # <<<<<<<<<<<<<<
 *             raise ValueError("Supported cover_types are 'all' "
 *                              "and 'cyclic'.")
*/
  }

  /* "cython/core/triangulation.pyx":2546
 *             raise ValueError("Supported cover_types are 'all' "
 *                              "and 'cyclic'.")
 *         if method is None:             # <<<<<<<<<<<<<<
 *             method = 'low_index'
 *         else:
*/
  __pyx_t_7 = (__pyx_v_method == ((PyObject*)Py_None));
  if (__pyx_t_7) {

    /* "cython/core/triangulation.pyx":2547
 *                              "and 'cyclic'.")
 *         if method is None:
 *             method = 'low_index'             # <<<<<<<<<<<<<<
 *         else:
 *             method = method.lower()
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_low_index);
    __Pyx_DECREF_SET(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_low_index);

    /* "cython/core/triangulation.pyx":2546
 *             raise ValueError("Supported cover_types are 'all' "
 *                              "and 'cyclic'.")
 *         if method is None:             # <<<<<<<<<<<<<<
 *             method = 'low_index'
 *         else:
*/
    goto __pyx_L8;
  }

  /* "cython/core/triangulation.pyx":2549
 *             method = 'low_index'
 *         else:
 *             method = method.lower()             # <<<<<<<<<<<<<<
 * 
 *         if cover_type == 'cyclic' or method == 'snappea':
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__lower, __pyx_v_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_method, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;
  }
  __pyx_L8:;

  /* "cython/core/triangulation.pyx":2551
 *             method = method.lower()
 * 
 *         if cover_type == 'cyclic' or method == 'snappea':             # <<<<<<<<<<<<<<
 *             return self._covers_snappea(degree, cover_type)
 * 
*/
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_cover_type, __pyx_mstate_global->__pyx_n_u_cyclic, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 2551, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_7 = __pyx_t_2;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_snappea, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 2551, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_2;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_7) {

    /* "cython/core/triangulation.pyx":2552
 * 
 *         if cover_type == 'cyclic' or method == 'snappea':
 *             return self._covers_snappea(degree, cover_type)             # <<<<<<<<<<<<<<
 * 
 *         if method == 'low_index':
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_degree, __pyx_v_cover_type};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_covers_snappea, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2551
 *             method = method.lower()
 * 
 *         if cover_type == 'cyclic' or method == 'snappea':             # <<<<<<<<<<<<<<
 *             return self._covers_snappea(degree, cover_type)
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2554
 *             return self._covers_snappea(degree, cover_type)
 * 
 *         if method == 'low_index':             # <<<<<<<<<<<<<<
 *             return self._covers_low_index(degree)
 *         if method == 'gap':
*/
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_low_index, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 2554, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/triangulation.pyx":2555
 * 
 *         if method == 'low_index':
 *             return self._covers_low_index(degree)             # <<<<<<<<<<<<<<
 *         if method == 'gap':
 *             return self._covers_gap(degree)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_degree};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_covers_low_index, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2554
 *             return self._covers_snappea(degree, cover_type)
 * 
 *         if method == 'low_index':             # <<<<<<<<<<<<<<
 *             return self._covers_low_index(degree)
 *         if method == 'gap':
*/
  }

  /* "cython/core/triangulation.pyx":2556
 *         if method == 'low_index':
 *             return self._covers_low_index(degree)
 *         if method == 'gap':             # <<<<<<<<<<<<<<
 *             return self._covers_gap(degree)
 *         if method == 'magma':
*/
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_gap, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 2556, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/triangulation.pyx":2557
 *             return self._covers_low_index(degree)
 *         if method == 'gap':
 *             return self._covers_gap(degree)             # <<<<<<<<<<<<<<
 *         if method == 'magma':
 *             return self._covers_magma(degree)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_degree};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_covers_gap, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2556
 *         if method == 'low_index':
 *             return self._covers_low_index(degree)
 *         if method == 'gap':             # <<<<<<<<<<<<<<
 *             return self._covers_gap(degree)
 *         if method == 'magma':
*/
  }

  /* "cython/core/triangulation.pyx":2558
 *         if method == 'gap':
 *             return self._covers_gap(degree)
 *         if method == 'magma':             # <<<<<<<<<<<<<<
 *             return self._covers_magma(degree)
 * 
*/
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_mstate_global->__pyx_n_u_magma, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 2558, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/triangulation.pyx":2559
 *             return self._covers_gap(degree)
 *         if method == 'magma':
 *             return self._covers_magma(degree)             # <<<<<<<<<<<<<<
 * 
 *         raise ValueError("Supported methods are 'low_index', 'gap', 'magma' "
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_degree};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_covers_magma, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2558
 *         if method == 'gap':
 *             return self._covers_gap(degree)
 *         if method == 'magma':             # <<<<<<<<<<<<<<
 *             return self._covers_magma(degree)
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2561
 *             return self._covers_magma(degree)
 * 
 *         raise ValueError("Supported methods are 'low_index', 'gap', 'magma' "             # <<<<<<<<<<<<<<
 *                          "and 'snappea'")
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __pyx_t_3 = __pyx_builtin_ValueError; 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Supported_methods_are_low_index};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2561, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2497
 *         return cover
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2564
 *                          "and 'snappea'")
 * 
 *     def _covers_low_index(self, degree, num_threads=0):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using low_index.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_131_covers_low_index(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_8SnapPyHP_13Triangulation_130_covers_low_index, "\n        Compute all covers using low_index.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_131_covers_low_index = {"_covers_low_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_131_covers_low_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_130_covers_low_index};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_131_covers_low_index(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_degree = 0;
  PyObject *__pyx_v_num_threads = 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("_covers_low_index (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,&__pyx_mstate_global->__pyx_n_u_num_threads,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2564, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2564, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2564, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_covers_low_index", 0) < 0) __PYX_ERR(4, 2564, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_covers_low_index", 0, 1, 2, i); __PYX_ERR(4, 2564, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2564, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2564, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_degree = values[0];
    __pyx_v_num_threads = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_covers_low_index", 0, 1, 2, __pyx_nargs); __PYX_ERR(4, 2564, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_low_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_130_covers_low_index(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_degree, __pyx_v_num_threads);

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

/* "cython/core/triangulation.pyx":2591
 *                                           num_threads=num_threads)
 * 
 *         def index(subgroup):             # <<<<<<<<<<<<<<
 *             return 1 if len(subgroup) == 0 else len(subgroup[0])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_17_covers_low_index_1index(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_8SnapPyHP_13Triangulation_17_covers_low_index_1index = {"index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_17_covers_low_index_1index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_17_covers_low_index_1index(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_subgroup = 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("index (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_subgroup,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2591, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "index", 0) < 0) __PYX_ERR(4, 2591, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("index", 1, 1, 1, i); __PYX_ERR(4, 2591, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2591, __pyx_L3_error)
    }
    __pyx_v_subgroup = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("index", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 2591, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_low_index.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_17_covers_low_index_index(__pyx_self, __pyx_v_subgroup);

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

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

  /* "cython/core/triangulation.pyx":2592
 * 
 *         def index(subgroup):
 *             return 1 if len(subgroup) == 0 else len(subgroup[0])             # <<<<<<<<<<<<<<
 * 
 *         covers = [self.cover(H) for H in reps if index(H) == degree]
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_Length(__pyx_v_subgroup); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2592, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 == 0);
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __pyx_t_1 = __pyx_mstate_global->__pyx_int_1;
  } else {
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_subgroup, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2592, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2591
 *                                           num_threads=num_threads)
 * 
 *         def index(subgroup):             # <<<<<<<<<<<<<<
 *             return 1 if len(subgroup) == 0 else len(subgroup[0])
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_low_index.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2564
 *                          "and 'snappea'")
 * 
 *     def _covers_low_index(self, degree, num_threads=0):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using low_index.
*/

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_130_covers_low_index(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_num_threads) {
  PyObject *__pyx_v_G = NULL;
  PyObject *__pyx_v_relators = NULL;
  PyObject *__pyx_v_short_relators = NULL;
  PyObject *__pyx_v_long_relators = NULL;
  PyObject *__pyx_v_strategy = NULL;
  PyObject *__pyx_v_reps = NULL;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_covers = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_C = NULL;
  PyObject *__pyx_9genexpr36__pyx_v_rel = NULL;
  PyObject *__pyx_9genexpr37__pyx_v_rel = NULL;
  PyObject *__pyx_9genexpr38__pyx_v_H = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_covers_low_index", 0);

  /* "cython/core/triangulation.pyx":2568
 *         Compute all covers using low_index.
 *         """
 *         G = self.fundamental_group()             # <<<<<<<<<<<<<<
 * 
 *         relators = sorted(G.relators(as_int_list=True), key=len)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_G = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2570
 *         G = self.fundamental_group()
 * 
 *         relators = sorted(G.relators(as_int_list=True), key=len)             # <<<<<<<<<<<<<<
 * 
 *         short_relators, long_relators = [], relators
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_sorted);
  __pyx_t_4 = __pyx_builtin_sorted; 
  __pyx_t_6 = __pyx_v_G;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, NULL};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_as_int_list, Py_True, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 2570, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_relators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_7 = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_len); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(4, 2570, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_relators = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2572
 *         relators = sorted(G.relators(as_int_list=True), key=len)
 * 
 *         short_relators, long_relators = [], relators             # <<<<<<<<<<<<<<
 *         strategy = ''
 * 
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_v_relators;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_short_relators = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_long_relators = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2573
 * 
 *         short_relators, long_relators = [], relators
 *         strategy = ''             # <<<<<<<<<<<<<<
 * 
 *         if relators:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10);
  __pyx_v_strategy = __pyx_mstate_global->__pyx_kp_u__10;

  /* "cython/core/triangulation.pyx":2575
 *         strategy = ''
 * 
 *         if relators:             # <<<<<<<<<<<<<<
 *             if len(relators[0]) <= 2*degree:
 *                 short_relators = [rel for rel in relators if len(rel) <= 2*degree]
*/
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_relators); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(4, 2575, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "cython/core/triangulation.pyx":2576
 * 
 *         if relators:
 *             if len(relators[0]) <= 2*degree:             # <<<<<<<<<<<<<<
 *                 short_relators = [rel for rel in relators if len(rel) <= 2*degree]
 *                 long_relators = relators[len(short_relators):]
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_relators, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_v_degree, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(4, 2576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_8) {

      /* "cython/core/triangulation.pyx":2577
 *         if relators:
 *             if len(relators[0]) <= 2*degree:
 *                 short_relators = [rel for rel in relators if len(rel) <= 2*degree]             # <<<<<<<<<<<<<<
 *                 long_relators = relators[len(short_relators):]
 *                 strategy = 'spin_short'
*/
      { /* enter inner scope */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2577, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (likely(PyList_CheckExact(__pyx_v_relators)) || PyTuple_CheckExact(__pyx_v_relators)) {
          __pyx_t_1 = __pyx_v_relators; __Pyx_INCREF(__pyx_t_1);
          __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_relators); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2577, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2577, __pyx_L7_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_1))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2577, __pyx_L7_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_9);
              ++__pyx_t_9;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2577, __pyx_L7_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9));
              #else
              __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9);
              #endif
              ++__pyx_t_9;
            }
            if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2577, __pyx_L7_error)
          } else {
            __pyx_t_4 = __pyx_t_10(__pyx_t_1);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2577, __pyx_L7_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_rel, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_11 = PyObject_Length(__pyx_9genexpr36__pyx_v_rel); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2577, __pyx_L7_error)
          __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2577, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_v_degree, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2577, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2577, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(4, 2577, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__pyx_t_8) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_9genexpr36__pyx_v_rel))) __PYX_ERR(4, 2577, __pyx_L7_error)
          }
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_rel); __pyx_9genexpr36__pyx_v_rel = 0;
        goto __pyx_L12_exit_scope;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_rel); __pyx_9genexpr36__pyx_v_rel = 0;
        goto __pyx_L1_error;
        __pyx_L12_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_short_relators, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":2578
 *             if len(relators[0]) <= 2*degree:
 *                 short_relators = [rel for rel in relators if len(rel) <= 2*degree]
 *                 long_relators = relators[len(short_relators):]             # <<<<<<<<<<<<<<
 *                 strategy = 'spin_short'
 *             elif len(relators[0]) <= 3*degree:
*/
      __pyx_t_9 = __Pyx_PyList_GET_SIZE(__pyx_v_short_relators); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2578, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_relators, __pyx_t_9, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_long_relators, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":2579
 *                 short_relators = [rel for rel in relators if len(rel) <= 2*degree]
 *                 long_relators = relators[len(short_relators):]
 *                 strategy = 'spin_short'             # <<<<<<<<<<<<<<
 *             elif len(relators[0]) <= 3*degree:
 *                 short_relators = [rel for rel in relators if len(rel) <= 3*degree]
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_spin_short);
      __Pyx_DECREF_SET(__pyx_v_strategy, __pyx_mstate_global->__pyx_n_u_spin_short);

      /* "cython/core/triangulation.pyx":2576
 * 
 *         if relators:
 *             if len(relators[0]) <= 2*degree:             # <<<<<<<<<<<<<<
 *                 short_relators = [rel for rel in relators if len(rel) <= 2*degree]
 *                 long_relators = relators[len(short_relators):]
*/
      goto __pyx_L4;
    }

    /* "cython/core/triangulation.pyx":2580
 *                 long_relators = relators[len(short_relators):]
 *                 strategy = 'spin_short'
 *             elif len(relators[0]) <= 3*degree:             # <<<<<<<<<<<<<<
 *                 short_relators = [rel for rel in relators if len(rel) <= 3*degree]
 *                 long_relators = relators[len(short_relators):]
*/
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_relators, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_degree, 3, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(4, 2580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_8) {

      /* "cython/core/triangulation.pyx":2581
 *                 strategy = 'spin_short'
 *             elif len(relators[0]) <= 3*degree:
 *                 short_relators = [rel for rel in relators if len(rel) <= 3*degree]             # <<<<<<<<<<<<<<
 *                 long_relators = relators[len(short_relators):]
 * 
*/
      { /* enter inner scope */
        __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2581, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (likely(PyList_CheckExact(__pyx_v_relators)) || PyTuple_CheckExact(__pyx_v_relators)) {
          __pyx_t_1 = __pyx_v_relators; __Pyx_INCREF(__pyx_t_1);
          __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_relators); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2581, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2581, __pyx_L15_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_1))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2581, __pyx_L15_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_9);
              ++__pyx_t_9;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2581, __pyx_L15_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9));
              #else
              __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9);
              #endif
              ++__pyx_t_9;
            }
            if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2581, __pyx_L15_error)
          } else {
            __pyx_t_6 = __pyx_t_10(__pyx_t_1);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2581, __pyx_L15_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_rel, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_11 = PyObject_Length(__pyx_9genexpr37__pyx_v_rel); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2581, __pyx_L15_error)
          __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2581, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_degree, 3, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2581, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2581, __pyx_L15_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(4, 2581, __pyx_L15_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_8) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_9genexpr37__pyx_v_rel))) __PYX_ERR(4, 2581, __pyx_L15_error)
          }
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_rel); __pyx_9genexpr37__pyx_v_rel = 0;
        goto __pyx_L20_exit_scope;
        __pyx_L15_error:;
        __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_rel); __pyx_9genexpr37__pyx_v_rel = 0;
        goto __pyx_L1_error;
        __pyx_L20_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_short_relators, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "cython/core/triangulation.pyx":2582
 *             elif len(relators[0]) <= 3*degree:
 *                 short_relators = [rel for rel in relators if len(rel) <= 3*degree]
 *                 long_relators = relators[len(short_relators):]             # <<<<<<<<<<<<<<
 * 
 *         reps = low_index.permutation_reps(G.num_generators(),
*/
      __pyx_t_9 = __Pyx_PyList_GET_SIZE(__pyx_v_short_relators); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2582, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_relators, __pyx_t_9, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_long_relators, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/triangulation.pyx":2580
 *                 long_relators = relators[len(short_relators):]
 *                 strategy = 'spin_short'
 *             elif len(relators[0]) <= 3*degree:             # <<<<<<<<<<<<<<
 *                 short_relators = [rel for rel in relators if len(rel) <= 3*degree]
 *                 long_relators = relators[len(short_relators):]
*/
    }
    __pyx_L4:;

    /* "cython/core/triangulation.pyx":2575
 *         strategy = ''
 * 
 *         if relators:             # <<<<<<<<<<<<<<
 *             if len(relators[0]) <= 2*degree:
 *                 short_relators = [rel for rel in relators if len(rel) <= 2*degree]
*/
  }

  /* "cython/core/triangulation.pyx":2584
 *                 long_relators = relators[len(short_relators):]
 * 
 *         reps = low_index.permutation_reps(G.num_generators(),             # <<<<<<<<<<<<<<
 *                                           short_relators,
 *                                           long_relators,
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_low_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_permutation_reps); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_v_G;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }

  /* "cython/core/triangulation.pyx":2589
 *                                           degree,
 *                                           strategy=strategy,
 *                                           num_threads=num_threads)             # <<<<<<<<<<<<<<
 * 
 *         def index(subgroup):
*/
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_1, __pyx_t_4, __pyx_v_short_relators, __pyx_v_long_relators, __pyx_v_degree};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_strategy, __pyx_v_strategy, __pyx_t_6, __pyx_callargs+5, 0) < 0) __PYX_ERR(4, 2584, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_num_threads, __pyx_v_num_threads, __pyx_t_6, __pyx_callargs+5, 1) < 0) __PYX_ERR(4, 2584, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_reps = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2591
 *                                           num_threads=num_threads)
 * 
 *         def index(subgroup):             # <<<<<<<<<<<<<<
 *             return 1 if len(subgroup) == 0 else len(subgroup[0])
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_17_covers_low_index_1index, 0, __pyx_mstate_global->__pyx_n_u_covers_low_index_locals_index, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_index = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2594
 *             return 1 if len(subgroup) == 0 else len(subgroup[0])
 * 
 *         covers = [self.cover(H) for H in reps if index(H) == degree]             # <<<<<<<<<<<<<<
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')
*/
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2594, __pyx_L23_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_v_reps)) || PyTuple_CheckExact(__pyx_v_reps)) {
      __pyx_t_7 = __pyx_v_reps; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_reps); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2594, __pyx_L23_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2594, __pyx_L23_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2594, __pyx_L23_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2594, __pyx_L23_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2594, __pyx_L23_error)
      } else {
        __pyx_t_6 = __pyx_t_10(__pyx_t_7);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2594, __pyx_L23_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_H, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_pf_8SnapPyHP_13Triangulation_17_covers_low_index_index(__pyx_v_index, __pyx_9genexpr38__pyx_v_H); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2594, __pyx_L23_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_degree, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2594, __pyx_L23_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(4, 2594, __pyx_L23_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        __pyx_t_6 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr38__pyx_v_H};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cover, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2594, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 2594, __pyx_L23_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_H); __pyx_9genexpr38__pyx_v_H = 0;
    goto __pyx_L28_exit_scope;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_H); __pyx_9genexpr38__pyx_v_H = 0;
    goto __pyx_L1_error;
    __pyx_L28_exit_scope:;
  } /* exit inner scope */
  __pyx_v_covers = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2595
 * 
 *         covers = [self.cover(H) for H in reps if index(H) == degree]
 *         for i, C in enumerate(covers):             # <<<<<<<<<<<<<<
 *             C.set_name(C.name() + f'~{i}')
 *         return covers
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_5 = __pyx_mstate_global->__pyx_int_0;
  __pyx_t_7 = __pyx_v_covers; __Pyx_INCREF(__pyx_t_7);
  __pyx_t_9 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2595, __pyx_L1_error)
      #endif
      if (__pyx_t_9 >= __pyx_temp) break;
    }
    __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_9);
    ++__pyx_t_9;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_C, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5);
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2596
 *         covers = [self.cover(H) for H in reps if index(H) == degree]
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')             # <<<<<<<<<<<<<<
 *         return covers
 * 
*/
    __pyx_t_6 = __pyx_v_C;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_2 = __pyx_v_C;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_i, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__24, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2595
 * 
 *         covers = [self.cover(H) for H in reps if index(H) == degree]
 *         for i, C in enumerate(covers):             # <<<<<<<<<<<<<<
 *             C.set_name(C.name() + f'~{i}')
 *         return covers
*/
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2597
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')
 *         return covers             # <<<<<<<<<<<<<<
 * 
 *     def _covers_gap(self, degree):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_covers);
  __pyx_r = __pyx_v_covers;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2564
 *                          "and 'snappea'")
 * 
 *     def _covers_low_index(self, degree, num_threads=0):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using low_index.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_low_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_G);
  __Pyx_XDECREF(__pyx_v_relators);
  __Pyx_XDECREF(__pyx_v_short_relators);
  __Pyx_XDECREF(__pyx_v_long_relators);
  __Pyx_XDECREF(__pyx_v_strategy);
  __Pyx_XDECREF(__pyx_v_reps);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_covers);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_C);
  __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_rel);
  __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_rel);
  __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_H);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2599
 *         return covers
 * 
 *     def _covers_gap(self, degree):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using gap.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_133_covers_gap(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_8SnapPyHP_13Triangulation_132_covers_gap, "\n        Compute all covers using gap.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_133_covers_gap = {"_covers_gap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_133_covers_gap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_132_covers_gap};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_133_covers_gap(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_degree = 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("_covers_gap (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2599, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2599, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_covers_gap", 0) < 0) __PYX_ERR(4, 2599, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_covers_gap", 1, 1, 1, i); __PYX_ERR(4, 2599, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2599, __pyx_L3_error)
    }
    __pyx_v_degree = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_covers_gap", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 2599, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_gap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_132_covers_gap(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_degree);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_132_covers_gap(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree) {
  PyObject *__pyx_v_G = NULL;
  PyObject *__pyx_v_covers = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_C = NULL;
  PyObject *__pyx_9genexpr39__pyx_v_H = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_covers_gap", 0);

  /* "cython/core/triangulation.pyx":2603
 *         Compute all covers using gap.
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise SageNotAvailable('the "gap" method for covers requires Sage')
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2603, __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(4, 2603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":2604
 *         """
 *         if not _within_sage:
 *             raise SageNotAvailable('the "gap" method for covers requires Sage')             # <<<<<<<<<<<<<<
 * 
 *         G = gap(self.fundamental_group())
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SageNotAvailable); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_the_gap_method_for_covers_requir};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 2604, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2603
 *         Compute all covers using gap.
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise SageNotAvailable('the "gap" method for covers requires Sage')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2606
 *             raise SageNotAvailable('the "gap" method for covers requires Sage')
 * 
 *         G = gap(self.fundamental_group())             # <<<<<<<<<<<<<<
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gap); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_G = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2607
 * 
 *         G = gap(self.fundamental_group())
 *         covers = [self.cover(H)             # <<<<<<<<<<<<<<
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)
 *                   if G.Index(H) == degree]
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2607, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/triangulation.pyx":2608
 *         G = gap(self.fundamental_group())
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)             # <<<<<<<<<<<<<<
 *                   if G.Index(H) == degree]
 *         for i, C in enumerate(covers):
*/
    __pyx_t_7 = __pyx_v_G;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_degree};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_LowIndexSubgroupsFpGroup, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2608, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2608, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2608, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2608, __pyx_L6_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2608, __pyx_L6_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2608, __pyx_L6_error)
      } else {
        __pyx_t_4 = __pyx_t_10(__pyx_t_7);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2608, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_H, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2609
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)
 *                   if G.Index(H) == degree]             # <<<<<<<<<<<<<<
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')
*/
      __pyx_t_5 = __pyx_v_G;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_9genexpr39__pyx_v_H};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Index, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2609, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_degree, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2609, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 2609, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_3) {

        /* "cython/core/triangulation.pyx":2607
 * 
 *         G = gap(self.fundamental_group())
 *         covers = [self.cover(H)             # <<<<<<<<<<<<<<
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)
 *                   if G.Index(H) == degree]
*/
        __pyx_t_4 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_9genexpr39__pyx_v_H};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cover, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2607, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 2607, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":2609
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)
 *                   if G.Index(H) == degree]             # <<<<<<<<<<<<<<
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')
*/
      }

      /* "cython/core/triangulation.pyx":2608
 *         G = gap(self.fundamental_group())
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)             # <<<<<<<<<<<<<<
 *                   if G.Index(H) == degree]
 *         for i, C in enumerate(covers):
*/
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_H); __pyx_9genexpr39__pyx_v_H = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_H); __pyx_9genexpr39__pyx_v_H = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  __pyx_v_covers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2610
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)
 *                   if G.Index(H) == degree]
 *         for i, C in enumerate(covers):             # <<<<<<<<<<<<<<
 *             C.set_name(C.name() + f'~{i}')
 *         return covers
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  __pyx_t_7 = __pyx_v_covers; __Pyx_INCREF(__pyx_t_7);
  __pyx_t_9 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2610, __pyx_L1_error)
      #endif
      if (__pyx_t_9 >= __pyx_temp) break;
    }
    __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_9);
    ++__pyx_t_9;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_C, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":2611
 *                   if G.Index(H) == degree]
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')             # <<<<<<<<<<<<<<
 *         return covers
 * 
*/
    __pyx_t_4 = __pyx_v_C;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_11 = __pyx_v_C;
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_i, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 2611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__24, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_Add(__pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 2611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":2610
 *                   for H in G.LowIndexSubgroupsFpGroup(degree)
 *                   if G.Index(H) == degree]
 *         for i, C in enumerate(covers):             # <<<<<<<<<<<<<<
 *             C.set_name(C.name() + f'~{i}')
 *         return covers
*/
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2612
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')
 *         return covers             # <<<<<<<<<<<<<<
 * 
 *     def _covers_magma(self, degree):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_covers);
  __pyx_r = __pyx_v_covers;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2599
 *         return covers
 * 
 *     def _covers_gap(self, degree):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using gap.
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_gap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_G);
  __Pyx_XDECREF(__pyx_v_covers);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_C);
  __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_H);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2614
 *         return covers
 * 
 *     def _covers_magma(self, degree):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using magma.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_135_covers_magma(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_8SnapPyHP_13Triangulation_134_covers_magma, "\n        Compute all covers using magma.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_135_covers_magma = {"_covers_magma", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_135_covers_magma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_134_covers_magma};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_135_covers_magma(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_degree = 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("_covers_magma (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2614, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2614, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_covers_magma", 0) < 0) __PYX_ERR(4, 2614, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_covers_magma", 1, 1, 1, i); __PYX_ERR(4, 2614, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2614, __pyx_L3_error)
    }
    __pyx_v_degree = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_covers_magma", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 2614, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_magma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_134_covers_magma(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_degree);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_134_covers_magma(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree) {
  PyObject *__pyx_v_G = NULL;
  PyObject *__pyx_v_covers = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_C = NULL;
  PyObject *__pyx_9genexpr40__pyx_v_H = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[5];
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_covers_magma", 0);

  /* "cython/core/triangulation.pyx":2618
 *         Compute all covers using magma.
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise SageNotAvailable('the "magma" method for covers requires Sage')
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2618, __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(4, 2618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":2619
 *         """
 *         if not _within_sage:
 *             raise SageNotAvailable('the "magma" method for covers requires Sage')             # <<<<<<<<<<<<<<
 * 
 *         G = magma(self.fundamental_group())
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SageNotAvailable); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_the_magma_method_for_covers_requ};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2619, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 2619, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2618
 *         Compute all covers using magma.
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise SageNotAvailable('the "magma" method for covers requires Sage')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2621
 *             raise SageNotAvailable('the "magma" method for covers requires Sage')
 * 
 *         G = magma(self.fundamental_group())             # <<<<<<<<<<<<<<
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_magma); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_G = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2622
 * 
 *         G = magma(self.fundamental_group())
 *         covers = [self.cover(H)             # <<<<<<<<<<<<<<
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                               (degree, degree))]
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2622, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/triangulation.pyx":2623
 *         G = magma(self.fundamental_group())
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %             # <<<<<<<<<<<<<<
 *                                               (degree, degree))]
 *         for i, C in enumerate(covers):
*/
    __pyx_t_7 = __pyx_v_G;
    __Pyx_INCREF(__pyx_t_7);

    /* "cython/core/triangulation.pyx":2624
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                               (degree, degree))]             # <<<<<<<<<<<<<<
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')
*/
    __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_degree), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2624, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_degree), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2624, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u__25;
    __pyx_t_9[1] = __pyx_t_5;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u__3;
    __pyx_t_9[3] = __pyx_t_8;
    __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u__26;

    /* "cython/core/triangulation.pyx":2623
 *         G = magma(self.fundamental_group())
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %             # <<<<<<<<<<<<<<
 *                                               (degree, degree))]
 *         for i, C in enumerate(covers):
*/
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_9, 5, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
    if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2623, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_LowIndexSubgroups, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2623, __pyx_L6_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_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2623, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 2623, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2623, __pyx_L6_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_11);
          ++__pyx_t_11;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2623, __pyx_L6_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_11);
          #endif
          ++__pyx_t_11;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2623, __pyx_L6_error)
      } else {
        __pyx_t_4 = __pyx_t_12(__pyx_t_10);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2623, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_H, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2622
 * 
 *         G = magma(self.fundamental_group())
 *         covers = [self.cover(H)             # <<<<<<<<<<<<<<
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                               (degree, degree))]
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_9genexpr40__pyx_v_H};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cover, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2622, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 2622, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2623
 *         G = magma(self.fundamental_group())
 *         covers = [self.cover(H)
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %             # <<<<<<<<<<<<<<
 *                                               (degree, degree))]
 *         for i, C in enumerate(covers):
*/
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_H); __pyx_9genexpr40__pyx_v_H = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_H); __pyx_9genexpr40__pyx_v_H = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_v_covers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2625
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                               (degree, degree))]
 *         for i, C in enumerate(covers):             # <<<<<<<<<<<<<<
 *             C.set_name(C.name() + f'~{i}')
 *         return covers
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  __pyx_t_10 = __pyx_v_covers; __Pyx_INCREF(__pyx_t_10);
  __pyx_t_11 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2625, __pyx_L1_error)
      #endif
      if (__pyx_t_11 >= __pyx_temp) break;
    }
    __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_11);
    ++__pyx_t_11;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_C, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2626
 *                                               (degree, degree))]
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')             # <<<<<<<<<<<<<<
 *         return covers
 * 
*/
    __pyx_t_7 = __pyx_v_C;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = __pyx_v_C;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_i, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__24, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 2626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2625
 *                   for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                               (degree, degree))]
 *         for i, C in enumerate(covers):             # <<<<<<<<<<<<<<
 *             C.set_name(C.name() + f'~{i}')
 *         return covers
*/
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2627
 *         for i, C in enumerate(covers):
 *             C.set_name(C.name() + f'~{i}')
 *         return covers             # <<<<<<<<<<<<<<
 * 
 *     def _covers_snappea(self, degree, cover_type):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_covers);
  __pyx_r = __pyx_v_covers;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2614
 *         return covers
 * 
 *     def _covers_magma(self, degree):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using magma.
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_magma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_G);
  __Pyx_XDECREF(__pyx_v_covers);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_C);
  __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_H);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2629
 *         return covers
 * 
 *     def _covers_snappea(self, degree, cover_type):             # <<<<<<<<<<<<<<
 *         """
 *         Compute cyclic or all covers using SnapPea kernel.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_137_covers_snappea(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_8SnapPyHP_13Triangulation_136_covers_snappea, "\n        Compute cyclic or all covers using SnapPea kernel.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_137_covers_snappea = {"_covers_snappea", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_137_covers_snappea, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_136_covers_snappea};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_137_covers_snappea(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_degree = 0;
  PyObject *__pyx_v_cover_type = 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("_covers_snappea (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,&__pyx_mstate_global->__pyx_n_u_cover_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2629, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2629, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2629, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_covers_snappea", 0) < 0) __PYX_ERR(4, 2629, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_covers_snappea", 1, 2, 2, i); __PYX_ERR(4, 2629, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2629, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2629, __pyx_L3_error)
    }
    __pyx_v_degree = values[0];
    __pyx_v_cover_type = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_covers_snappea", 1, 2, 2, __pyx_nargs); __PYX_ERR(4, 2629, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_snappea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_136_covers_snappea(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_degree, __pyx_v_cover_type);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_136_covers_snappea(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_cover_type) {
  RepresentationList *__pyx_v_reps;
  RepresentationIntoSn *__pyx_v_rep;
  Triangulation *__pyx_v_cover;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_T = 0;
  PermutationSubgroup __pyx_v_c_cover_type;
  PyObject *__pyx_v_covers = NULL;
  PyObject *__pyx_v_cover_count = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  RepresentationList *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  RepresentationIntoSn *__pyx_t_5;
  Triangulation *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_covers_snappea", 0);

  /* "cython/core/triangulation.pyx":2639
 *         cdef PermutationSubgroup c_cover_type
 * 
 *         if cover_type == 'cyclic':             # <<<<<<<<<<<<<<
 *             c_cover_type = permutation_subgroup_Zn
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_cover_type, __pyx_mstate_global->__pyx_n_u_cyclic, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2639, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2640
 * 
 *         if cover_type == 'cyclic':
 *             c_cover_type = permutation_subgroup_Zn             # <<<<<<<<<<<<<<
 *         else:
 *             c_cover_type = permutation_subgroup_Sn
*/
    __pyx_v_c_cover_type = permutation_subgroup_Zn;

    /* "cython/core/triangulation.pyx":2639
 *         cdef PermutationSubgroup c_cover_type
 * 
 *         if cover_type == 'cyclic':             # <<<<<<<<<<<<<<
 *             c_cover_type = permutation_subgroup_Zn
 *         else:
*/
    goto __pyx_L3;
  }

  /* "cython/core/triangulation.pyx":2642
 *             c_cover_type = permutation_subgroup_Zn
 *         else:
 *             c_cover_type = permutation_subgroup_Sn             # <<<<<<<<<<<<<<
 * 
 *         reps = find_representations(
*/
  /*else*/ {
    __pyx_v_c_cover_type = permutation_subgroup_Sn;
  }
  __pyx_L3:;

  /* "cython/core/triangulation.pyx":2645
 * 
 *         reps = find_representations(
 *             self.c_triangulation, degree, c_cover_type)             # <<<<<<<<<<<<<<
 * 
 *         covers = []
*/
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_degree); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2645, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2644
 *             c_cover_type = permutation_subgroup_Sn
 * 
 *         reps = find_representations(             # <<<<<<<<<<<<<<
 *             self.c_triangulation, degree, c_cover_type)
 * 
*/
  __pyx_t_3 = find_representations(__pyx_v_self->c_triangulation, __pyx_t_2, __pyx_v_c_cover_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2644, __pyx_L1_error)
  __pyx_v_reps = __pyx_t_3;

  /* "cython/core/triangulation.pyx":2647
 *             self.c_triangulation, degree, c_cover_type)
 * 
 *         covers = []             # <<<<<<<<<<<<<<
 *         rep = reps.list
 *         cover_count = 0
*/
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_covers = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2648
 * 
 *         covers = []
 *         rep = reps.list             # <<<<<<<<<<<<<<
 *         cover_count = 0
 *         while rep != NULL:
*/
  __pyx_t_5 = __pyx_v_reps->list;
  __pyx_v_rep = __pyx_t_5;

  /* "cython/core/triangulation.pyx":2649
 *         covers = []
 *         rep = reps.list
 *         cover_count = 0             # <<<<<<<<<<<<<<
 *         while rep != NULL:
 *             cover = construct_cover(self.c_triangulation,
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_cover_count = __pyx_mstate_global->__pyx_int_0;

  /* "cython/core/triangulation.pyx":2650
 *         rep = reps.list
 *         cover_count = 0
 *         while rep != NULL:             # <<<<<<<<<<<<<<
 *             cover = construct_cover(self.c_triangulation,
 *                                     rep,
*/
  while (1) {
    __pyx_t_1 = (__pyx_v_rep != NULL);
    if (!__pyx_t_1) break;

    /* "cython/core/triangulation.pyx":2651
 *         cover_count = 0
 *         while rep != NULL:
 *             cover = construct_cover(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                     rep,
 *                                     reps.num_sheets)
*/
    __pyx_t_6 = construct_cover(__pyx_v_self->c_triangulation, __pyx_v_rep, __pyx_v_reps->num_sheets); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2651, __pyx_L1_error)
    __pyx_v_cover = __pyx_t_6;

    /* "cython/core/triangulation.pyx":2654
 *                                     rep,
 *                                     reps.num_sheets)
 *             T = self.__class__('empty')             # <<<<<<<<<<<<<<
 *             T.set_c_triangulation(cover)
 *             T._cover_info = info = {
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(4, 2654, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_T, ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2655
 *                                     reps.num_sheets)
 *             T = self.__class__('empty')
 *             T.set_c_triangulation(cover)             # <<<<<<<<<<<<<<
 *             T._cover_info = info = {
 *                 'base'   : self.name(),
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_T->__pyx_vtab)->set_c_triangulation(__pyx_v_T, __pyx_v_cover); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2657
 *             T.set_c_triangulation(cover)
 *             T._cover_info = info = {
 *                 'base'   : self.name(),             # <<<<<<<<<<<<<<
 *                 'type'   : cover_types[rep.covering_type],
 *                 'degree' : degree
*/
    __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_base, __pyx_t_7) < 0) __PYX_ERR(4, 2657, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":2658
 *             T._cover_info = info = {
 *                 'base'   : self.name(),
 *                 'type'   : cover_types[rep.covering_type],             # <<<<<<<<<<<<<<
 *                 'degree' : degree
 *                 }
*/
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cover_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyLong_From_CoveringType(__pyx_v_rep->covering_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_10) < 0) __PYX_ERR(4, 2657, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cython/core/triangulation.pyx":2659
 *                 'base'   : self.name(),
 *                 'type'   : cover_types[rep.covering_type],
 *                 'degree' : degree             # <<<<<<<<<<<<<<
 *                 }
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %
*/
    if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_degree, __pyx_v_degree) < 0) __PYX_ERR(4, 2657, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2656
 *             T = self.__class__('empty')
 *             T.set_c_triangulation(cover)
 *             T._cover_info = info = {             # <<<<<<<<<<<<<<
 *                 'base'   : self.name(),
 *                 'type'   : cover_types[rep.covering_type],
*/
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_T->_cover_info);
    __Pyx_DECREF(__pyx_v_T->_cover_info);
    __pyx_v_T->_cover_info = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2661
 *                 'degree' : degree
 *                 }
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %             # <<<<<<<<<<<<<<
 *                        cover_count)
 *             covers.append(T)
*/
    __pyx_t_10 = ((PyObject *)__pyx_v_T);
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_info, __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_mstate_global->__pyx_kp_u__24); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_info, __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_t_9, 0, 3, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cython/core/triangulation.pyx":2662
 *                 }
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %
 *                        cover_count)             # <<<<<<<<<<<<<<
 *             covers.append(T)
 *             cover_count += 1
*/
    __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d_3, __pyx_v_cover_count); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "cython/core/triangulation.pyx":2661
 *                 'degree' : degree
 *                 }
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %             # <<<<<<<<<<<<<<
 *                        cover_count)
 *             covers.append(T)
*/
    __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2663
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %
 *                        cover_count)
 *             covers.append(T)             # <<<<<<<<<<<<<<
 *             cover_count += 1
 *             rep = rep.next
*/
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_covers, ((PyObject *)__pyx_v_T)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(4, 2663, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2664
 *                        cover_count)
 *             covers.append(T)
 *             cover_count += 1             # <<<<<<<<<<<<<<
 *             rep = rep.next
 * 
*/
    __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_cover_count, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_cover_count, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2665
 *             covers.append(T)
 *             cover_count += 1
 *             rep = rep.next             # <<<<<<<<<<<<<<
 * 
 *         free_representation_list(reps)
*/
    __pyx_t_5 = __pyx_v_rep->next;
    __pyx_v_rep = __pyx_t_5;
  }

  /* "cython/core/triangulation.pyx":2667
 *             rep = rep.next
 * 
 *         free_representation_list(reps)             # <<<<<<<<<<<<<<
 *         return covers
 * 
*/
  free_representation_list(__pyx_v_reps); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2667, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2668
 * 
 *         free_representation_list(reps)
 *         return covers             # <<<<<<<<<<<<<<
 * 
 *     cdef RepresentationIntoSn *build_rep_into_Sn(self, perm_list) except ? NULL:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_covers);
  __pyx_r = __pyx_v_covers;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2629
 *         return covers
 * 
 *     def _covers_snappea(self, degree, cover_type):             # <<<<<<<<<<<<<<
 *         """
 *         Compute cyclic or all covers using SnapPea kernel.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._covers_snappea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_T);
  __Pyx_XDECREF(__pyx_v_covers);
  __Pyx_XDECREF(__pyx_v_cover_count);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2670
 *         return covers
 * 
 *     cdef RepresentationIntoSn *build_rep_into_Sn(self, perm_list) except ? NULL:             # <<<<<<<<<<<<<<
 *         """
 *         Build a SnapPea RepresentationIntoSn from a list of
*/

static RepresentationIntoSn *__pyx_f_8SnapPyHP_13Triangulation_build_rep_into_Sn(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_perm_list) {
  Triangulation *__pyx_v_c_triangulation;
  RepresentationIntoSn *__pyx_v_c_representation;
  RepresentationIntoSn *__pyx_v_c_repn_in_original_gens;
  int __pyx_v_i;
  int __pyx_v_j;
  int **__pyx_v_c_original_generators;
  int **__pyx_v_c_relators;
  int **__pyx_v_c_meridians;
  int **__pyx_v_c_longitudes;
  Py_ssize_t __pyx_v_degree;
  PyObject *__pyx_v_S = NULL;
  PyObject *__pyx_v_permutation = NULL;
  PyObject *__pyx_v_num_cusps = NULL;
  PyObject *__pyx_v_G = NULL;
  PyObject *__pyx_v_num_generators = NULL;
  PyObject *__pyx_v_relators = NULL;
  PyObject *__pyx_v_num_relators = NULL;
  PyObject *__pyx_v_orig_gens = NULL;
  PyObject *__pyx_v_num_orig_gens = NULL;
  PyObject *__pyx_v_peripheral_curves = NULL;
  PyObject *__pyx_v_meridian = NULL;
  PyObject *__pyx_v_longitude = NULL;
  int __pyx_v_failed;
  PyObject *__pyx_v_message = NULL;
  RepresentationIntoSn *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __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;
  size_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Triangulation *__pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  RepresentationIntoSn *__pyx_t_12;
  int *__pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  Boolean __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_rep_into_Sn", 0);

  /* "cython/core/triangulation.pyx":2682
 *         cdef c_Triangulation* c_triangulation
 *         cdef RepresentationIntoSn* c_representation
 *         cdef RepresentationIntoSn* c_repn_in_original_gens = NULL             # <<<<<<<<<<<<<<
 *         cdef int i, j
 *         cdef int** c_original_generators
*/
  __pyx_v_c_repn_in_original_gens = NULL;

  /* "cython/core/triangulation.pyx":2689
 *         cdef int** c_longitudes
 * 
 *         if len(perm_list) == 0:  # implies trivial presentation             # <<<<<<<<<<<<<<
 *             degree = 1
 *         else:
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_perm_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2689, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 0);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":2690
 * 
 *         if len(perm_list) == 0:  # implies trivial presentation
 *             degree = 1             # <<<<<<<<<<<<<<
 *         else:
 *             degree = len(perm_list[0])
*/
    __pyx_v_degree = 1;

    /* "cython/core/triangulation.pyx":2689
 *         cdef int** c_longitudes
 * 
 *         if len(perm_list) == 0:  # implies trivial presentation             # <<<<<<<<<<<<<<
 *             degree = 1
 *         else:
*/
    goto __pyx_L3;
  }

  /* "cython/core/triangulation.pyx":2692
 *             degree = 1
 *         else:
 *             degree = len(perm_list[0])             # <<<<<<<<<<<<<<
 * 
 *         # Sanity check
*/
  /*else*/ {
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_perm_list, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2692, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_degree = __pyx_t_1;
  }
  __pyx_L3:;

  /* "cython/core/triangulation.pyx":2695
 * 
 *         # Sanity check
 *         S = set(range(degree))             # <<<<<<<<<<<<<<
 *         for permutation in perm_list:
 *             if set(permutation) != S:
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_5 = __pyx_builtin_range; 
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_degree); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_S = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2696
 *         # Sanity check
 *         S = set(range(degree))
 *         for permutation in perm_list:             # <<<<<<<<<<<<<<
 *             if set(permutation) != S:
 *                 raise ValueError('The permutation list is invalid.')
*/
  if (likely(PyList_CheckExact(__pyx_v_perm_list)) || PyTuple_CheckExact(__pyx_v_perm_list)) {
    __pyx_t_5 = __pyx_v_perm_list; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_perm_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2696, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2696, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2696, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2696, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_5);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2696, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_permutation, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":2697
 *         S = set(range(degree))
 *         for permutation in perm_list:
 *             if set(permutation) != S:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The permutation list is invalid.')
 * 
*/
    __pyx_t_3 = PySet_New(__pyx_v_permutation); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_v_S, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 2697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_t_2)) {

      /* "cython/core/triangulation.pyx":2698
 *         for permutation in perm_list:
 *             if set(permutation) != S:
 *                 raise ValueError('The permutation list is invalid.')             # <<<<<<<<<<<<<<
 * 
 *         # Initialize
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_4 = __pyx_builtin_ValueError; 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_permutation_list_is_invalid};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2698, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(4, 2698, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2697
 *         S = set(range(degree))
 *         for permutation in perm_list:
 *             if set(permutation) != S:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The permutation list is invalid.')
 * 
*/
    }

    /* "cython/core/triangulation.pyx":2696
 *         # Sanity check
 *         S = set(range(degree))
 *         for permutation in perm_list:             # <<<<<<<<<<<<<<
 *             if set(permutation) != S:
 *                 raise ValueError('The permutation list is invalid.')
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2701
 * 
 *         # Initialize
 *         num_cusps = self.num_cusps()             # <<<<<<<<<<<<<<
 *         c_triangulation = self.c_triangulation
 *         G = self.fundamental_group()
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_num_cusps = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2702
 *         # Initialize
 *         num_cusps = self.num_cusps()
 *         c_triangulation = self.c_triangulation             # <<<<<<<<<<<<<<
 *         G = self.fundamental_group()
 *         num_generators = G.num_generators()
*/
  __pyx_t_9 = __pyx_v_self->c_triangulation;
  __pyx_v_c_triangulation = __pyx_t_9;

  /* "cython/core/triangulation.pyx":2703
 *         num_cusps = self.num_cusps()
 *         c_triangulation = self.c_triangulation
 *         G = self.fundamental_group()             # <<<<<<<<<<<<<<
 *         num_generators = G.num_generators()
 *         if len(perm_list) != num_generators:
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_G = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2704
 *         c_triangulation = self.c_triangulation
 *         G = self.fundamental_group()
 *         num_generators = G.num_generators()             # <<<<<<<<<<<<<<
 *         if len(perm_list) != num_generators:
 *             raise ValueError('Number of permutations is not the same '
*/
  __pyx_t_6 = __pyx_v_G;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_num_generators = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2705
 *         G = self.fundamental_group()
 *         num_generators = G.num_generators()
 *         if len(perm_list) != num_generators:             # <<<<<<<<<<<<<<
 *             raise ValueError('Number of permutations is not the same '
 *                              'as the number of generators')
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_perm_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2705, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_num_generators, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 2705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/triangulation.pyx":2706
 *         num_generators = G.num_generators()
 *         if len(perm_list) != num_generators:
 *             raise ValueError('Number of permutations is not the same '             # <<<<<<<<<<<<<<
 *                              'as the number of generators')
 * 
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Number_of_permutations_is_not_th};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(4, 2706, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2705
 *         G = self.fundamental_group()
 *         num_generators = G.num_generators()
 *         if len(perm_list) != num_generators:             # <<<<<<<<<<<<<<
 *             raise ValueError('Number of permutations is not the same '
 *                              'as the number of generators')
*/
  }

  /* "cython/core/triangulation.pyx":2709
 *                              'as the number of generators')
 * 
 *         relators = G.relators(as_int_list=True)             # <<<<<<<<<<<<<<
 *         num_relators = len(relators)
 *         orig_gens = G.original_generators(as_int_list=True)
*/
  __pyx_t_4 = __pyx_v_G;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_as_int_list, Py_True, __pyx_t_5, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 2709, __pyx_L1_error)
    __pyx_t_6 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_relators, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_relators = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":2710
 * 
 *         relators = G.relators(as_int_list=True)
 *         num_relators = len(relators)             # <<<<<<<<<<<<<<
 *         orig_gens = G.original_generators(as_int_list=True)
 *         num_orig_gens = len(orig_gens)
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_relators); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2710, __pyx_L1_error)
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_num_relators = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":2711
 *         relators = G.relators(as_int_list=True)
 *         num_relators = len(relators)
 *         orig_gens = G.original_generators(as_int_list=True)             # <<<<<<<<<<<<<<
 *         num_orig_gens = len(orig_gens)
 *         peripheral_curves = G.peripheral_curves(as_int_list=True)
*/
  __pyx_t_5 = __pyx_v_G;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_as_int_list, Py_True, __pyx_t_4, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 2711, __pyx_L1_error)
    __pyx_t_6 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_original_generators, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_orig_gens = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":2712
 *         num_relators = len(relators)
 *         orig_gens = G.original_generators(as_int_list=True)
 *         num_orig_gens = len(orig_gens)             # <<<<<<<<<<<<<<
 *         peripheral_curves = G.peripheral_curves(as_int_list=True)
 * 
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_orig_gens); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2712, __pyx_L1_error)
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_num_orig_gens = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":2713
 *         orig_gens = G.original_generators(as_int_list=True)
 *         num_orig_gens = len(orig_gens)
 *         peripheral_curves = G.peripheral_curves(as_int_list=True)             # <<<<<<<<<<<<<<
 * 
 *         # Allocate a whole bunch of memory, SnapPea and malloc.
*/
  __pyx_t_4 = __pyx_v_G;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_as_int_list, Py_True, __pyx_t_5, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 2713, __pyx_L1_error)
    __pyx_t_6 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_peripheral_curves, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_peripheral_curves = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":2717
 *         # Allocate a whole bunch of memory, SnapPea and malloc.
 *         c_representation = initialize_new_representation(
 *             num_orig_gens,             # <<<<<<<<<<<<<<
 *             <int>degree,
 *             num_cusps)
*/
  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2717, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2719
 *             num_orig_gens,
 *             <int>degree,
 *             num_cusps)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_generators:
 *             for j from 0 <= j < degree:
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2719, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2716
 * 
 *         # Allocate a whole bunch of memory, SnapPea and malloc.
 *         c_representation = initialize_new_representation(             # <<<<<<<<<<<<<<
 *             num_orig_gens,
 *             <int>degree,
*/
  __pyx_t_12 = initialize_new_representation(__pyx_t_10, ((int)__pyx_v_degree), __pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2716, __pyx_L1_error)
  __pyx_v_c_representation = __pyx_t_12;

  /* "cython/core/triangulation.pyx":2720
 *             <int>degree,
 *             num_cusps)
 *         for i from 0 <= i < num_generators:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < degree:
 *                 c_representation.image[i][j] = perm_list[i][j]
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_generators); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2720, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2721
 *             num_cusps)
 *         for i from 0 <= i < num_generators:
 *             for j from 0 <= j < degree:             # <<<<<<<<<<<<<<
 *                 c_representation.image[i][j] = perm_list[i][j]
 *         c_original_generators = <int**>malloc(num_orig_gens*sizeof(int*))
*/
    __pyx_t_1 = __pyx_v_degree;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) {

      /* "cython/core/triangulation.pyx":2722
 *         for i from 0 <= i < num_generators:
 *             for j from 0 <= j < degree:
 *                 c_representation.image[i][j] = perm_list[i][j]             # <<<<<<<<<<<<<<
 *         c_original_generators = <int**>malloc(num_orig_gens*sizeof(int*))
 *         for i from  0 <= i < num_orig_gens:
*/
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_perm_list, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_j, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2722, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      ((__pyx_v_c_representation->image[__pyx_v_i])[__pyx_v_j]) = __pyx_t_10;
    }
  }

  /* "cython/core/triangulation.pyx":2723
 *             for j from 0 <= j < degree:
 *                 c_representation.image[i][j] = perm_list[i][j]
 *         c_original_generators = <int**>malloc(num_orig_gens*sizeof(int*))             # <<<<<<<<<<<<<<
 *         for i from  0 <= i < num_orig_gens:
 *             c_original_generators[i] = c_word_from_list(orig_gens[i])
*/
  __pyx_t_5 = __Pyx_PyLong_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Multiply(__pyx_v_num_orig_gens, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyLong_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_c_original_generators = ((int **)malloc(__pyx_t_7));

  /* "cython/core/triangulation.pyx":2724
 *                 c_representation.image[i][j] = perm_list[i][j]
 *         c_original_generators = <int**>malloc(num_orig_gens*sizeof(int*))
 *         for i from  0 <= i < num_orig_gens:             # <<<<<<<<<<<<<<
 *             c_original_generators[i] = c_word_from_list(orig_gens[i])
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2724, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2725
 *         c_original_generators = <int**>malloc(num_orig_gens*sizeof(int*))
 *         for i from  0 <= i < num_orig_gens:
 *             c_original_generators[i] = c_word_from_list(orig_gens[i])             # <<<<<<<<<<<<<<
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))
 *         for i from  0 <= i < num_relators:
*/
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_orig_gens, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_13 = __pyx_f_8SnapPyHP_c_word_from_list(__pyx_t_6); if (unlikely(__pyx_t_13 == ((int *)0) && PyErr_Occurred())) __PYX_ERR(4, 2725, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    (__pyx_v_c_original_generators[__pyx_v_i]) = __pyx_t_13;
  }

  /* "cython/core/triangulation.pyx":2726
 *         for i from  0 <= i < num_orig_gens:
 *             c_original_generators[i] = c_word_from_list(orig_gens[i])
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))             # <<<<<<<<<<<<<<
 *         for i from  0 <= i < num_relators:
 *             c_relators[i] = c_word_from_list(relators[i])
*/
  __pyx_t_6 = __Pyx_PyLong_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_num_relators, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyLong_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_c_relators = ((int **)malloc(__pyx_t_7));

  /* "cython/core/triangulation.pyx":2727
 *             c_original_generators[i] = c_word_from_list(orig_gens[i])
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))
 *         for i from  0 <= i < num_relators:             # <<<<<<<<<<<<<<
 *             c_relators[i] = c_word_from_list(relators[i])
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_relators); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2727, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2728
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))
 *         for i from  0 <= i < num_relators:
 *             c_relators[i] = c_word_from_list(relators[i])             # <<<<<<<<<<<<<<
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))
*/
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_relators, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_13 = __pyx_f_8SnapPyHP_c_word_from_list(__pyx_t_5); if (unlikely(__pyx_t_13 == ((int *)0) && PyErr_Occurred())) __PYX_ERR(4, 2728, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    (__pyx_v_c_relators[__pyx_v_i]) = __pyx_t_13;
  }

  /* "cython/core/triangulation.pyx":2729
 *         for i from  0 <= i < num_relators:
 *             c_relators[i] = c_word_from_list(relators[i])
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))             # <<<<<<<<<<<<<<
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))
 *         for i from 0 <= i < num_cusps:
*/
  __pyx_t_5 = __Pyx_PyLong_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Multiply(__pyx_v_num_cusps, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyLong_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_c_meridians = ((int **)malloc(__pyx_t_7));

  /* "cython/core/triangulation.pyx":2730
 *             c_relators[i] = c_word_from_list(relators[i])
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_cusps:
 *             meridian, longitude = peripheral_curves[i]
*/
  __pyx_t_6 = __Pyx_PyLong_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_num_cusps, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyLong_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2730, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_c_longitudes = ((int **)malloc(__pyx_t_7));

  /* "cython/core/triangulation.pyx":2731
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))
 *         for i from 0 <= i < num_cusps:             # <<<<<<<<<<<<<<
 *             meridian, longitude = peripheral_curves[i]
 *             c_meridians[i] = c_word_from_list(meridian)
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2731, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2732
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))
 *         for i from 0 <= i < num_cusps:
 *             meridian, longitude = peripheral_curves[i]             # <<<<<<<<<<<<<<
 *             c_meridians[i] = c_word_from_list(meridian)
 *             c_longitudes[i] = c_word_from_list(longitude)
*/
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peripheral_curves, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2732, __pyx_L1_error)
    __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(4, 2732, __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_INCREF(__pyx_t_6);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2732, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2732, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
      index = 0; __pyx_t_6 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) __PYX_ERR(4, 2732, __pyx_L1_error)
      __pyx_t_14 = NULL;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L20_unpacking_done;
      __pyx_L19_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_14 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 2732, __pyx_L1_error)
      __pyx_L20_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_meridian, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_longitude, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2733
 *         for i from 0 <= i < num_cusps:
 *             meridian, longitude = peripheral_curves[i]
 *             c_meridians[i] = c_word_from_list(meridian)             # <<<<<<<<<<<<<<
 *             c_longitudes[i] = c_word_from_list(longitude)
 *         # Whew!
*/
    __pyx_t_13 = __pyx_f_8SnapPyHP_c_word_from_list(__pyx_v_meridian); if (unlikely(__pyx_t_13 == ((int *)0) && PyErr_Occurred())) __PYX_ERR(4, 2733, __pyx_L1_error)
    (__pyx_v_c_meridians[__pyx_v_i]) = __pyx_t_13;

    /* "cython/core/triangulation.pyx":2734
 *             meridian, longitude = peripheral_curves[i]
 *             c_meridians[i] = c_word_from_list(meridian)
 *             c_longitudes[i] = c_word_from_list(longitude)             # <<<<<<<<<<<<<<
 *         # Whew!
 * 
*/
    __pyx_t_13 = __pyx_f_8SnapPyHP_c_word_from_list(__pyx_v_longitude); if (unlikely(__pyx_t_13 == ((int *)0) && PyErr_Occurred())) __PYX_ERR(4, 2734, __pyx_L1_error)
    (__pyx_v_c_longitudes[__pyx_v_i]) = __pyx_t_13;
  }

  /* "cython/core/triangulation.pyx":2737
 *         # Whew!
 * 
 *         failed = False             # <<<<<<<<<<<<<<
 *         if (candidateSn_is_valid(c_representation.image,
 *                                  <int>degree, c_relators, num_relators) and
*/
  __pyx_v_failed = 0;

  /* "cython/core/triangulation.pyx":2739
 *         failed = False
 *         if (candidateSn_is_valid(c_representation.image,
 *                                  <int>degree, c_relators, num_relators) and             # <<<<<<<<<<<<<<
 *             candidateSn_is_transitive(c_representation.image,
 *                                       num_generators, <int>degree) ):
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_relators); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2739, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2738
 * 
 *         failed = False
 *         if (candidateSn_is_valid(c_representation.image,             # <<<<<<<<<<<<<<
 *                                  <int>degree, c_relators, num_relators) and
 *             candidateSn_is_transitive(c_representation.image,
*/
  __pyx_t_15 = candidateSn_is_valid(__pyx_v_c_representation->image, ((int)__pyx_v_degree), __pyx_v_c_relators, __pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2738, __pyx_L1_error)
  __pyx_t_16 = (__pyx_t_15 != 0);
  if (__pyx_t_16) {
  } else {
    __pyx_t_2 = __pyx_t_16;
    goto __pyx_L22_bool_binop_done;
  }

  /* "cython/core/triangulation.pyx":2741
 *                                  <int>degree, c_relators, num_relators) and
 *             candidateSn_is_transitive(c_representation.image,
 *                                       num_generators, <int>degree) ):             # <<<<<<<<<<<<<<
 *             c_repn_in_original_gens = convert_candidateSn_to_original_generators(
 *                 c_representation.image,
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_generators); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2741, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2740
 *         if (candidateSn_is_valid(c_representation.image,
 *                                  <int>degree, c_relators, num_relators) and
 *             candidateSn_is_transitive(c_representation.image,             # <<<<<<<<<<<<<<
 *                                       num_generators, <int>degree) ):
 *             c_repn_in_original_gens = convert_candidateSn_to_original_generators(
*/
  __pyx_t_15 = candidateSn_is_transitive(__pyx_v_c_representation->image, __pyx_t_11, ((int)__pyx_v_degree)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2740, __pyx_L1_error)
  __pyx_t_16 = (__pyx_t_15 != 0);
  __pyx_t_2 = __pyx_t_16;
  __pyx_L22_bool_binop_done:;

  /* "cython/core/triangulation.pyx":2738
 * 
 *         failed = False
 *         if (candidateSn_is_valid(c_representation.image,             # <<<<<<<<<<<<<<
 *                                  <int>degree, c_relators, num_relators) and
 *             candidateSn_is_transitive(c_representation.image,
*/
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":2745
 *                 c_representation.image,
 *                 <int>degree,
 *                 num_orig_gens,             # <<<<<<<<<<<<<<
 *                 c_original_generators,
 *                 c_triangulation,
*/
    __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2745, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2742
 *             candidateSn_is_transitive(c_representation.image,
 *                                       num_generators, <int>degree) ):
 *             c_repn_in_original_gens = convert_candidateSn_to_original_generators(             # <<<<<<<<<<<<<<
 *                 c_representation.image,
 *                 <int>degree,
*/
    __pyx_t_12 = convert_candidateSn_to_original_generators(__pyx_v_c_representation->image, ((int)__pyx_v_degree), __pyx_t_11, __pyx_v_c_original_generators, __pyx_v_c_triangulation, __pyx_v_c_meridians, __pyx_v_c_longitudes); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2742, __pyx_L1_error)
    __pyx_v_c_repn_in_original_gens = __pyx_t_12;

    /* "cython/core/triangulation.pyx":2738
 * 
 *         failed = False
 *         if (candidateSn_is_valid(c_representation.image,             # <<<<<<<<<<<<<<
 *                                  <int>degree, c_relators, num_relators) and
 *             candidateSn_is_transitive(c_representation.image,
*/
    goto __pyx_L21;
  }

  /* "cython/core/triangulation.pyx":2751
 *                 c_longitudes)
 *         else:
 *             message = 'Invalid permutation data.'             # <<<<<<<<<<<<<<
 *             failed = True
 *         if c_repn_in_original_gens == NULL:
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Invalid_permutation_data);
    __pyx_v_message = __pyx_mstate_global->__pyx_kp_u_Invalid_permutation_data;

    /* "cython/core/triangulation.pyx":2752
 *         else:
 *             message = 'Invalid permutation data.'
 *             failed = True             # <<<<<<<<<<<<<<
 *         if c_repn_in_original_gens == NULL:
 *             message = 'Failed to construct permutation representation.'
*/
    __pyx_v_failed = 1;
  }
  __pyx_L21:;

  /* "cython/core/triangulation.pyx":2753
 *             message = 'Invalid permutation data.'
 *             failed = True
 *         if c_repn_in_original_gens == NULL:             # <<<<<<<<<<<<<<
 *             message = 'Failed to construct permutation representation.'
 *             failed = True
*/
  __pyx_t_2 = (__pyx_v_c_repn_in_original_gens == NULL);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":2754
 *             failed = True
 *         if c_repn_in_original_gens == NULL:
 *             message = 'Failed to construct permutation representation.'             # <<<<<<<<<<<<<<
 *             failed = True
 * 
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Failed_to_construct_permutation);
    __Pyx_XDECREF_SET(__pyx_v_message, __pyx_mstate_global->__pyx_kp_u_Failed_to_construct_permutation);

    /* "cython/core/triangulation.pyx":2755
 *         if c_repn_in_original_gens == NULL:
 *             message = 'Failed to construct permutation representation.'
 *             failed = True             # <<<<<<<<<<<<<<
 * 
 *         # Now free all that memory
*/
    __pyx_v_failed = 1;

    /* "cython/core/triangulation.pyx":2753
 *             message = 'Invalid permutation data.'
 *             failed = True
 *         if c_repn_in_original_gens == NULL:             # <<<<<<<<<<<<<<
 *             message = 'Failed to construct permutation representation.'
 *             failed = True
*/
  }

  /* "cython/core/triangulation.pyx":2758
 * 
 *         # Now free all that memory
 *         for i from 0 <= i < num_cusps:             # <<<<<<<<<<<<<<
 *             free(c_meridians[i])
 *             free(c_longitudes[i])
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2758, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2759
 *         # Now free all that memory
 *         for i from 0 <= i < num_cusps:
 *             free(c_meridians[i])             # <<<<<<<<<<<<<<
 *             free(c_longitudes[i])
 *         free(c_meridians)
*/
    free((__pyx_v_c_meridians[__pyx_v_i]));

    /* "cython/core/triangulation.pyx":2760
 *         for i from 0 <= i < num_cusps:
 *             free(c_meridians[i])
 *             free(c_longitudes[i])             # <<<<<<<<<<<<<<
 *         free(c_meridians)
 *         free(c_longitudes)
*/
    free((__pyx_v_c_longitudes[__pyx_v_i]));
  }

  /* "cython/core/triangulation.pyx":2761
 *             free(c_meridians[i])
 *             free(c_longitudes[i])
 *         free(c_meridians)             # <<<<<<<<<<<<<<
 *         free(c_longitudes)
 *         for i from 0 <= i < num_relators:
*/
  free(__pyx_v_c_meridians);

  /* "cython/core/triangulation.pyx":2762
 *             free(c_longitudes[i])
 *         free(c_meridians)
 *         free(c_longitudes)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_relators:
 *             free(c_relators[i])
*/
  free(__pyx_v_c_longitudes);

  /* "cython/core/triangulation.pyx":2763
 *         free(c_meridians)
 *         free(c_longitudes)
 *         for i from 0 <= i < num_relators:             # <<<<<<<<<<<<<<
 *             free(c_relators[i])
 *         free(c_relators)
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_relators); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2763, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2764
 *         free(c_longitudes)
 *         for i from 0 <= i < num_relators:
 *             free(c_relators[i])             # <<<<<<<<<<<<<<
 *         free(c_relators)
 *         for i from 0 <= i < num_orig_gens:
*/
    free((__pyx_v_c_relators[__pyx_v_i]));
  }

  /* "cython/core/triangulation.pyx":2765
 *         for i from 0 <= i < num_relators:
 *             free(c_relators[i])
 *         free(c_relators)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_orig_gens:
 *             free(c_original_generators[i])
*/
  free(__pyx_v_c_relators);

  /* "cython/core/triangulation.pyx":2766
 *             free(c_relators[i])
 *         free(c_relators)
 *         for i from 0 <= i < num_orig_gens:             # <<<<<<<<<<<<<<
 *             free(c_original_generators[i])
 *         free(c_original_generators)
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2766, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2767
 *         free(c_relators)
 *         for i from 0 <= i < num_orig_gens:
 *             free(c_original_generators[i])             # <<<<<<<<<<<<<<
 *         free(c_original_generators)
 *         free_representation(c_representation, num_generators, num_cusps)
*/
    free((__pyx_v_c_original_generators[__pyx_v_i]));
  }

  /* "cython/core/triangulation.pyx":2768
 *         for i from 0 <= i < num_orig_gens:
 *             free(c_original_generators[i])
 *         free(c_original_generators)             # <<<<<<<<<<<<<<
 *         free_representation(c_representation, num_generators, num_cusps)
 *         # Free at last!
*/
  free(__pyx_v_c_original_generators);

  /* "cython/core/triangulation.pyx":2769
 *             free(c_original_generators[i])
 *         free(c_original_generators)
 *         free_representation(c_representation, num_generators, num_cusps)             # <<<<<<<<<<<<<<
 *         # Free at last!
 * 
*/
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_num_generators); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2769, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2769, __pyx_L1_error)
  free_representation(__pyx_v_c_representation, __pyx_t_11, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2769, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2772
 *         # Free at last!
 * 
 *         if failed:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(message)
 *         return c_repn_in_original_gens
*/
  if (unlikely(__pyx_v_failed)) {

    /* "cython/core/triangulation.pyx":2773
 * 
 *         if failed:
 *             raise RuntimeError(message)             # <<<<<<<<<<<<<<
 *         return c_repn_in_original_gens
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_6 = __pyx_builtin_RuntimeError; 
    if (unlikely(!__pyx_v_message)) { __Pyx_RaiseUnboundLocalError("message"); __PYX_ERR(4, 2773, __pyx_L1_error) }
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_message};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2773, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(4, 2773, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2772
 *         # Free at last!
 * 
 *         if failed:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(message)
 *         return c_repn_in_original_gens
*/
  }

  /* "cython/core/triangulation.pyx":2774
 *         if failed:
 *             raise RuntimeError(message)
 *         return c_repn_in_original_gens             # <<<<<<<<<<<<<<
 * 
 *     def set_peripheral_curves(self, peripheral_data,
*/
  __pyx_r = __pyx_v_c_repn_in_original_gens;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2670
 *         return covers
 * 
 *     cdef RepresentationIntoSn *build_rep_into_Sn(self, perm_list) except ? NULL:             # <<<<<<<<<<<<<<
 *         """
 *         Build a SnapPea RepresentationIntoSn from a list of
*/

  /* 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("SnapPyHP.Triangulation.build_rep_into_Sn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_S);
  __Pyx_XDECREF(__pyx_v_permutation);
  __Pyx_XDECREF(__pyx_v_num_cusps);
  __Pyx_XDECREF(__pyx_v_G);
  __Pyx_XDECREF(__pyx_v_num_generators);
  __Pyx_XDECREF(__pyx_v_relators);
  __Pyx_XDECREF(__pyx_v_num_relators);
  __Pyx_XDECREF(__pyx_v_orig_gens);
  __Pyx_XDECREF(__pyx_v_num_orig_gens);
  __Pyx_XDECREF(__pyx_v_peripheral_curves);
  __Pyx_XDECREF(__pyx_v_meridian);
  __Pyx_XDECREF(__pyx_v_longitude);
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2776
 *         return c_repn_in_original_gens
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_139set_peripheral_curves(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_8SnapPyHP_13Triangulation_138set_peripheral_curves, "\n        Each cusp has a preferred marking. In the case of a torus\n        cusp, this is pair of essential simple curves meeting in one\n        point; equivalently, a basis of the first homology of the\n        boundary torus. These curves are called the meridian and the\n        longitude.\n\n        This method changes these markings in various ways.  In many\n        cases, if the flag return_matrices is True then it returns\n        a list of change-of-basis matrices is returned, one per\n        cusp, which will restore the original markings if passed\n        as peripheral_data.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_139set_peripheral_curves = {"set_peripheral_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_139set_peripheral_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_138set_peripheral_curves};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_139set_peripheral_curves(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_peripheral_data = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_return_matrices = 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_peripheral_curves (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_peripheral_data,&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_return_matrices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2776, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2776, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2776, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2776, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_peripheral_curves", 0) < 0) __PYX_ERR(4, 2776, __pyx_L3_error)

      /* "cython/core/triangulation.pyx":2777
 * 
 *     def set_peripheral_curves(self, peripheral_data,
 *                               which_cusp=None, return_matrices=False):             # <<<<<<<<<<<<<<
 *         """
 *         Each cusp has a preferred marking. In the case of a torus
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_peripheral_curves", 0, 1, 3, i); __PYX_ERR(4, 2776, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2776, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2776, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2776, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_peripheral_data = values[0];
    __pyx_v_which_cusp = values[1];
    __pyx_v_return_matrices = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_peripheral_curves", 0, 1, 3, __pyx_nargs); __PYX_ERR(4, 2776, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.set_peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_138set_peripheral_curves(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_peripheral_data, __pyx_v_which_cusp, __pyx_v_return_matrices);

  /* "cython/core/triangulation.pyx":2776
 *         return c_repn_in_original_gens
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_138set_peripheral_curves(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_peripheral_data, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_return_matrices) {
  int __pyx_v_a;
  int __pyx_v_b;
  int __pyx_v_c;
  int __pyx_v_d;
  MatrixInt22 *__pyx_v_matrices;
  FuncResult __pyx_v_result;
  PyObject *__pyx_v_cobs = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_meridian = NULL;
  PyObject *__pyx_v_longitude = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_basis = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  FuncResult __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22[9];
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_peripheral_curves", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/triangulation.pyx":2795
 *         cdef c_FuncResult result
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2796
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty')             # <<<<<<<<<<<<<<
 * 
 *         if which_cusp is not None:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty_2};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 2796, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2795
 *         cdef c_FuncResult result
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2798
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp is not None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
*/
  __pyx_t_1 = (__pyx_v_which_cusp != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2799
 * 
 *         if which_cusp is not None:
 *             which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *                 which_cusp, self.num_cusps(),
 *                 'The specified cusp (%s) does not exist.')
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/triangulation.pyx":2800
 *         if which_cusp is not None:
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),             # <<<<<<<<<<<<<<
 *                 'The specified cusp (%s) does not exist.')
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_which_cusp, __pyx_t_6, __pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2799, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2798
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp is not None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
*/
  }

  /* "cython/core/triangulation.pyx":2803
 *                 'The specified cusp (%s) does not exist.')
 * 
 *         self._cache.clear(message='set_peripheral_curves')             # <<<<<<<<<<<<<<
 *         if peripheral_data == 'fillings':
 *             if which_cusp is not None:
*/
  __pyx_t_3 = __pyx_v_self->_cache;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_n_u_set_peripheral_curves, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 2803, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2804
 * 
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':             # <<<<<<<<<<<<<<
 *             if which_cusp is not None:
 *                 raise ValueError("You must apply 'fillings' to all "
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_peripheral_data, __pyx_mstate_global->__pyx_n_u_fillings, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2804, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2805
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':
 *             if which_cusp is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'fillings' to all "
 *                                  "of the cusps.")
*/
    __pyx_t_1 = (__pyx_v_which_cusp != Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":2806
 *         if peripheral_data == 'fillings':
 *             if which_cusp is not None:
 *                 raise ValueError("You must apply 'fillings' to all "             # <<<<<<<<<<<<<<
 *                                  "of the cusps.")
 *             install_current_curve_bases(self.c_triangulation)
*/
      __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_3 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_You_must_apply_fillings_to_all_o};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2806, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 2806, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2805
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':
 *             if which_cusp is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'fillings' to all "
 *                                  "of the cusps.")
*/
    }

    /* "cython/core/triangulation.pyx":2808
 *                 raise ValueError("You must apply 'fillings' to all "
 *                                  "of the cusps.")
 *             install_current_curve_bases(self.c_triangulation)             # <<<<<<<<<<<<<<
 *             return
 *         elif peripheral_data == 'combinatorial':
*/
    install_current_curve_bases(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2808, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2809
 *                                  "of the cusps.")
 *             install_current_curve_bases(self.c_triangulation)
 *             return             # <<<<<<<<<<<<<<
 *         elif peripheral_data == 'combinatorial':
 *             if return_matrices:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2804
 * 
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':             # <<<<<<<<<<<<<<
 *             if which_cusp is not None:
 *                 raise ValueError("You must apply 'fillings' to all "
*/
  }

  /* "cython/core/triangulation.pyx":2810
 *             install_current_curve_bases(self.c_triangulation)
 *             return
 *         elif peripheral_data == 'combinatorial':             # <<<<<<<<<<<<<<
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_peripheral_data, __pyx_mstate_global->__pyx_n_u_combinatorial, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2810, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2811
 *             return
 *         elif peripheral_data == 'combinatorial':
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_matrices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2811, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2812
 *         elif peripheral_data == 'combinatorial':
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                                  sizeof(MatrixInt22))
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }

      /* "cython/core/triangulation.pyx":2813
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
 *                 cobs = []
*/
      __pyx_t_3 = __Pyx_PyLong_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/triangulation.pyx":2812
 *         elif peripheral_data == 'combinatorial':
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                                  sizeof(MatrixInt22))
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
*/
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2812, __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_5 = __Pyx_PyLong_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2812, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_5));

      /* "cython/core/triangulation.pyx":2814
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))
 *                 install_combinatorial_bases(self.c_triangulation, matrices)             # <<<<<<<<<<<<<<
 *                 cobs = []
 *                 for n in range(self.num_cusps()):
*/
      install_combinatorial_bases(__pyx_v_self->c_triangulation, __pyx_v_matrices);

      /* "cython/core/triangulation.pyx":2815
 *                                                  sizeof(MatrixInt22))
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
 *                 cobs = []             # <<<<<<<<<<<<<<
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][0][0], matrices[n][0][1] ],
*/
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_cobs = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":2816
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
 *                 cobs = []
 *                 for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                     cobs.append([ [ matrices[n][0][0], matrices[n][0][1] ],
 *                                   [ matrices[n][1][0], matrices[n][1][1] ] ])
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_2 = __pyx_builtin_range; 
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2);
        __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2816, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2816, __pyx_L1_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8);
            ++__pyx_t_8;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2816, __pyx_L1_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8));
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8);
            #endif
            ++__pyx_t_8;
          }
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2816, __pyx_L1_error)
        } else {
          __pyx_t_6 = __pyx_t_9(__pyx_t_2);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2816, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":2817
 *                 cobs = []
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][0][0], matrices[n][0][1] ],             # <<<<<<<<<<<<<<
 *                                   [ matrices[n][1][0], matrices[n][1][1] ] ])
 *                 free(matrices)
*/
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2817, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyLong_From_int((((__pyx_v_matrices[__pyx_t_10])[0])[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2817, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyLong_From_int((((__pyx_v_matrices[__pyx_t_10])[0])[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_6);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(4, 2817, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_4);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(4, 2817, __pyx_L1_error);
        __pyx_t_6 = 0;
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2818
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][0][0], matrices[n][0][1] ],
 *                                   [ matrices[n][1][0], matrices[n][1][1] ] ])             # <<<<<<<<<<<<<<
 *                 free(matrices)
 *                 return cobs
*/
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2818, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyLong_From_int((((__pyx_v_matrices[__pyx_t_10])[1])[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2818, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyLong_From_int((((__pyx_v_matrices[__pyx_t_10])[1])[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_4);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(4, 2818, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_6);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(4, 2818, __pyx_L1_error);
        __pyx_t_4 = 0;
        __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":2817
 *                 cobs = []
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][0][0], matrices[n][0][1] ],             # <<<<<<<<<<<<<<
 *                                   [ matrices[n][1][0], matrices[n][1][1] ] ])
 *                 free(matrices)
*/
        __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3) != (0)) __PYX_ERR(4, 2817, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_7) != (0)) __PYX_ERR(4, 2817, __pyx_L1_error);
        __pyx_t_3 = 0;
        __pyx_t_7 = 0;
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(4, 2817, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":2816
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
 *                 cobs = []
 *                 for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                     cobs.append([ [ matrices[n][0][0], matrices[n][0][1] ],
 *                                   [ matrices[n][1][0], matrices[n][1][1] ] ])
*/
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2819
 *                     cobs.append([ [ matrices[n][0][0], matrices[n][0][1] ],
 *                                   [ matrices[n][1][0], matrices[n][1][1] ] ])
 *                 free(matrices)             # <<<<<<<<<<<<<<
 *                 return cobs
 *             else:
*/
      free(__pyx_v_matrices);

      /* "cython/core/triangulation.pyx":2820
 *                                   [ matrices[n][1][0], matrices[n][1][1] ] ])
 *                 free(matrices)
 *                 return cobs             # <<<<<<<<<<<<<<
 *             else:
 *                 peripheral_curves(self.c_triangulation)
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_cobs);
      __pyx_r = __pyx_v_cobs;
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":2811
 *             return
 *         elif peripheral_data == 'combinatorial':
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))
*/
    }

    /* "cython/core/triangulation.pyx":2822
 *                 return cobs
 *             else:
 *                 peripheral_curves(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         elif which_cusp is not None:
 *             meridian, longitude = peripheral_data
*/
    /*else*/ {
      peripheral_curves(__pyx_v_self->c_triangulation);
    }

    /* "cython/core/triangulation.pyx":2810
 *             install_current_curve_bases(self.c_triangulation)
 *             return
 *         elif peripheral_data == 'combinatorial':             # <<<<<<<<<<<<<<
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
*/
    goto __pyx_L5;
  }

  /* "cython/core/triangulation.pyx":2823
 *             else:
 *                 peripheral_curves(self.c_triangulation)
 *         elif which_cusp is not None:             # <<<<<<<<<<<<<<
 *             meridian, longitude = peripheral_data
 *             a, b = meridian
*/
  __pyx_t_1 = (__pyx_v_which_cusp != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2824
 *                 peripheral_curves(self.c_triangulation)
 *         elif which_cusp is not None:
 *             meridian, longitude = peripheral_data             # <<<<<<<<<<<<<<
 *             a, b = meridian
 *             c, d = longitude
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_peripheral_data))) || (PyList_CheckExact(__pyx_v_peripheral_data))) {
      PyObject* sequence = __pyx_v_peripheral_data;
      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(4, 2824, __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_INCREF(__pyx_t_2);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2824, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2824, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_v_peripheral_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 2) < 0) __PYX_ERR(4, 2824, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 2824, __pyx_L1_error)
      __pyx_L12_unpacking_done:;
    }
    __pyx_v_meridian = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_longitude = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":2825
 *         elif which_cusp is not None:
 *             meridian, longitude = peripheral_data
 *             a, b = meridian             # <<<<<<<<<<<<<<
 *             c, d = longitude
 *             if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_meridian))) || (PyList_CheckExact(__pyx_v_meridian))) {
      PyObject* sequence = __pyx_v_meridian;
      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(4, 2825, __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_INCREF(__pyx_t_6);
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_2);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2825, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2825, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_v_meridian); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_6 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_2 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 2) < 0) __PYX_ERR(4, 2825, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 2825, __pyx_L1_error)
      __pyx_L14_unpacking_done:;
    }
    __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2825, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2825, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_a = __pyx_t_13;
    __pyx_v_b = __pyx_t_14;

    /* "cython/core/triangulation.pyx":2826
 *             meridian, longitude = peripheral_data
 *             a, b = meridian
 *             c, d = longitude             # <<<<<<<<<<<<<<
 *             if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                 if self.is_orientable():
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_longitude))) || (PyList_CheckExact(__pyx_v_longitude))) {
      PyObject* sequence = __pyx_v_longitude;
      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(4, 2826, __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_INCREF(__pyx_t_2);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2826, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2826, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_v_longitude); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 2) < 0) __PYX_ERR(4, 2826, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 2826, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }
    __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2826, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2826, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_c = __pyx_t_14;
    __pyx_v_d = __pyx_t_13;

    /* "cython/core/triangulation.pyx":2827
 *             a, b = meridian
 *             c, d = longitude
 *             if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):             # <<<<<<<<<<<<<<
 *                 if self.is_orientable():
 *                     raise ValueError('The data provided does not give a '
*/
    __pyx_t_15 = (((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != 1);
    if (__pyx_t_15) {
    } else {
      __pyx_t_1 = __pyx_t_15;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(4, 2827, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!__pyx_t_15) {
    } else {
      __pyx_t_1 = __pyx_t_15;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_15 = (((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != -1L);
    __pyx_t_1 = __pyx_t_15;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2828
 *             c, d = longitude
 *             if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                 if self.is_orientable():             # <<<<<<<<<<<<<<
 *                     raise ValueError('The data provided does not give a '
 *                                      '(positively oriented) basis.')
*/
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2829
 *             if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                 if self.is_orientable():
 *                     raise ValueError('The data provided does not give a '             # <<<<<<<<<<<<<<
 *                                      '(positively oriented) basis.')
 *                 else:
*/
        __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_7 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_data_provided_does_not_give};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2829, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(4, 2829, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":2828
 *             c, d = longitude
 *             if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                 if self.is_orientable():             # <<<<<<<<<<<<<<
 *                     raise ValueError('The data provided does not give a '
 *                                      '(positively oriented) basis.')
*/
      }

      /* "cython/core/triangulation.pyx":2832
 *                                      '(positively oriented) basis.')
 *                 else:
 *                     raise ValueError('The data provided does not give a basis.')             # <<<<<<<<<<<<<<
 * 
 *             if 'Klein' in self.cusp_info(which_cusp)['topology']:
*/
      /*else*/ {
        __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_2 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_The_data_provided_does_not_give_2};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2832, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(4, 2832, __pyx_L1_error)
      }

      /* "cython/core/triangulation.pyx":2827
 *             a, b = meridian
 *             c, d = longitude
 *             if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):             # <<<<<<<<<<<<<<
 *                 if self.is_orientable():
 *                     raise ValueError('The data provided does not give a '
*/
    }

    /* "cython/core/triangulation.pyx":2834
 *                     raise ValueError('The data provided does not give a basis.')
 * 
 *             if 'Klein' in self.cusp_info(which_cusp)['topology']:             # <<<<<<<<<<<<<<
 *                 if b != 0 or c != 0:
 *                     raise ValueError('The data provided are invalid for Klein '
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_topology); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_Klein, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2834, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2835
 * 
 *             if 'Klein' in self.cusp_info(which_cusp)['topology']:
 *                 if b != 0 or c != 0:             # <<<<<<<<<<<<<<
 *                     raise ValueError('The data provided are invalid for Klein '
 *                                      'bottle cusps.')
*/
      __pyx_t_15 = (__pyx_v_b != 0);
      if (!__pyx_t_15) {
      } else {
        __pyx_t_1 = __pyx_t_15;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_15 = (__pyx_v_c != 0);
      __pyx_t_1 = __pyx_t_15;
      __pyx_L24_bool_binop_done:;
      if (unlikely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2836
 *             if 'Klein' in self.cusp_info(which_cusp)['topology']:
 *                 if b != 0 or c != 0:
 *                     raise ValueError('The data provided are invalid for Klein '             # <<<<<<<<<<<<<<
 *                                      'bottle cusps.')
 * 
*/
        __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_7 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_The_data_provided_are_invalid_fo};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2836, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(4, 2836, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":2835
 * 
 *             if 'Klein' in self.cusp_info(which_cusp)['topology']:
 *                 if b != 0 or c != 0:             # <<<<<<<<<<<<<<
 *                     raise ValueError('The data provided are invalid for Klein '
 *                                      'bottle cusps.')
*/
      }

      /* "cython/core/triangulation.pyx":2834
 *                     raise ValueError('The data provided does not give a basis.')
 * 
 *             if 'Klein' in self.cusp_info(which_cusp)['topology']:             # <<<<<<<<<<<<<<
 *                 if b != 0 or c != 0:
 *                     raise ValueError('The data provided are invalid for Klein '
*/
    }

    /* "cython/core/triangulation.pyx":2839
 *                                      'bottle cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "cython/core/triangulation.pyx":2840
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                              sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 * 
 *             for n in range(self.num_cusps()):
*/
    __pyx_t_7 = __Pyx_PyLong_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cython/core/triangulation.pyx":2839
 *                                      'bottle cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
*/
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2839, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_5));

    /* "cython/core/triangulation.pyx":2842
 *                                              sizeof(MatrixInt22))
 * 
 *             for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 for i,j in [(0,0),(0,1),(1,0),(1,1)]:
 *                     matrices[n][i][j] = 1 if i == j else 0
*/
    __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_2 = __pyx_builtin_range; 
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2842, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2842, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2842, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2842, __pyx_L1_error)
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_2);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2842, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":2843
 * 
 *             for n in range(self.num_cusps()):
 *                 for i,j in [(0,0),(0,1),(1,0),(1,1)]:             # <<<<<<<<<<<<<<
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
*/
      __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[16]; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_10 = 0;
      for (;;) {
        if (__pyx_t_10 >= 4) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10);
        #endif
        ++__pyx_t_10;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2843, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(__pyx_t_3 != Py_None)) {
          PyObject* sequence = __pyx_t_3;
          Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(4, 2843, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_4);
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2843, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2843, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 2843, __pyx_L1_error)
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2844
 *             for n in range(self.num_cusps()):
 *                 for i,j in [(0,0),(0,1),(1,0),(1,1)]:
 *                     matrices[n][i][j] = 1 if i == j else 0             # <<<<<<<<<<<<<<
 * 
 *             matrices[which_cusp][0][0] = a
*/
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_v_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2844, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2844, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_1) {
          __pyx_t_13 = 1;
        } else {
          __pyx_t_13 = 0;
        }
        __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2844, __pyx_L1_error)
        __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2844, __pyx_L1_error)
        __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2844, __pyx_L1_error)
        (((__pyx_v_matrices[__pyx_t_16])[__pyx_t_17])[__pyx_t_18]) = __pyx_t_13;

        /* "cython/core/triangulation.pyx":2843
 * 
 *             for n in range(self.num_cusps()):
 *                 for i,j in [(0,0),(0,1),(1,0),(1,1)]:             # <<<<<<<<<<<<<<
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
*/
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":2842
 *                                              sizeof(MatrixInt22))
 * 
 *             for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 for i,j in [(0,0),(0,1),(1,0),(1,1)]:
 *                     matrices[n][i][j] = 1 if i == j else 0
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2846
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
 *             matrices[which_cusp][0][0] = a             # <<<<<<<<<<<<<<
 *             matrices[which_cusp][0][1] = b
 *             matrices[which_cusp][1][0] = c
*/
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2846, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_8])[0])[0]) = __pyx_v_a;

    /* "cython/core/triangulation.pyx":2847
 * 
 *             matrices[which_cusp][0][0] = a
 *             matrices[which_cusp][0][1] = b             # <<<<<<<<<<<<<<
 *             matrices[which_cusp][1][0] = c
 *             matrices[which_cusp][1][1] = d
*/
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2847, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_8])[0])[1]) = __pyx_v_b;

    /* "cython/core/triangulation.pyx":2848
 *             matrices[which_cusp][0][0] = a
 *             matrices[which_cusp][0][1] = b
 *             matrices[which_cusp][1][0] = c             # <<<<<<<<<<<<<<
 *             matrices[which_cusp][1][1] = d
 *             if self.is_orientable():
*/
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2848, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_8])[1])[0]) = __pyx_v_c;

    /* "cython/core/triangulation.pyx":2849
 *             matrices[which_cusp][0][1] = b
 *             matrices[which_cusp][1][0] = c
 *             matrices[which_cusp][1][1] = d             # <<<<<<<<<<<<<<
 *             if self.is_orientable():
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
*/
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2849, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_8])[1])[1]) = __pyx_v_d;

    /* "cython/core/triangulation.pyx":2850
 *             matrices[which_cusp][1][0] = c
 *             matrices[which_cusp][1][1] = d
 *             if self.is_orientable():             # <<<<<<<<<<<<<<
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2850, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2850, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2851
 *             matrices[which_cusp][1][1] = d
 *             if self.is_orientable():
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)             # <<<<<<<<<<<<<<
 *             else:
 *                 result = change_peripheral_curves_nonorientable(
*/
      __pyx_t_19 = change_peripheral_curves(__pyx_v_self->c_triangulation, __pyx_v_matrices); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2851, __pyx_L1_error)
      __pyx_v_result = __pyx_t_19;

      /* "cython/core/triangulation.pyx":2850
 *             matrices[which_cusp][1][0] = c
 *             matrices[which_cusp][1][1] = d
 *             if self.is_orientable():             # <<<<<<<<<<<<<<
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
*/
      goto __pyx_L32;
    }

    /* "cython/core/triangulation.pyx":2853
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
 *                 result = change_peripheral_curves_nonorientable(             # <<<<<<<<<<<<<<
 *                     self.c_triangulation, matrices)
 *             free(matrices)
*/
    /*else*/ {

      /* "cython/core/triangulation.pyx":2854
 *             else:
 *                 result = change_peripheral_curves_nonorientable(
 *                     self.c_triangulation, matrices)             # <<<<<<<<<<<<<<
 *             free(matrices)
 *             if result == func_bad_input:
*/
      __pyx_v_result = change_peripheral_curves_nonorientable(__pyx_v_self->c_triangulation, __pyx_v_matrices);
    }
    __pyx_L32:;

    /* "cython/core/triangulation.pyx":2855
 *                 result = change_peripheral_curves_nonorientable(
 *                     self.c_triangulation, matrices)
 *             free(matrices)             # <<<<<<<<<<<<<<
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data ((%d, %d), (%d,%d)) '
*/
    free(__pyx_v_matrices);

    /* "cython/core/triangulation.pyx":2856
 *                     self.c_triangulation, matrices)
 *             free(matrices)
 *             if result == func_bad_input:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The peripheral data ((%d, %d), (%d,%d)) '
 *                                  'is not acceptable.' % (a,b,c,d))
*/
    __pyx_t_1 = (__pyx_v_result == func_bad_input);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":2857
 *             free(matrices)
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data ((%d, %d), (%d,%d)) '             # <<<<<<<<<<<<<<
 *                                  'is not acceptable.' % (a,b,c,d))
 * 
*/
      __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_3 = __pyx_builtin_ValueError; 

      /* "cython/core/triangulation.pyx":2858
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data ((%d, %d), (%d,%d)) '
 *                                  'is not acceptable.' % (a,b,c,d))             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
      __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_a, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_b, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_20 = __Pyx_PyUnicode_From_int(__pyx_v_c, 0, ' ', 'd'); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_21 = __Pyx_PyUnicode_From_int(__pyx_v_d, 0, ' ', 'd'); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __pyx_t_22[0] = __pyx_mstate_global->__pyx_kp_u_The_peripheral_data;
      __pyx_t_22[1] = __pyx_t_4;
      __pyx_t_22[2] = __pyx_mstate_global->__pyx_kp_u__3;
      __pyx_t_22[3] = __pyx_t_7;
      __pyx_t_22[4] = __pyx_mstate_global->__pyx_kp_u__27;
      __pyx_t_22[5] = __pyx_t_20;
      __pyx_t_22[6] = __pyx_mstate_global->__pyx_kp_u__28;
      __pyx_t_22[7] = __pyx_t_21;
      __pyx_t_22[8] = __pyx_mstate_global->__pyx_kp_u_is_not_acceptable;

      /* "cython/core/triangulation.pyx":2857
 *             free(matrices)
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data ((%d, %d), (%d,%d)) '             # <<<<<<<<<<<<<<
 *                                  'is not acceptable.' % (a,b,c,d))
 * 
*/
      __pyx_t_23 = __Pyx_PyUnicode_Join(__pyx_t_22, 9, 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_20) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_21) + 21, 127);
      if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 2857, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_23};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 2857, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2856
 *                     self.c_triangulation, matrices)
 *             free(matrices)
 *             if result == func_bad_input:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The peripheral data ((%d, %d), (%d,%d)) '
 *                                  'is not acceptable.' % (a,b,c,d))
*/
    }

    /* "cython/core/triangulation.pyx":2823
 *             else:
 *                 peripheral_curves(self.c_triangulation)
 *         elif which_cusp is not None:             # <<<<<<<<<<<<<<
 *             meridian, longitude = peripheral_data
 *             a, b = meridian
*/
    goto __pyx_L5;
  }

  /* "cython/core/triangulation.pyx":2861
 * 
 *         else:
 *             if self.num_cusps() == 1 and len(peripheral_data) == 2:             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves(peripheral_data, 0)
 *                 return
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_15 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(4, 2861, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_15) {
    } else {
      __pyx_t_1 = __pyx_t_15;
      goto __pyx_L35_bool_binop_done;
    }
    __pyx_t_8 = PyObject_Length(__pyx_v_peripheral_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2861, __pyx_L1_error)
    __pyx_t_15 = (__pyx_t_8 == 2);
    __pyx_t_1 = __pyx_t_15;
    __pyx_L35_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2862
 *         else:
 *             if self.num_cusps() == 1 and len(peripheral_data) == 2:
 *                 self.set_peripheral_curves(peripheral_data, 0)             # <<<<<<<<<<<<<<
 *                 return
 *             if len(peripheral_data) > self.num_cusps():
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_peripheral_data, __pyx_mstate_global->__pyx_int_0};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_peripheral_curves, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2863
 *             if self.num_cusps() == 1 and len(peripheral_data) == 2:
 *                 self.set_peripheral_curves(peripheral_data, 0)
 *                 return             # <<<<<<<<<<<<<<
 *             if len(peripheral_data) > self.num_cusps():
 *                 raise IndexError('You provided more peripheral data '
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":2861
 * 
 *         else:
 *             if self.num_cusps() == 1 and len(peripheral_data) == 2:             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves(peripheral_data, 0)
 *                 return
*/
    }

    /* "cython/core/triangulation.pyx":2864
 *                 self.set_peripheral_curves(peripheral_data, 0)
 *                 return
 *             if len(peripheral_data) > self.num_cusps():             # <<<<<<<<<<<<<<
 *                 raise IndexError('You provided more peripheral data '
 *                                  'than there are cusps.')
*/
    __pyx_t_8 = PyObject_Length(__pyx_v_peripheral_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2864, __pyx_L1_error)
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_23 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_23);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_23, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2864, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_23 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 2864, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_23); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2864, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":2865
 *                 return
 *             if len(peripheral_data) > self.num_cusps():
 *                 raise IndexError('You provided more peripheral data '             # <<<<<<<<<<<<<<
 *                                  'than there are cusps.')
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_IndexError);
      __pyx_t_2 = __pyx_builtin_IndexError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_You_provided_more_peripheral_dat};
        __pyx_t_23 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 2865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_23);
      }
      __Pyx_Raise(__pyx_t_23, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __PYX_ERR(4, 2865, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2864
 *                 self.set_peripheral_curves(peripheral_data, 0)
 *                 return
 *             if len(peripheral_data) > self.num_cusps():             # <<<<<<<<<<<<<<
 *                 raise IndexError('You provided more peripheral data '
 *                                  'than there are cusps.')
*/
    }

    /* "cython/core/triangulation.pyx":2868
 *                                  'than there are cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_23 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 2868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
    }

    /* "cython/core/triangulation.pyx":2869
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                              sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 * 
 *             for n in range(self.num_cusps()):
*/
    __pyx_t_2 = __Pyx_PyLong_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/triangulation.pyx":2868
 *                                  'than there are cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
*/
    __pyx_t_3 = PyNumber_Multiply(__pyx_t_23, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2868, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_5));

    /* "cython/core/triangulation.pyx":2871
 *                                              sizeof(MatrixInt22))
 * 
 *             for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 for i, j in [(0, 0), (0, 1), (1, 0), (1, 1)]:
 *                     matrices[n][i][j] = 1 if i == j else 0
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_23 = __pyx_builtin_range; 
    __pyx_t_21 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_21);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_21, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_23, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_23 = __pyx_t_3; __Pyx_INCREF(__pyx_t_23);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_23 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 2871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_23); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2871, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_23))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_23);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2871, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_23, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_23);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2871, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_23, __pyx_t_8));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_23, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2871, __pyx_L1_error)
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_23);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2871, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":2872
 * 
 *             for n in range(self.num_cusps()):
 *                 for i, j in [(0, 0), (0, 1), (1, 0), (1, 1)]:             # <<<<<<<<<<<<<<
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
*/
      __pyx_t_3 = __pyx_mstate_global->__pyx_tuple[16]; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_10 = 0;
      for (;;) {
        if (__pyx_t_10 >= 4) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10);
        #endif
        ++__pyx_t_10;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2872, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (likely(__pyx_t_6 != Py_None)) {
          PyObject* sequence = __pyx_t_6;
          Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(4, 2872, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_21 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_21);
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2872, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_21 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2872, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_21);
          #endif
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 2872, __pyx_L1_error)
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_21);
        __pyx_t_21 = 0;

        /* "cython/core/triangulation.pyx":2873
 *             for n in range(self.num_cusps()):
 *                 for i, j in [(0, 0), (0, 1), (1, 0), (1, 1)]:
 *                     matrices[n][i][j] = 1 if i == j else 0             # <<<<<<<<<<<<<<
 * 
 *             for i, basis in enumerate(peripheral_data):
*/
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2873, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2873, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_1) {
          __pyx_t_13 = 1;
        } else {
          __pyx_t_13 = 0;
        }
        __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2873, __pyx_L1_error)
        __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2873, __pyx_L1_error)
        __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2873, __pyx_L1_error)
        (((__pyx_v_matrices[__pyx_t_18])[__pyx_t_17])[__pyx_t_16]) = __pyx_t_13;

        /* "cython/core/triangulation.pyx":2872
 * 
 *             for n in range(self.num_cusps()):
 *                 for i, j in [(0, 0), (0, 1), (1, 0), (1, 1)]:             # <<<<<<<<<<<<<<
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
*/
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":2871
 *                                              sizeof(MatrixInt22))
 * 
 *             for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 for i, j in [(0, 0), (0, 1), (1, 0), (1, 1)]:
 *                     matrices[n][i][j] = 1 if i == j else 0
*/
    }
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;

    /* "cython/core/triangulation.pyx":2875
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
 *             for i, basis in enumerate(peripheral_data):             # <<<<<<<<<<<<<<
 * 
 *                 meridian, longitude = basis
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_23 = __pyx_mstate_global->__pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_peripheral_data)) || PyTuple_CheckExact(__pyx_v_peripheral_data)) {
      __pyx_t_3 = __pyx_v_peripheral_data; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_peripheral_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2875, __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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2875, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 2875, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2875, __pyx_L1_error)
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 2875, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_basis, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_t_23);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_23);
      __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_23, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_23);
      __pyx_t_23 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":2877
 *             for i, basis in enumerate(peripheral_data):
 * 
 *                 meridian, longitude = basis             # <<<<<<<<<<<<<<
 *                 a, b = meridian
 *                 c, d = longitude
*/
      if ((likely(PyTuple_CheckExact(__pyx_v_basis))) || (PyList_CheckExact(__pyx_v_basis))) {
        PyObject* sequence = __pyx_v_basis;
        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(4, 2877, __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_INCREF(__pyx_t_6);
          __pyx_t_21 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_21);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2877, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_21 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2877, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_21);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_21 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_v_basis); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
        index = 0; __pyx_t_6 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L46_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_21 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_21)) goto __pyx_L46_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_21);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) __PYX_ERR(4, 2877, __pyx_L1_error)
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L47_unpacking_done;
        __pyx_L46_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(4, 2877, __pyx_L1_error)
        __pyx_L47_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_meridian, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_longitude, __pyx_t_21);
      __pyx_t_21 = 0;

      /* "cython/core/triangulation.pyx":2878
 * 
 *                 meridian, longitude = basis
 *                 a, b = meridian             # <<<<<<<<<<<<<<
 *                 c, d = longitude
 *                 if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
*/
      if ((likely(PyTuple_CheckExact(__pyx_v_meridian))) || (PyList_CheckExact(__pyx_v_meridian))) {
        PyObject* sequence = __pyx_v_meridian;
        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(4, 2878, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_21 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_21);
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_6);
        } else {
          __pyx_t_21 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2878, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2878, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
        }
        #else
        __pyx_t_21 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2878, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2878, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_v_meridian); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2878, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
        index = 0; __pyx_t_21 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_21)) goto __pyx_L48_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_21);
        index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L48_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) __PYX_ERR(4, 2878, __pyx_L1_error)
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L49_unpacking_done;
        __pyx_L48_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(4, 2878, __pyx_L1_error)
        __pyx_L49_unpacking_done:;
      }
      __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_21); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2878, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2878, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_a = __pyx_t_13;
      __pyx_v_b = __pyx_t_14;

      /* "cython/core/triangulation.pyx":2879
 *                 meridian, longitude = basis
 *                 a, b = meridian
 *                 c, d = longitude             # <<<<<<<<<<<<<<
 *                 if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                     if self.is_orientable():
*/
      if ((likely(PyTuple_CheckExact(__pyx_v_longitude))) || (PyList_CheckExact(__pyx_v_longitude))) {
        PyObject* sequence = __pyx_v_longitude;
        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(4, 2879, __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_INCREF(__pyx_t_6);
          __pyx_t_21 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_21);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2879, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_21 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2879, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_21);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_21 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_v_longitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
        index = 0; __pyx_t_6 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L50_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_21 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_21)) goto __pyx_L50_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_21);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) __PYX_ERR(4, 2879, __pyx_L1_error)
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L51_unpacking_done;
        __pyx_L50_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(4, 2879, __pyx_L1_error)
        __pyx_L51_unpacking_done:;
      }
      __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2879, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_21); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 2879, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_v_c = __pyx_t_14;
      __pyx_v_d = __pyx_t_13;

      /* "cython/core/triangulation.pyx":2880
 *                 a, b = meridian
 *                 c, d = longitude
 *                 if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):             # <<<<<<<<<<<<<<
 *                     if self.is_orientable():
 *                         free(matrices)
*/
      __pyx_t_15 = (((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != 1);
      if (__pyx_t_15) {
      } else {
        __pyx_t_1 = __pyx_t_15;
        goto __pyx_L53_bool_binop_done;
      }
      __pyx_t_6 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_21 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2880, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
      }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(4, 2880, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      if (!__pyx_t_15) {
      } else {
        __pyx_t_1 = __pyx_t_15;
        goto __pyx_L53_bool_binop_done;
      }
      __pyx_t_15 = (((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != -1L);
      __pyx_t_1 = __pyx_t_15;
      __pyx_L53_bool_binop_done:;
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2881
 *                 c, d = longitude
 *                 if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                     if self.is_orientable():             # <<<<<<<<<<<<<<
 *                         free(matrices)
 *                         raise ValueError('The data provided does not give a '
*/
        __pyx_t_6 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_21 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2881, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_21);
        }
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2881, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        if (unlikely(__pyx_t_1)) {

          /* "cython/core/triangulation.pyx":2882
 *                 if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                     if self.is_orientable():
 *                         free(matrices)             # <<<<<<<<<<<<<<
 *                         raise ValueError('The data provided does not give a '
 *                                          '(positively oriented) basis.')
*/
          free(__pyx_v_matrices);

          /* "cython/core/triangulation.pyx":2883
 *                     if self.is_orientable():
 *                         free(matrices)
 *                         raise ValueError('The data provided does not give a '             # <<<<<<<<<<<<<<
 *                                          '(positively oriented) basis.')
 *                     else:
*/
          __pyx_t_6 = NULL;
          __Pyx_INCREF(__pyx_builtin_ValueError);
          __pyx_t_2 = __pyx_builtin_ValueError; 
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_The_data_provided_does_not_give};
            __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2883, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_21);
          }
          __Pyx_Raise(__pyx_t_21, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __PYX_ERR(4, 2883, __pyx_L1_error)

          /* "cython/core/triangulation.pyx":2881
 *                 c, d = longitude
 *                 if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):
 *                     if self.is_orientable():             # <<<<<<<<<<<<<<
 *                         free(matrices)
 *                         raise ValueError('The data provided does not give a '
*/
        }

        /* "cython/core/triangulation.pyx":2886
 *                                          '(positively oriented) basis.')
 *                     else:
 *                         free(matrices)             # <<<<<<<<<<<<<<
 *                         raise ValueError('The data provided does not give a '
 *                                          'basis.')
*/
        /*else*/ {
          free(__pyx_v_matrices);

          /* "cython/core/triangulation.pyx":2887
 *                     else:
 *                         free(matrices)
 *                         raise ValueError('The data provided does not give a '             # <<<<<<<<<<<<<<
 *                                          'basis.')
 * 
*/
          __pyx_t_2 = NULL;
          __Pyx_INCREF(__pyx_builtin_ValueError);
          __pyx_t_6 = __pyx_builtin_ValueError; 
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_data_provided_does_not_give_2};
            __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2887, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_21);
          }
          __Pyx_Raise(__pyx_t_21, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __PYX_ERR(4, 2887, __pyx_L1_error)
        }

        /* "cython/core/triangulation.pyx":2880
 *                 a, b = meridian
 *                 c, d = longitude
 *                 if a*d - b*c != 1 and (self.is_orientable() or a*d - b*c != -1):             # <<<<<<<<<<<<<<
 *                     if self.is_orientable():
 *                         free(matrices)
*/
      }

      /* "cython/core/triangulation.pyx":2890
 *                                          'basis.')
 * 
 *                 if 'Klein' in self.cusp_info(i)['topology']:             # <<<<<<<<<<<<<<
 *                     if b != 0 or c != 0:
 *                         free(matrices)
*/
      __pyx_t_6 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_i};
        __pyx_t_21 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 2890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
      }
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_topology); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_Klein, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2890, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2891
 * 
 *                 if 'Klein' in self.cusp_info(i)['topology']:
 *                     if b != 0 or c != 0:             # <<<<<<<<<<<<<<
 *                         free(matrices)
 *                         raise ValueError('The data provided are invalid for '
*/
        __pyx_t_15 = (__pyx_v_b != 0);
        if (!__pyx_t_15) {
        } else {
          __pyx_t_1 = __pyx_t_15;
          goto __pyx_L59_bool_binop_done;
        }
        __pyx_t_15 = (__pyx_v_c != 0);
        __pyx_t_1 = __pyx_t_15;
        __pyx_L59_bool_binop_done:;
        if (unlikely(__pyx_t_1)) {

          /* "cython/core/triangulation.pyx":2892
 *                 if 'Klein' in self.cusp_info(i)['topology']:
 *                     if b != 0 or c != 0:
 *                         free(matrices)             # <<<<<<<<<<<<<<
 *                         raise ValueError('The data provided are invalid for '
 *                                          'Klein bottle cusps.')
*/
          free(__pyx_v_matrices);

          /* "cython/core/triangulation.pyx":2893
 *                     if b != 0 or c != 0:
 *                         free(matrices)
 *                         raise ValueError('The data provided are invalid for '             # <<<<<<<<<<<<<<
 *                                          'Klein bottle cusps.')
 * 
*/
          __pyx_t_21 = NULL;
          __Pyx_INCREF(__pyx_builtin_ValueError);
          __pyx_t_2 = __pyx_builtin_ValueError; 
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_mstate_global->__pyx_kp_u_The_data_provided_are_invalid_fo};
            __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 2893, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __PYX_ERR(4, 2893, __pyx_L1_error)

          /* "cython/core/triangulation.pyx":2891
 * 
 *                 if 'Klein' in self.cusp_info(i)['topology']:
 *                     if b != 0 or c != 0:             # <<<<<<<<<<<<<<
 *                         free(matrices)
 *                         raise ValueError('The data provided are invalid for '
*/
        }

        /* "cython/core/triangulation.pyx":2890
 *                                          'basis.')
 * 
 *                 if 'Klein' in self.cusp_info(i)['topology']:             # <<<<<<<<<<<<<<
 *                     if b != 0 or c != 0:
 *                         free(matrices)
*/
      }

      /* "cython/core/triangulation.pyx":2896
 *                                          'Klein bottle cusps.')
 * 
 *                 matrices[i][0][0] = a             # <<<<<<<<<<<<<<
 *                 matrices[i][0][1] = b
 *                 matrices[i][1][0] = c
*/
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2896, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_10])[0])[0]) = __pyx_v_a;

      /* "cython/core/triangulation.pyx":2897
 * 
 *                 matrices[i][0][0] = a
 *                 matrices[i][0][1] = b             # <<<<<<<<<<<<<<
 *                 matrices[i][1][0] = c
 *                 matrices[i][1][1] = d
*/
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2897, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_10])[0])[1]) = __pyx_v_b;

      /* "cython/core/triangulation.pyx":2898
 *                 matrices[i][0][0] = a
 *                 matrices[i][0][1] = b
 *                 matrices[i][1][0] = c             # <<<<<<<<<<<<<<
 *                 matrices[i][1][1] = d
 * 
*/
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2898, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_10])[1])[0]) = __pyx_v_c;

      /* "cython/core/triangulation.pyx":2899
 *                 matrices[i][0][1] = b
 *                 matrices[i][1][0] = c
 *                 matrices[i][1][1] = d             # <<<<<<<<<<<<<<
 * 
 *             if self.is_orientable():
*/
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 2899, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_10])[1])[1]) = __pyx_v_d;

      /* "cython/core/triangulation.pyx":2875
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
 *             for i, basis in enumerate(peripheral_data):             # <<<<<<<<<<<<<<
 * 
 *                 meridian, longitude = basis
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;

    /* "cython/core/triangulation.pyx":2901
 *                 matrices[i][1][1] = d
 * 
 *             if self.is_orientable():             # <<<<<<<<<<<<<<
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_23 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 2901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_23); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 2901, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2902
 * 
 *             if self.is_orientable():
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)             # <<<<<<<<<<<<<<
 *             else:
 *                 result = change_peripheral_curves_nonorientable(
*/
      __pyx_t_19 = change_peripheral_curves(__pyx_v_self->c_triangulation, __pyx_v_matrices); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2902, __pyx_L1_error)
      __pyx_v_result = __pyx_t_19;

      /* "cython/core/triangulation.pyx":2901
 *                 matrices[i][1][1] = d
 * 
 *             if self.is_orientable():             # <<<<<<<<<<<<<<
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
*/
      goto __pyx_L62;
    }

    /* "cython/core/triangulation.pyx":2904
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
 *                 result = change_peripheral_curves_nonorientable(             # <<<<<<<<<<<<<<
 *                     self.c_triangulation, matrices)
 *             free(matrices)
*/
    /*else*/ {

      /* "cython/core/triangulation.pyx":2905
 *             else:
 *                 result = change_peripheral_curves_nonorientable(
 *                     self.c_triangulation, matrices)             # <<<<<<<<<<<<<<
 *             free(matrices)
 *             if result == func_bad_input:
*/
      __pyx_v_result = change_peripheral_curves_nonorientable(__pyx_v_self->c_triangulation, __pyx_v_matrices);
    }
    __pyx_L62:;

    /* "cython/core/triangulation.pyx":2906
 *                 result = change_peripheral_curves_nonorientable(
 *                     self.c_triangulation, matrices)
 *             free(matrices)             # <<<<<<<<<<<<<<
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data %s is not acceptable.' %
*/
    free(__pyx_v_matrices);

    /* "cython/core/triangulation.pyx":2907
 *                     self.c_triangulation, matrices)
 *             free(matrices)
 *             if result == func_bad_input:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The peripheral data %s is not acceptable.' %
 *                                  peripheral_data)
*/
    __pyx_t_1 = (__pyx_v_result == func_bad_input);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":2908
 *             free(matrices)
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data %s is not acceptable.' %             # <<<<<<<<<<<<<<
 *                                  peripheral_data)
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_6 = __pyx_builtin_ValueError; 

      /* "cython/core/triangulation.pyx":2909
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data %s is not acceptable.' %
 *                                  peripheral_data)             # <<<<<<<<<<<<<<
 * 
 *     def has_finite_vertices(self) -> bool:
*/
      __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_The_peripheral_data_s_is_not_acc, __pyx_v_peripheral_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_23 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 2908, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_23);
      }
      __Pyx_Raise(__pyx_t_23, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __PYX_ERR(4, 2908, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2907
 *                     self.c_triangulation, matrices)
 *             free(matrices)
 *             if result == func_bad_input:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The peripheral data %s is not acceptable.' %
 *                                  peripheral_data)
*/
    }
  }
  __pyx_L5:;

  /* "cython/core/triangulation.pyx":2776
 *         return c_repn_in_original_gens
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.set_peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cobs);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_meridian);
  __Pyx_XDECREF(__pyx_v_longitude);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_basis);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2911
 *                                  peripheral_data)
 * 
 *     def has_finite_vertices(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         Returns ``True`` if and only if the triangulation has finite (non-ideal)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_141has_finite_vertices(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_8SnapPyHP_13Triangulation_140has_finite_vertices, "\n        Returns ``True`` if and only if the triangulation has finite (non-ideal)\n        vertices.\n\n        >>> T = Triangulation(\"m004\")\n        >>> T.has_finite_vertices()\n        False\n        >>> T.dehn_fill((12,13))\n        >>> S = T.filled_triangulation()\n        >>> S.has_finite_vertices()\n        True\n\n        When trying to find a hyperbolic structure, SnapPea will eliminate\n        finite vertices:\n\n        >>> M = S.with_hyperbolic_structure()\n        >>> M.has_finite_vertices()\n        False\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_141has_finite_vertices = {"has_finite_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_141has_finite_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_140has_finite_vertices};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_141has_finite_vertices(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("has_finite_vertices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("has_finite_vertices", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("has_finite_vertices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_140has_finite_vertices(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_140has_finite_vertices(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_finite_vertices", 0);

  /* "cython/core/triangulation.pyx":2932
 *         """
 *         # Bail if empty
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2933
 *         # Bail if empty
 *         if self.c_triangulation is NULL:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         count_cusps(self.c_triangulation)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2932
 *         """
 *         # Bail if empty
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  }

  /* "cython/core/triangulation.pyx":2935
 *             return False
 * 
 *         count_cusps(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         return get_num_fake_cusps(self.c_triangulation) > 0
 * 
*/
  count_cusps(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":2936
 * 
 *         count_cusps(self.c_triangulation)
 *         return get_num_fake_cusps(self.c_triangulation) > 0             # <<<<<<<<<<<<<<
 * 
 *     def triangulation_isosig(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = get_num_fake_cusps(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2936, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_t_2 > 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2911
 *                                  peripheral_data)
 * 
 *     def has_finite_vertices(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         Returns ``True`` if and only if the triangulation has finite (non-ideal)
*/

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

/* "cython/core/triangulation.pyx":2938
 *         return get_num_fake_cusps(self.c_triangulation) > 0
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_143triangulation_isosig(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_8SnapPyHP_13Triangulation_142triangulation_isosig, "\n        Returns the \"(decorated) isomorphism signature\", a compact text\n        representation of the triangulation::\n\n          >>> T = Triangulation('m004')\n          >>> T.triangulation_isosig()\n          'cPcbbbiht_BaCB'\n\n        This string can be used later to recreate an isomorphic triangulation::\n\n          >>> U = Triangulation('cPcbbbiht_BaCB')\n          >>> T == U\n          True\n\n        The isomorphism signature is also used to compute the\n        :meth:`isometry_signature <snappy.Manifold.isometry_signature>`.\n        It comes in two flavors controlled by the :attr:`decorated` flag.\n\n        **Undecorated isomorphism signature**\n\n        The undecorated isomorphism signature is a complete invariant of the\n        (oriented) triangulation up to combinatorial isomorphism::\n\n            >>> T = Triangulation('m015')\n            >>> T.triangulation_isosig(decorated=False)\n            'dLQbcccdero'\n\n        It was introduced in\n        `Burton '11 <http://arxiv.org/abs/1110.6080>`_. It canonizes and\n        generalizes the ealier dehydration string by\n        `Callahan, Hildebrand and Weeks '99\n        <https://doi.org/10.1090/S0025-5718-99-01036-4>`_.\n        The undecorated isomorphism signature can also be given to\n        `Regina <https://regina-normal.github.io/>`_'s\n        ``Triangulation3.fromIsoSig``.\n\n        By default, the orientation (if orientable) is ignored. More\n        precisely, it computes the string for both orientations (if orientable)\n        and uses the lexicographically smaller string::\n\n            >>> T = Triangulation('m015')\n            >>> T.triangulation_isosig(decorated=False)\n            'dLQbcccdero'\n            >>> T.reverse_orientation()\n            >>> T.triangulation_isosig(decorated=False)\n            'dLQbcccdero'\n\n        When specifying :attr:`ignore_orientation = False`, the result\n        encodes the orientation (if orientable). Now the result is\n        differen""t if we change the orientation of a chiral triangulation::\n\n            >>> T = Triangulation('m015')\n            >>> T.triangulation_isosig(decorated=False, ignore_orientation=False)\n            'dLQbcccdero'\n            >>> T.reverse_orientation()\n            >>> T.triangulation_isosig(decorated=False, ignore_orientation=False)\n            'dLQbccceekg'\n\n        **Decorated isomorphism signature (default)**\n\n        SnapPy can decorate the isomorphism signature to include the following\n        peripheral information in a canonical way (that is invariant under\n        the action by combinatorial isomorphisms of the triangulation):\n\n        #. Indexing of the cusps (that is, ideal vertices).\n\n           * Included by default.\n             Can be suppressed with :attr:`ignore_cusp_ordering = True`.\n\n        #. Peripheral curves (aka meridian and longitude, up to homotopy).\n\n           * Included by default.\n             Can be suppressed with :attr:`ignore_curves = True`.\n           * By default, the decoration encodes the oriented peripheral curves.\n             By specifying :attr:`ignore_curve_orientations = True`, it encodes\n             the unoriented peripheral curves instead.\n\n        #. Dehn-fillings and orientation of core curve (if present).\n\n           * By default, the decoration encodes the Dehn-fillings and the\n             orientation of the core curve.\n             That is, we encode the (unoriented) peripheral curve that is\n             used for the Dehn-filling as well as the orientation of the class\n             of peripheral curves intersecting that peripheral curve ones\n             (this explanation only works if the coefficients are co-prime\n             integers). Note that this behavior has changed in Version 3.3.\n             By specifying :attr:`ignore_filling_orientations = True`, the\n             decoration encodes the Dehn-fillings without any regard to\n             orientation.\n             That i""s, it normalizes the Dehn-filling coefficients by picking\n             a canonical pair among :math:`(m,l)` and :math:`(-m,-l)`.\n\n        Details of the encoding are explained in the\n        `SnapPy source code <https://github.com/3-manifolds/SnapPy/blob/master/python/decorated_isosig.py>`_.\n\n        **Example**\n\n        Let us consider the links :math:`9^2_{34}` and ``L9a21``. Note that we use\n        :meth:`canonical_retriangulation <snappy.Manifold.canonical_retriangulation>`\n        to make the following examples say something intrinsic about the\n        hyperbolic manifold::\n\n          >>> from snappy import Manifold\n          >>> M = Manifold('9^2_34').canonical_retriangulation()\n          >>> N = Manifold('L9a21').canonical_retriangulation()\n\n        The decorated isosig recovers the entire peripheral information faithfully\n        (including orientation, see below)::\n\n          >>> M.triangulation_isosig()\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_baBabbbBbC'\n          >>> K = Triangulation('oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_baBabbbBbC')\n          >>> M.isomorphisms_to(K)\n          [0 -> 0  1 -> 1\n          [1 0]   [1 0]\n          [0 1]   [0 1]\n          Extends to link]\n\n        The two links have isometric complements::\n\n          >>> M.triangulation_isosig(decorated=False)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo'\n          >>> N.triangulation_isosig(decorated=False)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo'\n\n        However, the complements have different handedness::\n\n          >>> M.triangulation_isosig(decorated=False,ignore_orientation=False)\n          'oLLzLPwzQQccdeghjiiklmnmnnuvuvvavovvffffo'\n          >>> N.triangulation_isosig(decorated=False,ignore_orientation=False)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo'\n\n        Also, the cusps/components of the link are indexed differently::\n\n          >>> M.triangulation_isosig(ignore_curves=True)\n       ""   'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_ba'\n          >>> N.triangulation_isosig(ignore_curves=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_ab'\n\n        Ignoring the indexing, we also see that the oriented merdians and\n        longitudes do not match::\n\n          >>> M.triangulation_isosig(ignore_cusp_ordering=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_bBbCBabb'\n          >>> N.triangulation_isosig(ignore_cusp_ordering=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_BbbCbabb'\n\n        However, they are the same links (ignoring indexing and orientation)::\n\n          >>> M.triangulation_isosig(ignore_cusp_ordering=True, ignore_curve_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_bBBcbabb'\n          >>> N.triangulation_isosig(ignore_cusp_ordering=True, ignore_curve_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo_bBBcbabb'\n\n        Let us create two surgery presentations from the links (note that we\n        fill after\n        :meth:`canonical_retriangulation <snappy.Manifold.canonical_retriangulation>`\n        since it rejects Dehn-fillings)::\n\n          >>> M.dehn_fill((4, 5),0)\n          >>> N.dehn_fill((4,-5),1)\n\n        They are equivalent surgery presentations (of the same manifold)::\n\n          >>> M.triangulation_isosig(\n          ...         ignore_cusp_ordering=True,\n          ...         ignore_curves=True,\n          ...         ignore_filling_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo(0,0)(1,5)'\n          >>> N.triangulation_isosig(\n          ...         ignore_cusp_ordering=True,\n          ...         ignore_curves=True,\n          ...         ignore_filling_orientations=True)\n          'oLLvzQLLQQccdhifihnlmkmlnnpvuvbvouggbggoo(0,0)(1,5)'\n\n        A geometric spun-triangulation of the three-fold cover of m007(3,1)::\n\n          >>> M = Manifold('gLLMQcbeefefujumapn(2,-1)')\n          >>> M.solut""ion_type()\n          'all tetrahedra positively oriented'\n\n        Specifying :attr:`ignore_filling_orientations = True` can change the\n        orientation of the core curve and a triangulation spinning the other\n        way that fails to be geometric::\n\n          >>> isosig = M.triangulation_isosig(\n          ...         ignore_orientation=False,\n          ...         ignore_curves=True,\n          ...         ignore_filling_orientations=True,\n          ...         ignore_cusp_ordering=True)\n          >>> isosig\n          'gLLMQcbeefefujumapn(-2,1)'\n          >>> Manifold(isosig).solution_type()\n          'contains negatively oriented tetrahedra'\n\n        Preserve the unoriented spun-triangulation structure including the\n        direction it is spinning::\n\n          >>> isosig = M.triangulation_isosig(\n          ...         ignore_cusp_ordering=True,\n          ...         ignore_curves=True)\n          >>> isosig\n          'gLLMQcbeefefpjaqupw(1,1)'\n          >>> Manifold(isosig).solution_type()\n          'all tetrahedra positively oriented'\n\n        **Orientation**\n\n        Note that :attr:`ignore_orientation=True` only applies to the undecorated\n        part of the isomorphism signature. The decoration can still capture the\n        the orientation.\n        More, precisely, the result of :meth:`.triangulation_isosig` depends on\n        the orientation (if the triangulation is orientable and chiral) if any\n        of the following is true:\n\n        #. :attr:`ignore_orientation = False`.\n\n        #. :attr:`decorated = True` and\n           :attr:`ignore_curves = False` and\n           :attr:`ignore_filling_orientations = False`.\n\n        In these cases, re-constructing a triangulation from the isomorphism\n        signature yields a triangulation with the same handedness.\n\n        :param decorated:\n                Include peripheral information such as indexing of the cusps,\n                (oriented or unoriented) peripher""al curves and\n                (oriented or unoriented) Dehn-fillings.\n        :param ignore_cusp_ordering:\n                Do not encode the indexing of the cusps.\n                Only relevant if :attr:`decorated = True`.\n        :param ignore_curves:\n                Do not encode the peripheral curves.\n                Only relevant if :attr:`decorated = True`.\n                This is new in SnapPy version 3.2.\n                If :attr:`ignore_curves = True`, the result of this method cannot\n                be given to prior versions.\n        :param ignore_curve_orientations:\n                Do not encode the orientations of the peripheral curves.\n                Only relevant if :attr:`decorated = True` and\n                :attr:`ignore_curves = False`.\n        :param ignore_filling_orientations:\n                Do not encode the orientation of the class of peripheral curves\n                intersecting the Dehn-fillings.\n                Only relevant if :attr:`decorated = True`.\n        :param ignore_orientation:\n                Do not encode the orientation of the triangulation in the\n                undecorated part of the triangulation isosig.\n                See above section about orientation.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_143triangulation_isosig = {"triangulation_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_143triangulation_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_142triangulation_isosig};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_143triangulation_isosig(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_decorated = 0;
  PyObject *__pyx_v_ignore_cusp_ordering = 0;
  PyObject *__pyx_v_ignore_curves = 0;
  PyObject *__pyx_v_ignore_curve_orientations = 0;
  PyObject *__pyx_v_ignore_filling_orientations = 0;
  PyObject *__pyx_v_ignore_orientation = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("triangulation_isosig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_decorated,&__pyx_mstate_global->__pyx_n_u_ignore_cusp_ordering,&__pyx_mstate_global->__pyx_n_u_ignore_curves,&__pyx_mstate_global->__pyx_n_u_ignore_curve_orientations,&__pyx_mstate_global->__pyx_n_u_ignore_filling_orientations,&__pyx_mstate_global->__pyx_n_u_ignore_orientation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 2938, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "triangulation_isosig", 0) < 0) __PYX_ERR(4, 2938, __pyx_L3_error)

      /* "cython/core/triangulation.pyx":2939
 * 
 *     def triangulation_isosig(self,
 *                              decorated : bool = True,             # <<<<<<<<<<<<<<
 *                              ignore_cusp_ordering : bool = False,
 *                              ignore_curves : bool = False,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2940
 *     def triangulation_isosig(self,
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_curves : bool = False,
 *                              ignore_curve_orientations : bool = False,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2941
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,
 *                              ignore_curves : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_curve_orientations : bool = False,
 *                              ignore_filling_orientations : bool = False,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2942
 *                              ignore_cusp_ordering : bool = False,
 *                              ignore_curves : bool = False,
 *                              ignore_curve_orientations : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_filling_orientations : bool = False,
 *                              ignore_orientation : bool = True) -> str:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2943
 *                              ignore_curves : bool = False,
 *                              ignore_curve_orientations : bool = False,
 *                              ignore_filling_orientations : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_orientation : bool = True) -> str:
 *         """
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2944
 *                              ignore_curve_orientations : bool = False,
 *                              ignore_filling_orientations : bool = False,
 *                              ignore_orientation : bool = True) -> str:             # <<<<<<<<<<<<<<
 *         """
 *         Returns the "(decorated) isomorphism signature", a compact text
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/triangulation.pyx":2939
 * 
 *     def triangulation_isosig(self,
 *                              decorated : bool = True,             # <<<<<<<<<<<<<<
 *                              ignore_cusp_ordering : bool = False,
 *                              ignore_curves : bool = False,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/triangulation.pyx":2940
 *     def triangulation_isosig(self,
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_curves : bool = False,
 *                              ignore_curve_orientations : bool = False,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2941
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,
 *                              ignore_curves : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_curve_orientations : bool = False,
 *                              ignore_filling_orientations : bool = False,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2942
 *                              ignore_cusp_ordering : bool = False,
 *                              ignore_curves : bool = False,
 *                              ignore_curve_orientations : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_filling_orientations : bool = False,
 *                              ignore_orientation : bool = True) -> str:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2943
 *                              ignore_curves : bool = False,
 *                              ignore_curve_orientations : bool = False,
 *                              ignore_filling_orientations : bool = False,             # <<<<<<<<<<<<<<
 *                              ignore_orientation : bool = True) -> str:
 *         """
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "cython/core/triangulation.pyx":2944
 *                              ignore_curve_orientations : bool = False,
 *                              ignore_filling_orientations : bool = False,
 *                              ignore_orientation : bool = True) -> str:             # <<<<<<<<<<<<<<
 *         """
 *         Returns the "(decorated) isomorphism signature", a compact text
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_decorated = values[0];
    __pyx_v_ignore_cusp_ordering = values[1];
    __pyx_v_ignore_curves = values[2];
    __pyx_v_ignore_curve_orientations = values[3];
    __pyx_v_ignore_filling_orientations = values[4];
    __pyx_v_ignore_orientation = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("triangulation_isosig", 0, 0, 6, __pyx_nargs); __PYX_ERR(4, 2938, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.triangulation_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_142triangulation_isosig(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_decorated, __pyx_v_ignore_cusp_ordering, __pyx_v_ignore_curves, __pyx_v_ignore_curve_orientations, __pyx_v_ignore_filling_orientations, __pyx_v_ignore_orientation);

  /* "cython/core/triangulation.pyx":2938
 *         return get_num_fake_cusps(self.c_triangulation) > 0
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_142triangulation_isosig(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_decorated, PyObject *__pyx_v_ignore_cusp_ordering, PyObject *__pyx_v_ignore_curves, PyObject *__pyx_v_ignore_curve_orientations, PyObject *__pyx_v_ignore_filling_orientations, PyObject *__pyx_v_ignore_orientation) {
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("triangulation_isosig", 0);

  /* "cython/core/triangulation.pyx":3196
 *         """
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated,
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":3197
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         args = (decorated,
 *                 ignore_cusp_ordering,
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 3197, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":3196
 *         """
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated,
*/
  }

  /* "cython/core/triangulation.pyx":3198
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated,             # <<<<<<<<<<<<<<
 *                 ignore_cusp_ordering,
 *                 ignore_curves,
*/
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_decorated);
  __Pyx_GIVEREF(__pyx_v_decorated);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_decorated) != (0)) __PYX_ERR(4, 3198, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ignore_cusp_ordering);
  __Pyx_GIVEREF(__pyx_v_ignore_cusp_ordering);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ignore_cusp_ordering) != (0)) __PYX_ERR(4, 3198, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ignore_curves);
  __Pyx_GIVEREF(__pyx_v_ignore_curves);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ignore_curves) != (0)) __PYX_ERR(4, 3198, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ignore_curve_orientations);
  __Pyx_GIVEREF(__pyx_v_ignore_curve_orientations);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ignore_curve_orientations) != (0)) __PYX_ERR(4, 3198, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ignore_filling_orientations);
  __Pyx_GIVEREF(__pyx_v_ignore_filling_orientations);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_ignore_filling_orientations) != (0)) __PYX_ERR(4, 3198, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ignore_orientation);
  __Pyx_GIVEREF(__pyx_v_ignore_orientation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_ignore_orientation) != (0)) __PYX_ERR(4, 3198, __pyx_L1_error);
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":3204
 *                 ignore_filling_orientations,
 *                 ignore_orientation)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('triangulation_isosig', *args)
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/triangulation.pyx":3205
 *                 ignore_orientation)
 *         try:
 *             return self._cache.lookup('triangulation_isosig', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3205, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyNumber_Add(__pyx_mstate_global->__pyx_tuple[17], __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3205, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3205, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(4, 3205, __pyx_L4_error)
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L8_try_return;

      /* "cython/core/triangulation.pyx":3204
 *                 ignore_filling_orientations,
 *                 ignore_orientation)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('triangulation_isosig', *args)
 *         except KeyError:
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":3206
 *         try:
 *             return self._cache.lookup('triangulation_isosig', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;

    /* "cython/core/triangulation.pyx":3204
 *                 ignore_filling_orientations,
 *                 ignore_orientation)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('triangulation_isosig', *args)
 *         except KeyError:
*/
    __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_L8_try_return:;
    __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_L0;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
  }

  /* "cython/core/triangulation.pyx":3209
 *             pass
 * 
 *         if decorated:             # <<<<<<<<<<<<<<
 *             result = decorated_isosig.decorated_isosig(
 *                 self, _triangulation_class,
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_decorated); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 3209, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":3210
 * 
 *         if decorated:
 *             result = decorated_isosig.decorated_isosig(             # <<<<<<<<<<<<<<
 *                 self, _triangulation_class,
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_decorated_isosig); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_decorated_isosig); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 3210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":3211
 *         if decorated:
 *             result = decorated_isosig.decorated_isosig(
 *                 self, _triangulation_class,             # <<<<<<<<<<<<<<
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
 *                 ignore_curves = ignore_curves,
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_triangulation_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/triangulation.pyx":3216
 *                 ignore_curve_orientations = ignore_curve_orientations,
 *                 ignore_filling_orientations = ignore_filling_orientations,
 *                 ignore_orientation = ignore_orientation)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self._undecorated_triangulation_isosig(
*/
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_t_2};
      __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_cusp_ordering, __pyx_v_ignore_cusp_ordering, __pyx_t_11, __pyx_callargs+3, 0) < 0) __PYX_ERR(4, 3210, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_curves, __pyx_v_ignore_curves, __pyx_t_11, __pyx_callargs+3, 1) < 0) __PYX_ERR(4, 3210, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_curve_orientations, __pyx_v_ignore_curve_orientations, __pyx_t_11, __pyx_callargs+3, 2) < 0) __PYX_ERR(4, 3210, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_filling_orientations, __pyx_v_ignore_filling_orientations, __pyx_t_11, __pyx_callargs+3, 3) < 0) __PYX_ERR(4, 3210, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_orientation, __pyx_v_ignore_orientation, __pyx_t_11, __pyx_callargs+3, 4) < 0) __PYX_ERR(4, 3210, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_10, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":3209
 *             pass
 * 
 *         if decorated:             # <<<<<<<<<<<<<<
 *             result = decorated_isosig.decorated_isosig(
 *                 self, _triangulation_class,
*/
    goto __pyx_L12;
  }

  /* "cython/core/triangulation.pyx":3218
 *                 ignore_orientation = ignore_orientation)
 *         else:
 *             result = self._undecorated_triangulation_isosig(             # <<<<<<<<<<<<<<
 *                 ignore_orientation = ignore_orientation)
 *         return self._cache.save(result, 'triangulation_isosig', *args)
*/
  /*else*/ {
    __pyx_t_10 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_10);

    /* "cython/core/triangulation.pyx":3219
 *         else:
 *             result = self._undecorated_triangulation_isosig(
 *                 ignore_orientation = ignore_orientation)             # <<<<<<<<<<<<<<
 *         return self._cache.save(result, 'triangulation_isosig', *args)
 * 
*/
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, NULL};
      __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_orientation, __pyx_v_ignore_orientation, __pyx_t_11, __pyx_callargs+1, 0) < 0) __PYX_ERR(4, 3218, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_undecorated_triangulation_isosi, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L12:;

  /* "cython/core/triangulation.pyx":3220
 *             result = self._undecorated_triangulation_isosig(
 *                 ignore_orientation = ignore_orientation)
 *         return self._cache.save(result, 'triangulation_isosig', *args)             # <<<<<<<<<<<<<<
 * 
 *     def _undecorated_triangulation_isosig(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_mstate_global->__pyx_n_u_save); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(__pyx_v_result);
  __Pyx_GIVEREF(__pyx_v_result);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_result) != (0)) __PYX_ERR(4, 3220, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_triangulation_isosig);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_triangulation_isosig);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_n_u_triangulation_isosig) != (0)) __PYX_ERR(4, 3220, __pyx_L1_error);
  __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_v_args); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 3220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_11))) __PYX_ERR(4, 3220, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_11);
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2938
 *         return get_num_fake_cusps(self.c_triangulation) > 0
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.triangulation_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":3222
 *         return self._cache.save(result, 'triangulation_isosig', *args)
 * 
 *     def _undecorated_triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                                           ignore_orientation : bool = False) -> str:
 *         if self.c_triangulation is NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_145_undecorated_triangulation_isosig(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_145_undecorated_triangulation_isosig = {"_undecorated_triangulation_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_145_undecorated_triangulation_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_145_undecorated_triangulation_isosig(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_ignore_orientation = 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("_undecorated_triangulation_isosig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ignore_orientation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 3222, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_undecorated_triangulation_isosig", 0) < 0) __PYX_ERR(4, 3222, __pyx_L3_error)

      /* "cython/core/triangulation.pyx":3223
 * 
 *     def _undecorated_triangulation_isosig(self,
 *                                           ignore_orientation : bool = False) -> str:             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_ignore_orientation = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_undecorated_triangulation_isosig", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 3222, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._undecorated_triangulation_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_144_undecorated_triangulation_isosig(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_ignore_orientation);

  /* "cython/core/triangulation.pyx":3222
 *         return self._cache.save(result, 'triangulation_isosig', *args)
 * 
 *     def _undecorated_triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                                           ignore_orientation : bool = False) -> str:
 *         if self.c_triangulation is NULL:
*/

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_144_undecorated_triangulation_isosig(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_ignore_orientation) {
  char *__pyx_v_c_string;
  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;
  size_t __pyx_t_5;
  Boolean __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  char const *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_undecorated_triangulation_isosig", 0);

  /* "cython/core/triangulation.pyx":3224
 *     def _undecorated_triangulation_isosig(self,
 *                                           ignore_orientation : bool = False) -> str:
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":3225
 *                                           ignore_orientation : bool = False) -> str:
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         cdef char *c_string
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 3225, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":3224
 *     def _undecorated_triangulation_isosig(self,
 *                                           ignore_orientation : bool = False) -> str:
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":3228
 * 
 *         cdef char *c_string
 *         try:             # <<<<<<<<<<<<<<
 *             c_string = get_isomorphism_signature(
 *                 self.c_triangulation, ignore_orientation)
*/
  /*try:*/ {

    /* "cython/core/triangulation.pyx":3230
 *         try:
 *             c_string = get_isomorphism_signature(
 *                 self.c_triangulation, ignore_orientation)             # <<<<<<<<<<<<<<
 *             return to_str(c_string)
 *         finally:
*/
    __pyx_t_6 = __Pyx_PyLong_As_Boolean(__pyx_v_ignore_orientation); if (unlikely((__pyx_t_6 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(4, 3230, __pyx_L5_error)

    /* "cython/core/triangulation.pyx":3229
 *         cdef char *c_string
 *         try:
 *             c_string = get_isomorphism_signature(             # <<<<<<<<<<<<<<
 *                 self.c_triangulation, ignore_orientation)
 *             return to_str(c_string)
*/
    __pyx_v_c_string = get_isomorphism_signature(__pyx_v_self->c_triangulation, __pyx_t_6);

    /* "cython/core/triangulation.pyx":3231
 *             c_string = get_isomorphism_signature(
 *                 self.c_triangulation, ignore_orientation)
 *             return to_str(c_string)             # <<<<<<<<<<<<<<
 *         finally:
 *             free(c_string)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3231, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_c_string); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 3231, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3231, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(4, 3231, __pyx_L5_error)
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4_return;
  }

  /* "cython/core/triangulation.pyx":3233
 *             return to_str(c_string)
 *         finally:
 *             free(c_string)             # <<<<<<<<<<<<<<
 * 
 *     def _symplectic_form(self, u, v):
*/
  /*finally:*/ {
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      if ( unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
      {
        free(__pyx_v_c_string);
      }
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
      goto __pyx_L1_error;
    }
    __pyx_L4_return: {
      __pyx_t_17 = __pyx_r;
      __pyx_r = 0;
      free(__pyx_v_c_string);
      __pyx_r = __pyx_t_17;
      __pyx_t_17 = 0;
      goto __pyx_L0;
    }
  }

  /* "cython/core/triangulation.pyx":3222
 *         return self._cache.save(result, 'triangulation_isosig', *args)
 * 
 *     def _undecorated_triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                                           ignore_orientation : bool = False) -> str:
 *         if self.c_triangulation is NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._undecorated_triangulation_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":3235
 *             free(c_string)
 * 
 *     def _symplectic_form(self, u, v):             # <<<<<<<<<<<<<<
 *         return sum([u[2 * i] * v[2 * i + 1] - u[2 * i + 1] * v[2 * i] for i in range(len(u) // 2)])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_147_symplectic_form(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_147_symplectic_form = {"_symplectic_form", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_147_symplectic_form, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_147_symplectic_form(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_u = 0;
  PyObject *__pyx_v_v = 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("_symplectic_form (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_u,&__pyx_mstate_global->__pyx_n_u_v,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 3235, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_symplectic_form", 0) < 0) __PYX_ERR(4, 3235, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_symplectic_form", 1, 2, 2, i); __PYX_ERR(4, 3235, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3235, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 3235, __pyx_L3_error)
    }
    __pyx_v_u = values[0];
    __pyx_v_v = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_symplectic_form", 1, 2, 2, __pyx_nargs); __PYX_ERR(4, 3235, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._symplectic_form", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_146_symplectic_form(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_u, __pyx_v_v);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_146_symplectic_form(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_u, PyObject *__pyx_v_v) {
  PyObject *__pyx_9genexpr41__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_symplectic_form", 0);

  /* "cython/core/triangulation.pyx":3236
 * 
 *     def _symplectic_form(self, u, v):
 *         return sum([u[2 * i] * v[2 * i + 1] - u[2 * i + 1] * v[2 * i] for i in range(len(u) // 2)])             # <<<<<<<<<<<<<<
 * 
 *     def _is_symplectic(self, M):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_3 = __pyx_builtin_sum; 
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3236, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_7 = __pyx_builtin_range; 
    __pyx_t_8 = PyObject_Length(__pyx_v_u); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 3236, __pyx_L5_error)
    __pyx_t_9 = PyLong_FromSsize_t(__Pyx_div_Py_ssize_t(__pyx_t_8, 2, 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 3236, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_9};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_7 = __pyx_t_5; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3236, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3236, __pyx_L5_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3236, __pyx_L5_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3236, __pyx_L5_error)
      } else {
        __pyx_t_5 = __pyx_t_11(__pyx_t_7);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 3236, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_i, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_9genexpr41__pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_u, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_9genexpr41__pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_v, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_9genexpr41__pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyLong_AddObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_u, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_9genexpr41__pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_v, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_12))) __PYX_ERR(4, 3236, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_i); __pyx_9genexpr41__pyx_v_i = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_i); __pyx_9genexpr41__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 3236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":3235
 *             free(c_string)
 * 
 *     def _symplectic_form(self, u, v):             # <<<<<<<<<<<<<<
 *         return sum([u[2 * i] * v[2 * i + 1] - u[2 * i + 1] * v[2 * i] for i in range(len(u) // 2)])
 * 
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._symplectic_form", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":3238
 *         return sum([u[2 * i] * v[2 * i + 1] - u[2 * i + 1] * v[2 * i] for i in range(len(u) // 2)])
 * 
 *     def _is_symplectic(self, M):             # <<<<<<<<<<<<<<
 *         """
 *         Test if the matrix M is symplectic
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_149_is_symplectic(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_8SnapPyHP_13Triangulation_148_is_symplectic, "\n        Test if the matrix M is symplectic\n        :param M: square matrix\n        :return: true or false\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_149_is_symplectic = {"_is_symplectic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_149_is_symplectic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_148_is_symplectic};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_149_is_symplectic(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_M = 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_symplectic (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_M,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 3238, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_is_symplectic", 0) < 0) __PYX_ERR(4, 3238, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_is_symplectic", 1, 1, 1, i); __PYX_ERR(4, 3238, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3238, __pyx_L3_error)
    }
    __pyx_v_M = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_is_symplectic", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 3238, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation._is_symplectic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_148_is_symplectic(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_M);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_148_is_symplectic(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_M) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_omega = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_is_symplectic", 0);

  /* "cython/core/triangulation.pyx":3244
 *         :return: true or false
 *         """
 *         n = len(M)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_M); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 3244, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "cython/core/triangulation.pyx":3246
 *         n = len(M)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             for j in range(i, n):
 *                 omega = abs(self._symplectic_form(M[i], M[j]))
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_4 = __pyx_builtin_range; 
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 3246, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3246, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3246, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3246, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 3246, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":3247
 * 
 *         for i in range(n):
 *             for j in range(i, n):             # <<<<<<<<<<<<<<
 *                 omega = abs(self._symplectic_form(M[i], M[j]))
 * 
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_3 = __pyx_builtin_range; 
    __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_i, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 3247, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3247, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3247, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3247, __pyx_L1_error)
      } else {
        __pyx_t_2 = __pyx_t_10(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 3247, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":3248
 *         for i in range(n):
 *             for j in range(i, n):
 *                 omega = abs(self._symplectic_form(M[i], M[j]))             # <<<<<<<<<<<<<<
 * 
 *                 if i % 2 == 0 and j % 2 == 1 and j == i + 1:
*/
      __pyx_t_8 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_M, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_M, __pyx_v_j); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_11};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_symplectic_form, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_11 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_omega, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "cython/core/triangulation.pyx":3250
 *                 omega = abs(self._symplectic_form(M[i], M[j]))
 * 
 *                 if i % 2 == 0 and j % 2 == 1 and j == i + 1:             # <<<<<<<<<<<<<<
 *                     if omega != 2:
 *                         return False
*/
      __pyx_t_11 = __Pyx_PyLong_RemainderObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(4, 3250, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_13) {
      } else {
        __pyx_t_12 = __pyx_t_13;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_11 = __Pyx_PyLong_RemainderObjC(__pyx_v_j, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(4, 3250, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_13) {
      } else {
        __pyx_t_12 = __pyx_t_13;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_11 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_j, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3250, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(4, 3250, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_12 = __pyx_t_13;
      __pyx_L8_bool_binop_done:;
      if (__pyx_t_12) {

        /* "cython/core/triangulation.pyx":3251
 * 
 *                 if i % 2 == 0 and j % 2 == 1 and j == i + 1:
 *                     if omega != 2:             # <<<<<<<<<<<<<<
 *                         return False
 *                 elif omega:
*/
        __pyx_t_12 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_omega, __pyx_mstate_global->__pyx_int_2, 2, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 3251, __pyx_L1_error)
        if (__pyx_t_12) {

          /* "cython/core/triangulation.pyx":3252
 *                 if i % 2 == 0 and j % 2 == 1 and j == i + 1:
 *                     if omega != 2:
 *                         return False             # <<<<<<<<<<<<<<
 *                 elif omega:
 *                     return False
*/
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(Py_False);
          __pyx_r = Py_False;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L0;

          /* "cython/core/triangulation.pyx":3251
 * 
 *                 if i % 2 == 0 and j % 2 == 1 and j == i + 1:
 *                     if omega != 2:             # <<<<<<<<<<<<<<
 *                         return False
 *                 elif omega:
*/
        }

        /* "cython/core/triangulation.pyx":3250
 *                 omega = abs(self._symplectic_form(M[i], M[j]))
 * 
 *                 if i % 2 == 0 and j % 2 == 1 and j == i + 1:             # <<<<<<<<<<<<<<
 *                     if omega != 2:
 *                         return False
*/
        goto __pyx_L7;
      }

      /* "cython/core/triangulation.pyx":3253
 *                     if omega != 2:
 *                         return False
 *                 elif omega:             # <<<<<<<<<<<<<<
 *                     return False
 * 
*/
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_omega); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(4, 3253, __pyx_L1_error)
      if (__pyx_t_12) {

        /* "cython/core/triangulation.pyx":3254
 *                         return False
 *                 elif omega:
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *         return True
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L0;

        /* "cython/core/triangulation.pyx":3253
 *                     if omega != 2:
 *                         return False
 *                 elif omega:             # <<<<<<<<<<<<<<
 *                     return False
 * 
*/
      }
      __pyx_L7:;

      /* "cython/core/triangulation.pyx":3247
 * 
 *         for i in range(n):
 *             for j in range(i, n):             # <<<<<<<<<<<<<<
 *                 omega = abs(self._symplectic_form(M[i], M[j]))
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":3246
 *         n = len(M)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             for j in range(i, n):
 *                 omega = abs(self._symplectic_form(M[i], M[j]))
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":3256
 *                     return False
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def symplectic_basis(self, verify : bool = False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":3238
 *         return sum([u[2 * i] * v[2 * i + 1] - u[2 * i + 1] * v[2 * i] for i in range(len(u) // 2)])
 * 
 *     def _is_symplectic(self, M):             # <<<<<<<<<<<<<<
 *         """
 *         Test if the matrix M is symplectic
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.Triangulation._is_symplectic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_omega);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":3258
 *         return True
 * 
 *     def symplectic_basis(self, verify : bool = False):             # <<<<<<<<<<<<<<
 *         """
 *         Extend the Neumann-Zagier matrix to one which is symplectic
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_151symplectic_basis(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_8SnapPyHP_13Triangulation_150symplectic_basis, "\n        Extend the Neumann-Zagier matrix to one which is symplectic\n        (up to factors of 2) using oscillating curves, see\n        `Mathews and Purcell '22 <https://arxiv.org/abs/2208.06969>`_.\n        Only accepts triangulations with 1 cusp.\n\n          >>> M = Manifold(\"4_1\")\n          >>> M.symplectic_basis()\n          [-1  0 -1 -1]\n          [ 2  0 -2  0]\n          [-2 -1 -2 -1]\n          [ 0 -1 -2 -1]\n\n\n        :param verify: Explicitly test if the resulting matrix is symplectic.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13Triangulation_151symplectic_basis = {"symplectic_basis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_151symplectic_basis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_150symplectic_basis};
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_151symplectic_basis(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_verify = 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("symplectic_basis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_verify,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 3258, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "symplectic_basis", 0) < 0) __PYX_ERR(4, 3258, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 3258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_verify = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("symplectic_basis", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 3258, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Triangulation.symplectic_basis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13Triangulation_150symplectic_basis(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self), __pyx_v_verify);

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_150symplectic_basis(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self, PyObject *__pyx_v_verify) {
  int **__pyx_v_g_eqns;
  int __pyx_v_num_rows;
  int __pyx_v_num_cols;
  int __pyx_v_dual_rows;
  int *__pyx_v_eqn;
  PyObject *__pyx_v_eqns = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_cusp_info = NULL;
  PyObject *__pyx_v_to_do = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_l = NULL;
  Py_ssize_t __pyx_v_rows;
  PyObject *__pyx_v_retval = NULL;
  int __pyx_9genexpr42__pyx_v_j;
  int __pyx_9genexpr43__pyx_v_j;
  Py_ssize_t __pyx_9genexpr44__pyx_v_i;
  Py_ssize_t __pyx_9genexpr45__pyx_v_j;
  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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int **__pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("symplectic_basis", 0);

  /* "cython/core/triangulation.pyx":3281
 *         cdef int* eqn;
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":3282
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         # current get_symplectic_eqns() implementation requires 1 cusp
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 3282, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":3281
 *         cdef int* eqn;
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/triangulation.pyx":3285
 * 
 *         # current get_symplectic_eqns() implementation requires 1 cusp
 *         if self.num_cusps() > 1:             # <<<<<<<<<<<<<<
 *             raise ValueError('Triangulation contains {} cusps, only accepts triangulations with 1 cusp'.format(self.num_cusps()))
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 3285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":3286
 *         # current get_symplectic_eqns() implementation requires 1 cusp
 *         if self.num_cusps() > 1:
 *             raise ValueError('Triangulation contains {} cusps, only accepts triangulations with 1 cusp'.format(self.num_cusps()))             # <<<<<<<<<<<<<<
 * 
 *         eqns = []
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_3 = __pyx_builtin_ValueError; 
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_Triangulation_contains_cusps_onl;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(4, 3286, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":3285
 * 
 *         # current get_symplectic_eqns() implementation requires 1 cusp
 *         if self.num_cusps() > 1:             # <<<<<<<<<<<<<<
 *             raise ValueError('Triangulation contains {} cusps, only accepts triangulations with 1 cusp'.format(self.num_cusps()))
 * 
*/
  }

  /* "cython/core/triangulation.pyx":3288
 *             raise ValueError('Triangulation contains {} cusps, only accepts triangulations with 1 cusp'.format(self.num_cusps()))
 * 
 *         eqns = []             # <<<<<<<<<<<<<<
 * 
 *         peripheral_curves(self.c_triangulation)
*/
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_eqns = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":3290
 *         eqns = []
 * 
 *         peripheral_curves(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         # Cusp Equations
*/
  peripheral_curves(__pyx_v_self->c_triangulation);

  /* "cython/core/triangulation.pyx":3293
 * 
 *         # Cusp Equations
 *         for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_6 = __pyx_builtin_range; 
  __pyx_t_8 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3293, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3293, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_10);
        ++__pyx_t_10;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3293, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10);
        #endif
        ++__pyx_t_10;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3293, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_11(__pyx_t_6);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 3293, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":3294
 *         # Cusp Equations
 *         for i in range(self.num_cusps()):
 *             cusp_info = self.cusp_info(i)             # <<<<<<<<<<<<<<
 *             if cusp_info.is_complete:
 *                 to_do = [(1,0), (0,1)]
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_i};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_cusp_info, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":3295
 *         for i in range(self.num_cusps()):
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 *                 to_do = [(1,0), (0,1)]
 *             else:
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_mstate_global->__pyx_n_u_is_complete); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 3295, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":3296
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:
 *                 to_do = [(1,0), (0,1)]             # <<<<<<<<<<<<<<
 *             else:
 *                 to_do = [cusp_info.filling]
*/
      __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[5]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_tuple[5]) != (0)) __PYX_ERR(4, 3296, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[4]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_tuple[4]) != (0)) __PYX_ERR(4, 3296, __pyx_L1_error);
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":3295
 *         for i in range(self.num_cusps()):
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 *                 to_do = [(1,0), (0,1)]
 *             else:
*/
      goto __pyx_L7;
    }

    /* "cython/core/triangulation.pyx":3298
 *                 to_do = [(1,0), (0,1)]
 *             else:
 *                 to_do = [cusp_info.filling]             # <<<<<<<<<<<<<<
 *             for (m, l) in to_do:
 *                 eqn = get_cusp_equation(self.c_triangulation,
*/
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_mstate_global->__pyx_n_u_filling); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4) != (0)) __PYX_ERR(4, 3298, __pyx_L1_error);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;
    }
    __pyx_L7:;

    /* "cython/core/triangulation.pyx":3299
 *             else:
 *                 to_do = [cusp_info.filling]
 *             for (m, l) in to_do:             # <<<<<<<<<<<<<<
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)
*/
    __pyx_t_2 = __pyx_v_to_do; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_12 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3299, __pyx_L1_error)
        #endif
        if (__pyx_t_12 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_12);
      ++__pyx_t_12;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(4, 3299, __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_INCREF(__pyx_t_3);
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_8);
        } else {
          __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3299, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3299, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_8);
        }
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 3299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
        index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_8 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_7), 2) < 0) __PYX_ERR(4, 3299, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L11_unpacking_done;
        __pyx_L10_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(4, 3299, __pyx_L1_error)
        __pyx_L11_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/triangulation.pyx":3301
 *             for (m, l) in to_do:
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)             # <<<<<<<<<<<<<<
 *                 eqns.append([eqn[j] for j in range(num_rows)])
 *                 free_cusp_equation(eqn)
*/
      __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_v_i); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 3301, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 3301, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 3301, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":3300
 *                 to_do = [cusp_info.filling]
 *             for (m, l) in to_do:
 *                 eqn = get_cusp_equation(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         i, int(m), int(l), &num_rows)
 *                 eqns.append([eqn[j] for j in range(num_rows)])
*/
      __pyx_v_eqn = get_cusp_equation(__pyx_v_self->c_triangulation, __pyx_t_14, __pyx_t_15, __pyx_t_16, (&__pyx_v_num_rows));

      /* "cython/core/triangulation.pyx":3302
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)
 *                 eqns.append([eqn[j] for j in range(num_rows)])             # <<<<<<<<<<<<<<
 *                 free_cusp_equation(eqn)
 * 
*/
      { /* enter inner scope */
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_16 = __pyx_v_num_rows;
        __pyx_t_15 = __pyx_t_16;
        for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14+=1) {
          __pyx_9genexpr42__pyx_v_j = __pyx_t_14;
          __pyx_t_8 = __Pyx_PyLong_From_int((__pyx_v_eqn[__pyx_9genexpr42__pyx_v_j])); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(4, 3302, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      } /* exit inner scope */
      __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_eqns, __pyx_t_4); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(4, 3302, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":3303
 *                                         i, int(m), int(l), &num_rows)
 *                 eqns.append([eqn[j] for j in range(num_rows)])
 *                 free_cusp_equation(eqn)             # <<<<<<<<<<<<<<
 * 
 *         # Dual Curve Equations
*/
      free_cusp_equation(__pyx_v_eqn);

      /* "cython/core/triangulation.pyx":3299
 *             else:
 *                 to_do = [cusp_info.filling]
 *             for (m, l) in to_do:             # <<<<<<<<<<<<<<
 *                 eqn = get_cusp_equation(self.c_triangulation,
 *                                         i, int(m), int(l), &num_rows)
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":3293
 * 
 *         # Cusp Equations
 *         for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *             cusp_info = self.cusp_info(i)
 *             if cusp_info.is_complete:
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":3306
 * 
 *         # Dual Curve Equations
 *         g_eqns = get_symplectic_basis(self.c_triangulation, &dual_rows, &num_cols, 0)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(dual_rows):
*/
  __pyx_t_18 = get_symplectic_basis(__pyx_v_self->c_triangulation, (&__pyx_v_dual_rows), (&__pyx_v_num_cols), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 3306, __pyx_L1_error)
  __pyx_v_g_eqns = __pyx_t_18;

  /* "cython/core/triangulation.pyx":3308
 *         g_eqns = get_symplectic_basis(self.c_triangulation, &dual_rows, &num_cols, 0)
 * 
 *         for i in range(dual_rows):             # <<<<<<<<<<<<<<
 *             eqns.append([g_eqns[i][j] for j in range(num_cols)])
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_4 = __pyx_builtin_range; 
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_dual_rows); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  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_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 3308, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3308, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_10);
        ++__pyx_t_10;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 3308, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10);
        #endif
        ++__pyx_t_10;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3308, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_11(__pyx_t_4);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 3308, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":3309
 * 
 *         for i in range(dual_rows):
 *             eqns.append([g_eqns[i][j] for j in range(num_cols)])             # <<<<<<<<<<<<<<
 * 
 *         free_symplectic_basis(g_eqns, dual_rows)
*/
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_16 = __pyx_v_num_cols;
      __pyx_t_15 = __pyx_t_16;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14+=1) {
        __pyx_9genexpr43__pyx_v_j = __pyx_t_14;
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 3309, __pyx_L1_error)
        __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_g_eqns[__pyx_t_12])[__pyx_9genexpr43__pyx_v_j])); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_8))) __PYX_ERR(4, 3309, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    } /* exit inner scope */
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_eqns, __pyx_t_6); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(4, 3309, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":3308
 *         g_eqns = get_symplectic_basis(self.c_triangulation, &dual_rows, &num_cols, 0)
 * 
 *         for i in range(dual_rows):             # <<<<<<<<<<<<<<
 *             eqns.append([g_eqns[i][j] for j in range(num_cols)])
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":3311
 *             eqns.append([g_eqns[i][j] for j in range(num_cols)])
 * 
 *         free_symplectic_basis(g_eqns, dual_rows)             # <<<<<<<<<<<<<<
 * 
 *         # Convert to Neumann Zagier Matrix
*/
  free_symplectic_basis(__pyx_v_g_eqns, __pyx_v_dual_rows); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 3311, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":3314
 * 
 *         # Convert to Neumann Zagier Matrix
 *         rows = len(eqns)             # <<<<<<<<<<<<<<
 *         retval = [[eqns[i][3 * (j // 2) + j % 2] - eqns[i][3 * (j // 2) + 2] for j in range(rows)] for i in range(rows)]
 * 
*/
  __pyx_t_10 = __Pyx_PyList_GET_SIZE(__pyx_v_eqns); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(4, 3314, __pyx_L1_error)
  __pyx_v_rows = __pyx_t_10;

  /* "cython/core/triangulation.pyx":3315
 *         # Convert to Neumann Zagier Matrix
 *         rows = len(eqns)
 *         retval = [[eqns[i][3 * (j // 2) + j % 2] - eqns[i][3 * (j // 2) + 2] for j in range(rows)] for i in range(rows)]             # <<<<<<<<<<<<<<
 * 
 *         if verify:
*/
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __pyx_v_rows;
    __pyx_t_12 = __pyx_t_10;
    for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_12; __pyx_t_19+=1) {
      __pyx_9genexpr44__pyx_v_i = __pyx_t_19;
      { /* enter inner scope */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 3315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_20 = __pyx_v_rows;
        __pyx_t_21 = __pyx_t_20;
        for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
          __pyx_9genexpr45__pyx_v_j = __pyx_t_22;
          __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_eqns, __pyx_9genexpr44__pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_23 = ((3 * __Pyx_div_Py_ssize_t(__pyx_9genexpr45__pyx_v_j, 2, 1)) + __Pyx_mod_Py_ssize_t(__pyx_9genexpr45__pyx_v_j, 2, 1));
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, __pyx_t_23, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_eqns, __pyx_9genexpr44__pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_23 = ((3 * __Pyx_div_Py_ssize_t(__pyx_9genexpr45__pyx_v_j, 2, 1)) + 2);
          __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, __pyx_t_23, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_8))) __PYX_ERR(4, 3315, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 3315, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_v_retval = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":3317
 *         retval = [[eqns[i][3 * (j // 2) + j % 2] - eqns[i][3 * (j // 2) + 2] for j in range(rows)] for i in range(rows)]
 * 
 *         if verify:             # <<<<<<<<<<<<<<
 *             if self._is_symplectic(retval):
 *                 print("Result is symplectic (up to factors of 2)")
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verify); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 3317, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":3318
 * 
 *         if verify:
 *             if self._is_symplectic(retval):             # <<<<<<<<<<<<<<
 *                 print("Result is symplectic (up to factors of 2)")
 *             else:
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_retval};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_symplectic, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 3318, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":3319
 *         if verify:
 *             if self._is_symplectic(retval):
 *                 print("Result is symplectic (up to factors of 2)")             # <<<<<<<<<<<<<<
 *             else:
 *                 print("Warning: Result is not symplectic")
*/
      __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_builtin_print);
      __pyx_t_8 = __pyx_builtin_print; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Result_is_symplectic_up_to_facto};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":3318
 * 
 *         if verify:
 *             if self._is_symplectic(retval):             # <<<<<<<<<<<<<<
 *                 print("Result is symplectic (up to factors of 2)")
 *             else:
*/
      goto __pyx_L26;
    }

    /* "cython/core/triangulation.pyx":3321
 *                 print("Result is symplectic (up to factors of 2)")
 *             else:
 *                 print("Warning: Result is not symplectic")             # <<<<<<<<<<<<<<
 * 
 *         return matrix(retval)
*/
    /*else*/ {
      __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_builtin_print);
      __pyx_t_6 = __pyx_builtin_print; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Warning_Result_is_not_symplectic};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L26:;

    /* "cython/core/triangulation.pyx":3317
 *         retval = [[eqns[i][3 * (j // 2) + j % 2] - eqns[i][3 * (j // 2) + 2] for j in range(rows)] for i in range(rows)]
 * 
 *         if verify:             # <<<<<<<<<<<<<<
 *             if self._is_symplectic(retval):
 *                 print("Result is symplectic (up to factors of 2)")
*/
  }

  /* "cython/core/triangulation.pyx":3323
 *                 print("Warning: Result is not symplectic")
 * 
 *         return matrix(retval)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_retval};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":3258
 *         return True
 * 
 *     def symplectic_basis(self, verify : bool = False):             # <<<<<<<<<<<<<<
 *         """
 *         Extend the Neumann-Zagier matrix to one which is symplectic
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.Triangulation.symplectic_basis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_eqns);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_cusp_info);
  __Pyx_XDECREF(__pyx_v_to_do);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_retval);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":74
 *     cdef _PDcode
 *     cdef _cover_info
 *     cdef readonly _cache             # <<<<<<<<<<<<<<
 *     cdef readonly LE
 *     cdef _link_file_full_path
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_6_cache_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_6_cache_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_8SnapPyHP_13Triangulation_6_cache___get__(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_6_cache___get__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_cache);
  __pyx_r = __pyx_v_self->_cache;
  goto __pyx_L0;

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

/* "cython/core/triangulation.pyx":75
 *     cdef _cover_info
 *     cdef readonly _cache
 *     cdef readonly LE             # <<<<<<<<<<<<<<
 *     cdef _link_file_full_path
 *     cdef hyperbolic_structure_initialized
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_2LE_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_13Triangulation_2LE_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_8SnapPyHP_13Triangulation_2LE___get__(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13Triangulation_2LE___get__(struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->LE);
  __pyx_r = __pyx_v_self->LE;
  goto __pyx_L0;

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

/* "cython/core/manifold.pyx":80
 *     """
 * 
 *     def __init__(self, spec=None):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             self.init_hyperbolic_structure()
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_8Manifold_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_8Manifold_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_spec = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_spec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 80, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 80, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(2, 80, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 80, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_spec = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 80, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold___init__(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_spec);

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

static int __pyx_pf_8SnapPyHP_8Manifold___init__(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_spec) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/manifold.pyx":81
 * 
 *     def __init__(self, spec=None):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 *             do_Dehn_filling(self.c_triangulation)
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation != NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":82
 *     def __init__(self, spec=None):
 *         if self.c_triangulation != NULL:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 *             do_Dehn_filling(self.c_triangulation)
 * 
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init_hyperbolic_structure, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 82, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":83
 *         if self.c_triangulation != NULL:
 *             self.init_hyperbolic_structure()
 *             do_Dehn_filling(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
    do_Dehn_filling(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 83, __pyx_L1_error)

    /* "cython/core/manifold.pyx":81
 * 
 *     def __init__(self, spec=None):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 *             do_Dehn_filling(self.c_triangulation)
*/
  }

  /* "cython/core/manifold.pyx":80
 *     """
 * 
 *     def __init__(self, spec=None):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             self.init_hyperbolic_structure()
*/

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

/* "cython/core/manifold.pyx":85
 *             do_Dehn_filling(self.c_triangulation)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_3_number_(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_3_number_ = {"_number_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_3_number_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_3_number_(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_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("_number_ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 85, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 85, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_number_", 0) < 0) __PYX_ERR(2, 85, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, i); __PYX_ERR(2, 85, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 85, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 85, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._number_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_2_number_(__pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_2_number_(PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/manifold.pyx":87
 *     @staticmethod
 *     def _number_(n):
 *         return number.number_to_native_number(n)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number_to_native_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_n};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":85
 *             do_Dehn_filling(self.c_triangulation)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

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

/* "cython/core/manifold.pyx":89
 *         return number.number_to_native_number(n)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def use_field_conversion(cls, func):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_5use_field_conversion(PyObject *__pyx_v_cls, 
#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_8SnapPyHP_8Manifold_4use_field_conversion, "\n        A class method for specifying a numerical conversion function.\n        This method is deprecated: SnapPy will automatically use\n        SageMath number types or its own SnapPy number type depending on\n        whether SageMath is available or not.\n\n        SnapPy includes its own number type, snappy.Number, which can\n        represent floating point real or complex numbers of varying\n        precision.  (In fact, Number is a wrapper for a pari number of\n        type 't_INT', 't_FRAC', 't_REAL' or 't_COMPLEX', and the pari\n        gen can be extracted as an attribute: x.gen .)  Methods of\n        SnapPy objects which return numerical values will first compute\n        the value as a Number, and then optionally convert the Number\n        to a different numerical type which can be specified by calling\n        this class method.\n\n        By default SnapPy returns Numbers when loaded into python, and\n        elements of a Sage RealField or ComplexField when loaded into\n        Sage.  These will be 64 bit numbers for ordinary Manifolds and\n        212 bit numbers for high precision manifolds.\n\n        The func argument should be a function which accepts a number and\n        returns a numerical type of your choosing.  Alternatively, the\n        strings 'sage' or 'snappy' can be passed as arguments to select\n        either of the two default behaviors.\n\n        EXAMPLE::\n\n            sage: M = Manifold('m004')\n            sage: R = M.volume().parent()\n            sage: R.name().startswith('RealField')\n            True\n            sage: from snappy.number import SnapPyNumbers\n            sage: Manifold.use_field_conversion('snappy')\n            sage: M = Manifold('m004')\n            sage: R = M.volume().parent()\n            sage: isinstance(R, SnapPyNumbers)\n            True\n            sage: Manifold.use_field_conversion('sage')\n            sage: M = Manifold('m004')\n            sage: R = M.volume().parent()\n            sage: ""R.name().startswith('RealField')\n            True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_5use_field_conversion = {"use_field_conversion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_5use_field_conversion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_4use_field_conversion};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_5use_field_conversion(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_func = 0;
  #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("use_field_conversion (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_func_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 89, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 89, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "use_field_conversion", 0) < 0) __PYX_ERR(2, 89, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("use_field_conversion", 1, 1, 1, i); __PYX_ERR(2, 89, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 89, __pyx_L3_error)
    }
    __pyx_v_func = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("use_field_conversion", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 89, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.use_field_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_4use_field_conversion(((PyTypeObject*)__pyx_v_cls), __pyx_v_func);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_4use_field_conversion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("use_field_conversion", 0);

  /* "cython/core/manifold.pyx":135
 *             True
 *         """
 *         number.use_field_conversion(func)             # <<<<<<<<<<<<<<
 * 
 *     def init_hyperbolic_structure(self, force_recompute = False):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_use_field_conversion); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_func};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":89
 *         return number.number_to_native_number(n)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def use_field_conversion(cls, func):
 *         """
*/

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

/* "cython/core/manifold.pyx":137
 *         number.use_field_conversion(func)
 * 
 *     def init_hyperbolic_structure(self, force_recompute = False):             # <<<<<<<<<<<<<<
 *         if not self.c_triangulation:
 *             return
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_7init_hyperbolic_structure(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_7init_hyperbolic_structure = {"init_hyperbolic_structure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_7init_hyperbolic_structure, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_7init_hyperbolic_structure(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_force_recompute = 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("init_hyperbolic_structure (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_force_recompute,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 137, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "init_hyperbolic_structure", 0) < 0) __PYX_ERR(2, 137, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_force_recompute = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init_hyperbolic_structure", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 137, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.init_hyperbolic_structure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_6init_hyperbolic_structure(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_force_recompute);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_6init_hyperbolic_structure(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_force_recompute) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_hyperbolic_structure", 0);

  /* "cython/core/manifold.pyx":138
 * 
 *     def init_hyperbolic_structure(self, force_recompute = False):
 *         if not self.c_triangulation:             # <<<<<<<<<<<<<<
 *             return
 *         if self.hyperbolic_structure_initialized and not force_recompute:
*/
  __pyx_t_1 = (!(__pyx_v_self->__pyx_base.c_triangulation != 0));
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":139
 *     def init_hyperbolic_structure(self, force_recompute = False):
 *         if not self.c_triangulation:
 *             return             # <<<<<<<<<<<<<<
 *         if self.hyperbolic_structure_initialized and not force_recompute:
 *             return
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":138
 * 
 *     def init_hyperbolic_structure(self, force_recompute = False):
 *         if not self.c_triangulation:             # <<<<<<<<<<<<<<
 *             return
 *         if self.hyperbolic_structure_initialized and not force_recompute:
*/
  }

  /* "cython/core/manifold.pyx":140
 *         if not self.c_triangulation:
 *             return
 *         if self.hyperbolic_structure_initialized and not force_recompute:             # <<<<<<<<<<<<<<
 *             return
 *         find_complete_hyperbolic_structure(self.c_triangulation)
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base.hyperbolic_structure_initialized); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 140, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_force_recompute); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 140, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":141
 *             return
 *         if self.hyperbolic_structure_initialized and not force_recompute:
 *             return             # <<<<<<<<<<<<<<
 *         find_complete_hyperbolic_structure(self.c_triangulation)
 *         do_Dehn_filling(self.c_triangulation)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":140
 *         if not self.c_triangulation:
 *             return
 *         if self.hyperbolic_structure_initialized and not force_recompute:             # <<<<<<<<<<<<<<
 *             return
 *         find_complete_hyperbolic_structure(self.c_triangulation)
*/
  }

  /* "cython/core/manifold.pyx":142
 *         if self.hyperbolic_structure_initialized and not force_recompute:
 *             return
 *         find_complete_hyperbolic_structure(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         do_Dehn_filling(self.c_triangulation)
 *         self.hyperbolic_structure_initialized = True
*/
  find_complete_hyperbolic_structure(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 142, __pyx_L1_error)

  /* "cython/core/manifold.pyx":143
 *             return
 *         find_complete_hyperbolic_structure(self.c_triangulation)
 *         do_Dehn_filling(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         self.hyperbolic_structure_initialized = True
 * 
*/
  do_Dehn_filling(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 143, __pyx_L1_error)

  /* "cython/core/manifold.pyx":144
 *         find_complete_hyperbolic_structure(self.c_triangulation)
 *         do_Dehn_filling(self.c_triangulation)
 *         self.hyperbolic_structure_initialized = True             # <<<<<<<<<<<<<<
 * 
 *     def canonize(self) -> None:
*/
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.hyperbolic_structure_initialized);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.hyperbolic_structure_initialized);
  __pyx_v_self->__pyx_base.hyperbolic_structure_initialized = Py_True;

  /* "cython/core/manifold.pyx":137
 *         number.use_field_conversion(func)
 * 
 *     def init_hyperbolic_structure(self, force_recompute = False):             # <<<<<<<<<<<<<<
 *         if not self.c_triangulation:
 *             return
*/

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

/* "cython/core/manifold.pyx":146
 *         self.hyperbolic_structure_initialized = True
 * 
 *     def canonize(self) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Change the triangulation to an arbitrary retriangulation of
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_9canonize(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_8SnapPyHP_8Manifold_8canonize, "\n        Change the triangulation to an arbitrary retriangulation of\n        the canonical cell decomposition. See\n        :py:meth:`canonical_retriangulation <snappy.Manifold.canonical_retriangulation>`\n        to get the actual canonical cell decomposition.\n\n        >>> M = Manifold('m007')\n        >>> M.num_tetrahedra()\n        3\n        >>> M.canonize()\n        >>> M.num_tetrahedra()\n        4\n\n        Note: Due to rounding error, it is possible that this is actually\n        not a retriangulation of the canonical cell decomposition.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_9canonize = {"canonize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_9canonize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_8canonize};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_9canonize(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("canonize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("canonize", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("canonize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_8canonize(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_8canonize(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  FuncResult __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  FuncResult __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("canonize", 0);

  /* "cython/core/manifold.pyx":164
 *         """
 *         cdef c_FuncResult result
 *         result = proto_canonize(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if FuncResult[result] != 'func_OK':
 *             raise RuntimeError('SnapPea failed to find the canonical '
*/
  __pyx_t_1 = proto_canonize(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 164, __pyx_L1_error)
  __pyx_v_result = __pyx_t_1;

  /* "cython/core/manifold.pyx":165
 *         cdef c_FuncResult result
 *         result = proto_canonize(self.c_triangulation)
 *         if FuncResult[result] != 'func_OK':             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea failed to find the canonical '
 *                                'triangulation.')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FuncResult); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 165, __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_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_func_OK, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/manifold.pyx":166
 *         result = proto_canonize(self.c_triangulation)
 *         if FuncResult[result] != 'func_OK':
 *             raise RuntimeError('SnapPea failed to find the canonical '             # <<<<<<<<<<<<<<
 *                                'triangulation.')
 *         self._cache.clear(message='canonize')
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_2 = __pyx_builtin_RuntimeError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_SnapPea_failed_to_find_the_canon};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(2, 166, __pyx_L1_error)

    /* "cython/core/manifold.pyx":165
 *         cdef c_FuncResult result
 *         result = proto_canonize(self.c_triangulation)
 *         if FuncResult[result] != 'func_OK':             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea failed to find the canonical '
 *                                'triangulation.')
*/
  }

  /* "cython/core/manifold.pyx":168
 *             raise RuntimeError('SnapPea failed to find the canonical '
 *                                'triangulation.')
 *         self._cache.clear(message='canonize')             # <<<<<<<<<<<<<<
 * 
 *     def _canonical_retriangulation(self, opacities=None, top_level_tries=10):
*/
  __pyx_t_2 = __pyx_v_self->__pyx_base._cache;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_n_u_canonize, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 168, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":146
 *         self.hyperbolic_structure_initialized = True
 * 
 *     def canonize(self) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Change the triangulation to an arbitrary retriangulation of
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Manifold.canonize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":170
 *         self._cache.clear(message='canonize')
 * 
 *     def _canonical_retriangulation(self, opacities=None, top_level_tries=10):             # <<<<<<<<<<<<<<
 *         """
 *         If this triangulation is a subdivision of the canonical cell
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_11_canonical_retriangulation(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_8SnapPyHP_8Manifold_10_canonical_retriangulation, "\n        If this triangulation is a subdivision of the canonical cell\n        decomposition, return the canonical retriangulation as Triangulation.\n\n        Warning: Many operations on a SnapPy Triangulation will remove the\n        finite vertices or change the triangulation so it is no longer the\n        canonical retriangulation.\n        By default, the algorithm numerically checks that the tilts are close\n        to zero to determine which faces are opaque or transparent.\n        But it can also be passed an explicit list of 4 * num_tetrahedra bool's\n        (one per face of each tet) that mark the opaque faces.\n\n        For example, m412's canonical cell decomposition consists of a single\n        cube. The canonical retriangulation thus has 12 simplices.\n\n        >>> M = Manifold(\"m412\")\n\n        Some isometries of M are not visible in this triangulation (not\n        even after calling M.canonize())\n\n        >>> len(M.isomorphisms_to(M))\n        4\n        >>> T = M._canonical_retriangulation()\n        >>> T.num_tetrahedra()\n        12\n\n        But all isometries of M are visible in its canonical retriangulation.\n\n        >>> len(T.isomorphisms_to(T))\n        8\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_11_canonical_retriangulation = {"_canonical_retriangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_11_canonical_retriangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_10_canonical_retriangulation};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_11_canonical_retriangulation(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_opacities = 0;
  PyObject *__pyx_v_top_level_tries = 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("_canonical_retriangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_opacities,&__pyx_mstate_global->__pyx_n_u_top_level_tries,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 170, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_canonical_retriangulation", 0) < 0) __PYX_ERR(2, 170, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_10));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_10));
    }
    __pyx_v_opacities = values[0];
    __pyx_v_top_level_tries = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_canonical_retriangulation", 0, 0, 2, __pyx_nargs); __PYX_ERR(2, 170, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._canonical_retriangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_10_canonical_retriangulation(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_opacities, __pyx_v_top_level_tries);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_10_canonical_retriangulation(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_opacities, PyObject *__pyx_v_top_level_tries) {
  Boolean *__pyx_v_c_opacities;
  Triangulation *__pyx_v_c_retriangulated_triangulation;
  int __pyx_v_n;
  PyObject *__pyx_v_result = 0;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_new_tri = 0;
  PyObject *__pyx_v_i = NULL;
  int __pyx_v_success;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Boolean __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  FuncResult __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_canonical_retriangulation", 0);

  /* "cython/core/manifold.pyx":206
 *         cdef Boolean *c_opacities
 *         cdef c_Triangulation *c_retriangulated_triangulation
 *         cdef int n = get_num_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         cdef result
 *         cdef Triangulation new_tri
*/
  __pyx_t_1 = get_num_tetrahedra(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 206, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "cython/core/manifold.pyx":210
 *         cdef Triangulation new_tri
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return ""
 * 
*/
  __pyx_t_2 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_2) {

    /* "cython/core/manifold.pyx":211
 * 
 *         if self.c_triangulation is NULL:
 *             return ""             # <<<<<<<<<<<<<<
 * 
 *         if opacities:
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10);
    __pyx_r = __pyx_mstate_global->__pyx_kp_u__10;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":210
 *         cdef Triangulation new_tri
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return ""
 * 
*/
  }

  /* "cython/core/manifold.pyx":213
 *             return ""
 * 
 *         if opacities:             # <<<<<<<<<<<<<<
 *             if not len(opacities) == 4 * n:
 *                 raise Exception("Number of opacities does not match.")
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opacities); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 213, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/manifold.pyx":214
 * 
 *         if opacities:
 *             if not len(opacities) == 4 * n:             # <<<<<<<<<<<<<<
 *                 raise Exception("Number of opacities does not match.")
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))
*/
    __pyx_t_3 = PyObject_Length(__pyx_v_opacities); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 214, __pyx_L1_error)
    __pyx_t_2 = (!(__pyx_t_3 == (4 * __pyx_v_n)));
    if (unlikely(__pyx_t_2)) {

      /* "cython/core/manifold.pyx":215
 *         if opacities:
 *             if not len(opacities) == 4 * n:
 *                 raise Exception("Number of opacities does not match.")             # <<<<<<<<<<<<<<
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))
 *             for i in range(4 * n):
*/
      __pyx_t_5 = NULL;
      __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception)));
      __pyx_t_6 = ((PyObject *)(((PyTypeObject*)PyExc_Exception))); 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Number_of_opacities_does_not_mat};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __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(2, 215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(2, 215, __pyx_L1_error)

      /* "cython/core/manifold.pyx":214
 * 
 *         if opacities:
 *             if not len(opacities) == 4 * n:             # <<<<<<<<<<<<<<
 *                 raise Exception("Number of opacities does not match.")
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))
*/
    }

    /* "cython/core/manifold.pyx":216
 *             if not len(opacities) == 4 * n:
 *                 raise Exception("Number of opacities does not match.")
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))             # <<<<<<<<<<<<<<
 *             for i in range(4 * n):
 *                 c_opacities[i] = 1 if opacities[i] else 0
*/
    __pyx_v_c_opacities = ((Boolean *)malloc(((__pyx_v_n * 4) * (sizeof(Boolean)))));

    /* "cython/core/manifold.pyx":217
 *                 raise Exception("Number of opacities does not match.")
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))
 *             for i in range(4 * n):             # <<<<<<<<<<<<<<
 *                 c_opacities[i] = 1 if opacities[i] else 0
 *             copy_triangulation(self.c_triangulation,
*/
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_5 = __pyx_builtin_range; 
    __pyx_t_8 = __Pyx_PyLong_From_long((4 * __pyx_v_n)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 217, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 217, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 217, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 217, __pyx_L1_error)
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 217, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":218
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))
 *             for i in range(4 * n):
 *                 c_opacities[i] = 1 if opacities[i] else 0             # <<<<<<<<<<<<<<
 *             copy_triangulation(self.c_triangulation,
 *                                &c_retriangulated_triangulation)
*/
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_opacities, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {
        __pyx_t_10 = 1;
      } else {
        __pyx_t_10 = 0;
      }
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 218, __pyx_L1_error)
      (__pyx_v_c_opacities[__pyx_t_11]) = __pyx_t_10;

      /* "cython/core/manifold.pyx":217
 *                 raise Exception("Number of opacities does not match.")
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))
 *             for i in range(4 * n):             # <<<<<<<<<<<<<<
 *                 c_opacities[i] = 1 if opacities[i] else 0
 *             copy_triangulation(self.c_triangulation,
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":219
 *             for i in range(4 * n):
 *                 c_opacities[i] = 1 if opacities[i] else 0
 *             copy_triangulation(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                &c_retriangulated_triangulation)
 *         else:
*/
    copy_triangulation(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_c_retriangulated_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 219, __pyx_L1_error)

    /* "cython/core/manifold.pyx":213
 *             return ""
 * 
 *         if opacities:             # <<<<<<<<<<<<<<
 *             if not len(opacities) == 4 * n:
 *                 raise Exception("Number of opacities does not match.")
*/
    goto __pyx_L4;
  }

  /* "cython/core/manifold.pyx":222
 *                                &c_retriangulated_triangulation)
 *         else:
 *             success = False             # <<<<<<<<<<<<<<
 *             for i in range(top_level_tries):
 *                 c_opacities = NULL
*/
  /*else*/ {
    __pyx_v_success = 0;

    /* "cython/core/manifold.pyx":223
 *         else:
 *             success = False
 *             for i in range(top_level_tries):             # <<<<<<<<<<<<<<
 *                 c_opacities = NULL
 *                 copy_triangulation(self.c_triangulation,
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_8 = __pyx_builtin_range; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_top_level_tries};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_8 = __pyx_t_5; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_3 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 223, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 223, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 223, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 223, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_9(__pyx_t_8);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 223, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/manifold.pyx":224
 *             success = False
 *             for i in range(top_level_tries):
 *                 c_opacities = NULL             # <<<<<<<<<<<<<<
 *                 copy_triangulation(self.c_triangulation,
 *                                    &c_retriangulated_triangulation)
*/
      __pyx_v_c_opacities = NULL;

      /* "cython/core/manifold.pyx":225
 *             for i in range(top_level_tries):
 *                 c_opacities = NULL
 *                 copy_triangulation(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                    &c_retriangulated_triangulation)
 *                 result = proto_canonize(c_retriangulated_triangulation)
*/
      copy_triangulation(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_c_retriangulated_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 225, __pyx_L1_error)

      /* "cython/core/manifold.pyx":227
 *                 copy_triangulation(self.c_triangulation,
 *                                    &c_retriangulated_triangulation)
 *                 result = proto_canonize(c_retriangulated_triangulation)             # <<<<<<<<<<<<<<
 *                 if FuncResult[result] == 'func_OK':
 *                     success = True
*/
      __pyx_t_12 = proto_canonize(__pyx_v_c_retriangulated_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 227, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyLong_From_FuncResult(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/manifold.pyx":228
 *                                    &c_retriangulated_triangulation)
 *                 result = proto_canonize(c_retriangulated_triangulation)
 *                 if FuncResult[result] == 'func_OK':             # <<<<<<<<<<<<<<
 *                     success = True
 *                     break
*/
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FuncResult); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_func_OK, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 228, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {

        /* "cython/core/manifold.pyx":229
 *                 result = proto_canonize(c_retriangulated_triangulation)
 *                 if FuncResult[result] == 'func_OK':
 *                     success = True             # <<<<<<<<<<<<<<
 *                     break
 *                 else:
*/
        __pyx_v_success = 1;

        /* "cython/core/manifold.pyx":230
 *                 if FuncResult[result] == 'func_OK':
 *                     success = True
 *                     break             # <<<<<<<<<<<<<<
 *                 else:
 *                     free_triangulation(c_retriangulated_triangulation)
*/
        goto __pyx_L10_break;

        /* "cython/core/manifold.pyx":228
 *                                    &c_retriangulated_triangulation)
 *                 result = proto_canonize(c_retriangulated_triangulation)
 *                 if FuncResult[result] == 'func_OK':             # <<<<<<<<<<<<<<
 *                     success = True
 *                     break
*/
      }

      /* "cython/core/manifold.pyx":232
 *                     break
 *                 else:
 *                     free_triangulation(c_retriangulated_triangulation)             # <<<<<<<<<<<<<<
 * 
 *             if not success:
*/
      /*else*/ {
        free_triangulation(__pyx_v_c_retriangulated_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 232, __pyx_L1_error)
      }

      /* "cython/core/manifold.pyx":223
 *         else:
 *             success = False
 *             for i in range(top_level_tries):             # <<<<<<<<<<<<<<
 *                 c_opacities = NULL
 *                 copy_triangulation(self.c_triangulation,
*/
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L12_for_end;
    __pyx_L10_break:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L12_for_end;
    __pyx_L12_for_end:;

    /* "cython/core/manifold.pyx":234
 *                     free_triangulation(c_retriangulated_triangulation)
 * 
 *             if not success:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('SnapPea failed to find the canonical '
 *                                    'triangulation.')
*/
    __pyx_t_2 = (!__pyx_v_success);
    if (unlikely(__pyx_t_2)) {

      /* "cython/core/manifold.pyx":235
 * 
 *             if not success:
 *                 raise RuntimeError('SnapPea failed to find the canonical '             # <<<<<<<<<<<<<<
 *                                    'triangulation.')
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_RuntimeError);
      __pyx_t_5 = __pyx_builtin_RuntimeError; 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_SnapPea_failed_to_find_the_canon};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 235, __pyx_L1_error)

      /* "cython/core/manifold.pyx":234
 *                     free_triangulation(c_retriangulated_triangulation)
 * 
 *             if not success:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('SnapPea failed to find the canonical '
 *                                    'triangulation.')
*/
    }
  }
  __pyx_L4:;

  /* "cython/core/manifold.pyx":238
 *                                    'triangulation.')
 * 
 *         canonical_retriangulation_with_opacities(             # <<<<<<<<<<<<<<
 *                 c_retriangulated_triangulation, c_opacities)
 * 
*/
  canonical_retriangulation_with_opacities(__pyx_v_c_retriangulated_triangulation, __pyx_v_c_opacities); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 238, __pyx_L1_error)

  /* "cython/core/manifold.pyx":241
 *                 c_retriangulated_triangulation, c_opacities)
 * 
 *         free(c_opacities)             # <<<<<<<<<<<<<<
 * 
 *         new_tri = _triangulation_class('empty')
*/
  free(__pyx_v_c_opacities);

  /* "cython/core/manifold.pyx":243
 *         free(c_opacities)
 * 
 *         new_tri = _triangulation_class('empty')             # <<<<<<<<<<<<<<
 *         new_tri.set_c_triangulation(c_retriangulated_triangulation)
 *         new_tri.set_name(self.name() + '_canonical')
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_triangulation_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(2, 243, __pyx_L1_error)
  __pyx_v_new_tri = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "cython/core/manifold.pyx":244
 * 
 *         new_tri = _triangulation_class('empty')
 *         new_tri.set_c_triangulation(c_retriangulated_triangulation)             # <<<<<<<<<<<<<<
 *         new_tri.set_name(self.name() + '_canonical')
 * 
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_new_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_new_tri, __pyx_v_c_retriangulated_triangulation); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/manifold.pyx":245
 *         new_tri = _triangulation_class('empty')
 *         new_tri.set_c_triangulation(c_retriangulated_triangulation)
 *         new_tri.set_name(self.name() + '_canonical')             # <<<<<<<<<<<<<<
 * 
 *         return new_tri
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_new_tri);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_canonical); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/manifold.pyx":247
 *         new_tri.set_name(self.name() + '_canonical')
 * 
 *         return new_tri             # <<<<<<<<<<<<<<
 * 
 *     def _canonical_cells_are_tetrahedra(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_new_tri);
  __pyx_r = ((PyObject *)__pyx_v_new_tri);
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":170
 *         self._cache.clear(message='canonize')
 * 
 *     def _canonical_retriangulation(self, opacities=None, top_level_tries=10):             # <<<<<<<<<<<<<<
 *         """
 *         If this triangulation is a subdivision of the canonical cell
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.Manifold._canonical_retriangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_new_tri);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":249
 *         return new_tri
 * 
 *     def _canonical_cells_are_tetrahedra(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if and only if the canonical
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_13_canonical_cells_are_tetrahedra(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_8SnapPyHP_8Manifold_12_canonical_cells_are_tetrahedra, "\n        Returns True if and only if the canonical\n        cell decomposition is a triangulation.\n\n        >>> Manifold('K4a1')._canonical_cells_are_tetrahedra()\n        True\n        >>> Manifold('L6a4')._canonical_cells_are_tetrahedra()\n        False\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_13_canonical_cells_are_tetrahedra = {"_canonical_cells_are_tetrahedra", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_13_canonical_cells_are_tetrahedra, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_12_canonical_cells_are_tetrahedra};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_13_canonical_cells_are_tetrahedra(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("_canonical_cells_are_tetrahedra (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_canonical_cells_are_tetrahedra", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_canonical_cells_are_tetrahedra", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_12_canonical_cells_are_tetrahedra(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_12_canonical_cells_are_tetrahedra(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_canonical_cells_are_tetrahedra", 0);

  /* "cython/core/manifold.pyx":261
 * 
 *         cdef Manifold M
 *         M = self.copy()             # <<<<<<<<<<<<<<
 *         M.canonize()
 *         canonical_retriangulation(M.c_triangulation)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(2, 261, __pyx_L1_error)
  __pyx_v_M = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":262
 *         cdef Manifold M
 *         M = self.copy()
 *         M.canonize()             # <<<<<<<<<<<<<<
 *         canonical_retriangulation(M.c_triangulation)
 *         count_cusps(M.c_triangulation)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_M);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_canonize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":263
 *         M = self.copy()
 *         M.canonize()
 *         canonical_retriangulation(M.c_triangulation)             # <<<<<<<<<<<<<<
 *         count_cusps(M.c_triangulation)
 *         return get_num_fake_cusps(M.c_triangulation) == 0
*/
  canonical_retriangulation(__pyx_v_M->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 263, __pyx_L1_error)

  /* "cython/core/manifold.pyx":264
 *         M.canonize()
 *         canonical_retriangulation(M.c_triangulation)
 *         count_cusps(M.c_triangulation)             # <<<<<<<<<<<<<<
 *         return get_num_fake_cusps(M.c_triangulation) == 0
 * 
*/
  count_cusps(__pyx_v_M->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":265
 *         canonical_retriangulation(M.c_triangulation)
 *         count_cusps(M.c_triangulation)
 *         return get_num_fake_cusps(M.c_triangulation) == 0             # <<<<<<<<<<<<<<
 * 
 *     def _from_string(self, string, initialize_structure=True):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = get_num_fake_cusps(__pyx_v_M->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 265, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_4 == 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":249
 *         return new_tri
 * 
 *     def _canonical_cells_are_tetrahedra(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if and only if the canonical
*/

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

/* "cython/core/manifold.pyx":267
 *         return get_num_fake_cusps(M.c_triangulation) == 0
 * 
 *     def _from_string(self, string, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To create a
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_15_from_string(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_8SnapPyHP_8Manifold_14_from_string, "\n        WARNING: Users should not use this function directly.  To create a\n        Manifold or ManifoldHP from a string containing the contents\n        of a triangulation file, simply do:\n\n        >>> M = Manifold('7_4')\n        >>> seed = M._to_string()\n        >>> N = Manifold(seed)\n        >>> N.volume() # doctest: +NUMERIC6\n        5.13794120\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_15_from_string = {"_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_15_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_14_from_string};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_15_from_string(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_string = 0;
  PyObject *__pyx_v_initialize_structure = 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_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_string,&__pyx_mstate_global->__pyx_n_u_initialize_structure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 267, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_from_string", 0) < 0) __PYX_ERR(2, 267, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_string", 0, 1, 2, i); __PYX_ERR(2, 267, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 267, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_string = values[0];
    __pyx_v_initialize_structure = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_string", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 267, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_14_from_string(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_string, __pyx_v_initialize_structure);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_14_from_string(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_initialize_structure) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_string", 0);

  /* "cython/core/manifold.pyx":279
 *         5.13794120
 *         """
 *         Triangulation._from_string(self, string)             # <<<<<<<<<<<<<<
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_string};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_string, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":280
 *         """
 *         Triangulation._from_string(self, string)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_initialize_structure); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 280, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":281
 *         Triangulation._from_string(self, string)
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 *     def _from_bytes(self, bytestring, initialize_structure=True):
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init_hyperbolic_structure, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":280
 *         """
 *         Triangulation._from_string(self, string)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
*/
  }

  /* "cython/core/manifold.pyx":267
 *         return get_num_fake_cusps(M.c_triangulation) == 0
 * 
 *     def _from_string(self, string, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To create a
*/

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

/* "cython/core/manifold.pyx":283
 *             self.init_hyperbolic_structure()
 * 
 *     def _from_bytes(self, bytestring, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty manifold from a byte sequence generated by
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_17_from_bytes(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_8SnapPyHP_8Manifold_16_from_bytes, "\n        Fill an empty manifold from a byte sequence generated by\n        _to_bytes.\n        >>> M = Manifold('m125')\n        >>> N = Manifold('empty')\n        >>> N._from_bytes(M._to_bytes())\n        >>> N.is_isometric_to(M)\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_17_from_bytes = {"_from_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_17_from_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_16_from_bytes};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_17_from_bytes(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_bytestring = 0;
  PyObject *__pyx_v_initialize_structure = 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_bytes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bytestring,&__pyx_mstate_global->__pyx_n_u_initialize_structure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 283, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_from_bytes", 0) < 0) __PYX_ERR(2, 283, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_bytes", 0, 1, 2, i); __PYX_ERR(2, 283, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 283, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_bytestring = values[0];
    __pyx_v_initialize_structure = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_bytes", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 283, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_16_from_bytes(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_bytestring, __pyx_v_initialize_structure);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_16_from_bytes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_bytestring, PyObject *__pyx_v_initialize_structure) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_bytes", 0);

  /* "cython/core/manifold.pyx":293
 *         True
 *         """
 *         Triangulation._from_bytes(self, bytestring)             # <<<<<<<<<<<<<<
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_bytestring};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_bytes, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":294
 *         """
 *         Triangulation._from_bytes(self, bytestring)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_initialize_structure); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 294, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":295
 *         Triangulation._from_bytes(self, bytestring)
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 *     def _from_isosig(self, isosig, initialize_structure=True):
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init_hyperbolic_structure, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":294
 *         """
 *         Triangulation._from_bytes(self, bytestring)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
*/
  }

  /* "cython/core/manifold.pyx":283
 *             self.init_hyperbolic_structure()
 * 
 *     def _from_bytes(self, bytestring, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty manifold from a byte sequence generated by
*/

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

/* "cython/core/manifold.pyx":297
 *             self.init_hyperbolic_structure()
 * 
 *     def _from_isosig(self, isosig, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty manifold from an isosig generated by
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_19_from_isosig(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_8SnapPyHP_8Manifold_18_from_isosig, "\n        Fill an empty manifold from an isosig generated by\n        triangulation_isosig.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_19_from_isosig = {"_from_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_19_from_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_18_from_isosig};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_19_from_isosig(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_isosig = 0;
  PyObject *__pyx_v_initialize_structure = 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_isosig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isosig,&__pyx_mstate_global->__pyx_n_u_initialize_structure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 297, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_from_isosig", 0) < 0) __PYX_ERR(2, 297, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_from_isosig", 0, 1, 2, i); __PYX_ERR(2, 297, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 297, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_isosig = values[0];
    __pyx_v_initialize_structure = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_isosig", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 297, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._from_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_18_from_isosig(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_isosig, __pyx_v_initialize_structure);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_18_from_isosig(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_isosig, PyObject *__pyx_v_initialize_structure) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_isosig", 0);

  /* "cython/core/manifold.pyx":302
 *         triangulation_isosig.
 *         """
 *         Triangulation._from_isosig(self, isosig)             # <<<<<<<<<<<<<<
 *         if self.c_triangulation == NULL:
 *             return
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_isosig};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_isosig, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":303
 *         """
 *         Triangulation._from_isosig(self, isosig)
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 *         if initialize_structure:
*/
  __pyx_t_4 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":304
 *         Triangulation._from_isosig(self, isosig)
 *         if self.c_triangulation == NULL:
 *             return             # <<<<<<<<<<<<<<
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":303
 *         """
 *         Triangulation._from_isosig(self, isosig)
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 *         if initialize_structure:
*/
  }

  /* "cython/core/manifold.pyx":305
 *         if self.c_triangulation == NULL:
 *             return
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_initialize_structure); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 305, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":306
 *             return
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init_hyperbolic_structure, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":305
 *         if self.c_triangulation == NULL:
 *             return
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
*/
  }

  /* "cython/core/manifold.pyx":297
 *             self.init_hyperbolic_structure()
 * 
 *     def _from_isosig(self, isosig, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty manifold from an isosig generated by
*/

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

/* "cython/core/manifold.pyx":308
 *             self.init_hyperbolic_structure()
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the manifold
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_21copy(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_8SnapPyHP_8Manifold_20copy, "\n        Returns a copy of the manifold\n\n        >>> M = Manifold('m015')\n        >>> N = M.copy()\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_21copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_21copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_20copy};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_21copy(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("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_20copy(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_20copy(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  PyObject *__pyx_v_empty = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  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);

  /* "cython/core/manifold.pyx":315
 *         >>> N = M.copy()
 *         """
 *         empty = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             return empty
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_empty = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":316
 *         """
 *         empty = self.__class__('empty')
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return empty
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
*/
  __pyx_t_4 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":317
 *         empty = self.__class__('empty')
 *         if self.c_triangulation is NULL:
 *             return empty             # <<<<<<<<<<<<<<
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_empty);
    __pyx_r = __pyx_v_empty;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":316
 *         """
 *         empty = self.__class__('empty')
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return empty
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
*/
  }

  /* "cython/core/manifold.pyx":318
 *         if self.c_triangulation is NULL:
 *             return empty
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     def cusp_neighborhood(self) -> CuspNeighborhood:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Manifold_from_Triangulation); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_manifold_class_2, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(2, 318, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":308
 *             self.init_hyperbolic_structure()
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the manifold
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Manifold.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_empty);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":320
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
 * 
 *     def cusp_neighborhood(self) -> CuspNeighborhood:             # <<<<<<<<<<<<<<
 *         """
 *         Returns information about the cusp neighborhoods of the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_23cusp_neighborhood(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_8SnapPyHP_8Manifold_22cusp_neighborhood, "\n        Returns information about the cusp neighborhoods of the\n        manifold, in the form of data about the corresponding horoball\n        diagrams in hyperbolic 3-space.\n\n        >>> M = Manifold('s000')\n        >>> CN = M.cusp_neighborhood()\n        >>> CN.volume() # doctest: +NUMERIC6\n        0.32475953\n        >>> len(CN.horoballs(0.01))\n        178\n        >>> CN.view()  # Opens picture of the horoballs  #doctest: +CYOPENGL\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_23cusp_neighborhood = {"cusp_neighborhood", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_23cusp_neighborhood, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_22cusp_neighborhood};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_23cusp_neighborhood(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("cusp_neighborhood (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("cusp_neighborhood", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("cusp_neighborhood", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_22cusp_neighborhood(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_22cusp_neighborhood(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cusp_neighborhood", 0);

  /* "cython/core/manifold.pyx":334
 *         >>> CN.view()  # Opens picture of the horoballs  #doctest: +CYOPENGL
 *         """
 *         return CuspNeighborhood(self)             # <<<<<<<<<<<<<<
 * 
 *     def dirichlet_domain(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CuspNeighborhood); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":320
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
 * 
 *     def cusp_neighborhood(self) -> CuspNeighborhood:             # <<<<<<<<<<<<<<
 *         """
 *         Returns information about the cusp neighborhoods of the
*/

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

/* "cython/core/manifold.pyx":336
 *         return CuspNeighborhood(self)
 * 
 *     def dirichlet_domain(self,             # <<<<<<<<<<<<<<
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_25dirichlet_domain(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_8SnapPyHP_8Manifold_24dirichlet_domain, "\n        Returns a :class:`DirichletDomain` object representing a Dirichlet\n        domain of the hyperbolic manifold, typically centered at a\n        point which is a local maximum of injectivity radius.  It will\n        have ideal vertices if the manifold is not closed.\n\n        >>> M = Manifold('m015')\n        >>> D = M.dirichlet_domain()\n        >>> D\n        32 finite vertices, 2 ideal vertices; 54 edges; 22 faces\n        >>> D.view()   #Shows 3d-graphical view.  #doctest: +CYOPENGL\n\n        The group elements for the face-pairings of the Dirichlet domain\n        can be given as words in the original generators of the\n        (unsimplified) fundamental group by setting :attr:`include_words = True`:\n\n        >>> sorted(M.dirichlet_domain(include_words = True).pairing_words()) #doctest: +ELLIPSIS\n        ['A', ...]\n\n        Other options can be provided to customize the computation;\n        the default choices are shown below:\n\n        >>> M.dirichlet_domain(vertex_epsilon=10.0**-8,\n        ...    displacement = [0.0, 0.0, 0.0],\n        ...    centroid_at_origin=True, maximize_injectivity_radius=True)\n        32 finite vertices, 2 ideal vertices; 54 edges; 22 faces\n\n        Here's one with different combinatorics:\n\n        >>> E = M.dirichlet_domain(displacement=[0.5, 0.3, -0.2],\n        ...                        maximize_injectivity_radius=False)\n        >>> E\n        44 finite vertices, 1 ideal vertices; 69 edges; 26 faces\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_25dirichlet_domain = {"dirichlet_domain", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_25dirichlet_domain, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_24dirichlet_domain};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_25dirichlet_domain(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_vertex_epsilon = 0;
  PyObject *__pyx_v_displacement = 0;
  PyObject *__pyx_v_centroid_at_origin = 0;
  PyObject *__pyx_v_maximize_injectivity_radius = 0;
  PyObject *__pyx_v_include_words = 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("dirichlet_domain (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vertex_epsilon,&__pyx_mstate_global->__pyx_n_u_displacement,&__pyx_mstate_global->__pyx_n_u_centroid_at_origin,&__pyx_mstate_global->__pyx_n_u_maximize_injectivity_radius,&__pyx_mstate_global->__pyx_n_u_include_words,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 336, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dirichlet_domain", 0) < 0) __PYX_ERR(2, 336, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__29);

      /* "cython/core/manifold.pyx":338
 *     def dirichlet_domain(self,
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),             # <<<<<<<<<<<<<<
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[18]));

      /* "cython/core/manifold.pyx":339
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin : bool = True,             # <<<<<<<<<<<<<<
 *                          maximize_injectivity_radius : bool = True,
 *                          include_words : bool = False) -> DirichletDomain:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":340
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,             # <<<<<<<<<<<<<<
 *                          include_words : bool = False) -> DirichletDomain:
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":341
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,
 *                          include_words : bool = False) -> DirichletDomain:             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`DirichletDomain` object representing a Dirichlet
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__29);

      /* "cython/core/manifold.pyx":338
 *     def dirichlet_domain(self,
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),             # <<<<<<<<<<<<<<
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[18]));

      /* "cython/core/manifold.pyx":339
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin : bool = True,             # <<<<<<<<<<<<<<
 *                          maximize_injectivity_radius : bool = True,
 *                          include_words : bool = False) -> DirichletDomain:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":340
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,             # <<<<<<<<<<<<<<
 *                          include_words : bool = False) -> DirichletDomain:
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":341
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,
 *                          include_words : bool = False) -> DirichletDomain:             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`DirichletDomain` object representing a Dirichlet
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_vertex_epsilon = values[0];
    __pyx_v_displacement = values[1];
    __pyx_v_centroid_at_origin = values[2];
    __pyx_v_maximize_injectivity_radius = values[3];
    __pyx_v_include_words = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dirichlet_domain", 0, 0, 5, __pyx_nargs); __PYX_ERR(2, 336, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.dirichlet_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_24dirichlet_domain(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_vertex_epsilon, __pyx_v_displacement, __pyx_v_centroid_at_origin, __pyx_v_maximize_injectivity_radius, __pyx_v_include_words);

  /* "cython/core/manifold.pyx":336
 *         return CuspNeighborhood(self)
 * 
 *     def dirichlet_domain(self,             # <<<<<<<<<<<<<<
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_24dirichlet_domain(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_vertex_epsilon, PyObject *__pyx_v_displacement, PyObject *__pyx_v_centroid_at_origin, PyObject *__pyx_v_maximize_injectivity_radius, PyObject *__pyx_v_include_words) {
  PyObject *__pyx_v_args = 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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dirichlet_domain", 0);

  /* "cython/core/manifold.pyx":376
 *         44 finite vertices, 1 ideal vertices; 69 edges; 26 faces
 *         """
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,             # <<<<<<<<<<<<<<
 *                 maximize_injectivity_radius, include_words)
 *         try:
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_displacement); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/manifold.pyx":377
 *         """
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius, include_words)             # <<<<<<<<<<<<<<
 *         try:
 *             return self._cache.lookup('dirichlet_domain', *args)
*/
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_vertex_epsilon);
  __Pyx_GIVEREF(__pyx_v_vertex_epsilon);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vertex_epsilon) != (0)) __PYX_ERR(2, 376, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(2, 376, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_centroid_at_origin);
  __Pyx_GIVEREF(__pyx_v_centroid_at_origin);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_centroid_at_origin) != (0)) __PYX_ERR(2, 376, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_maximize_injectivity_radius);
  __Pyx_GIVEREF(__pyx_v_maximize_injectivity_radius);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_maximize_injectivity_radius) != (0)) __PYX_ERR(2, 376, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_include_words);
  __Pyx_GIVEREF(__pyx_v_include_words);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_include_words) != (0)) __PYX_ERR(2, 376, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":378
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius, include_words)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('dirichlet_domain', *args)
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/manifold.pyx":379
 *                 maximize_injectivity_radius, include_words)
 *         try:
 *             return self._cache.lookup('dirichlet_domain', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 379, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_Add(__pyx_mstate_global->__pyx_tuple[19], __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 379, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 379, __pyx_L3_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_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/manifold.pyx":378
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius, include_words)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('dirichlet_domain', *args)
 *         except KeyError:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":380
 *         try:
 *             return self._cache.lookup('dirichlet_domain', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "cython/core/manifold.pyx":378
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius, include_words)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('dirichlet_domain', *args)
 *         except KeyError:
*/
    __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_L7_try_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_L4_exception_handled:;
    __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);
  }

  /* "cython/core/manifold.pyx":383
 *             pass
 * 
 *         return self._cache.save(DirichletDomain(self, *args),             # <<<<<<<<<<<<<<
 *                                 'dirichlet_domain', *args)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_mstate_global->__pyx_n_u_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_DirichletDomain); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(2, 383, __pyx_L1_error);
  __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2) != (0)) __PYX_ERR(2, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dirichlet_domain);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dirichlet_domain);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_n_u_dirichlet_domain) != (0)) __PYX_ERR(2, 383, __pyx_L1_error);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":384
 * 
 *         return self._cache.save(DirichletDomain(self, *args),
 *                                 'dirichlet_domain', *args)             # <<<<<<<<<<<<<<
 * 
 *     def browse(self):
*/
  __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/manifold.pyx":383
 *             pass
 * 
 *         return self._cache.save(DirichletDomain(self, *args),             # <<<<<<<<<<<<<<
 *                                 'dirichlet_domain', *args)
 * 
*/
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":336
 *         return CuspNeighborhood(self)
 * 
 *     def dirichlet_domain(self,             # <<<<<<<<<<<<<<
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.Manifold.dirichlet_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":386
 *                                 'dirichlet_domain', *args)
 * 
 *     def browse(self):             # <<<<<<<<<<<<<<
 *         """
 *         Opens browser window with a graphical interface, which allows to
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_27browse(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_8SnapPyHP_8Manifold_26browse, "\n        Opens browser window with a graphical interface, which allows to\n        explore the manifold and interact with it.\n        This includes: invariants, Dirichlet domain, cusp neighborhoods,\n        inside view, symmetry, Dehn filling, drilling, etc.\n\n        >>> M = Manifold('m125')\n        >>> M.browse()  #doctest: +CYOPENGL\n\n        This does not work when using SnapPy in a Docker container.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_27browse = {"browse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_27browse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_26browse};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_27browse(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("browse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("browse", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("browse", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_26browse(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_26browse(struct __pyx_obj_8SnapPyHP_Manifold *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("browse", 0);

  /* "cython/core/manifold.pyx":398
 *         This does not work when using SnapPy in a Docker container.
 *         """
 *         if Browser is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")
 *         return Browser(self)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Browser); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/manifold.pyx":399
 *         """
 *         if Browser is None:
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")             # <<<<<<<<<<<<<<
 *         return Browser(self)
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_4 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Browser_not_imported_Tk_CyOpenGL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 399, __pyx_L1_error)

    /* "cython/core/manifold.pyx":398
 *         This does not work when using SnapPy in a Docker container.
 *         """
 *         if Browser is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")
 *         return Browser(self)
*/
  }

  /* "cython/core/manifold.pyx":400
 *         if Browser is None:
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")
 *         return Browser(self)             # <<<<<<<<<<<<<<
 * 
 *     def filled_triangulation(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Browser); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":386
 *                                 'dirichlet_domain', *args)
 * 
 *     def browse(self):             # <<<<<<<<<<<<<<
 *         """
 *         Opens browser window with a graphical interface, which allows to
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Manifold.browse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":402
 *         return Browser(self)
 * 
 *     def filled_triangulation(             # <<<<<<<<<<<<<<
 *             self, cusps_to_fill='all') -> 'snappy.Manifold':
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_29filled_triangulation(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_8SnapPyHP_8Manifold_28filled_triangulation, "\n        Return a new Manifold where the specified cusps have been\n        permanently filled in.\n\n        Filling all the cusps results in a Triangulation rather\n        than a Manifold, since SnapPea can't deal with hyperbolic\n        structures when there are no cusps.\n\n        Examples:\n\n        >>> M = Manifold('m125(1,2)(3,4)')\n        >>> N = M.filled_triangulation()\n        >>> N.num_cusps()\n        0\n\n        Filling cusps 0 and 2 :\n\n        >>> M = Manifold('v3227(1,2)(3,4)(5,6)')\n        >>> M.filled_triangulation([0,2])\n        v3227_filled(3,4)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_29filled_triangulation = {"filled_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_29filled_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_28filled_triangulation};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_29filled_triangulation(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_cusps_to_fill = 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("filled_triangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cusps_to_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 402, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 402, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "filled_triangulation", 0) < 0) __PYX_ERR(2, 402, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 402, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_all));
    }
    __pyx_v_cusps_to_fill = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filled_triangulation", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 402, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_28filled_triangulation(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_cusps_to_fill);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_28filled_triangulation(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_cusps_to_fill) {
  PyObject *__pyx_v_filled = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("filled_triangulation", 0);

  /* "cython/core/manifold.pyx":425
 *         v3227_filled(3,4)
 *         """
 *         filled = _triangulation_class.filled_triangulation(self, cusps_to_fill)             # <<<<<<<<<<<<<<
 *         if filled.num_cusps() == 0:
 *             return Triangulation_from_Manifold(filled)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_triangulation_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_filled_triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_cusps_to_fill};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_filled = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":426
 *         """
 *         filled = _triangulation_class.filled_triangulation(self, cusps_to_fill)
 *         if filled.num_cusps() == 0:             # <<<<<<<<<<<<<<
 *             return Triangulation_from_Manifold(filled)
 *         return filled
*/
  __pyx_t_4 = __pyx_v_filled;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":427
 *         filled = _triangulation_class.filled_triangulation(self, cusps_to_fill)
 *         if filled.num_cusps() == 0:
 *             return Triangulation_from_Manifold(filled)             # <<<<<<<<<<<<<<
 *         return filled
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Triangulation_from_Manifold); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filled};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":426
 *         """
 *         filled = _triangulation_class.filled_triangulation(self, cusps_to_fill)
 *         if filled.num_cusps() == 0:             # <<<<<<<<<<<<<<
 *             return Triangulation_from_Manifold(filled)
 *         return filled
*/
  }

  /* "cython/core/manifold.pyx":428
 *         if filled.num_cusps() == 0:
 *             return Triangulation_from_Manifold(filled)
 *         return filled             # <<<<<<<<<<<<<<
 * 
 *     def fundamental_group(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_filled);
  __pyx_r = __pyx_v_filled;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":402
 *         return Browser(self)
 * 
 *     def filled_triangulation(             # <<<<<<<<<<<<<<
 *             self, cusps_to_fill='all') -> 'snappy.Manifold':
 *         """
*/

  /* 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("SnapPyHP.Manifold.filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filled);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":430
 *         return filled
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_31fundamental_group(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_8SnapPyHP_8Manifold_30fundamental_group, "\n        Return a :class:`HolonomyGroup` representing the fundamental group of\n        the manifold, together with its holonomy representation.  If\n        integer Dehn surgery parameters have been set, then the\n        corresponding peripheral elements are killed.\n\n        >>> M = Manifold('m004')\n        >>> G = M.fundamental_group()\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaabABBAb\n        >>> G.peripheral_curves()\n        [('ab', 'aBAbABab')]\n        >>> G.SL2C('baaBA') # doctest: +NUMERIC6\n        [ 2.50000000 - 2.59807621*I -6.06217783 - 0.50000000*I]\n        [ 0.86602540 - 2.50000000*I -4.00000000 + 1.73205081*I]\n\n        There are three optional arguments all of which default to True:\n\n        - simplify_presentation\n        - fillings_may_affect_generators\n        - minimize_number_of_generators\n\n        >>> M.fundamental_group(False, False, False)\n        Generators:\n           a,b,c\n        Relators:\n           CbAcB\n           BacA\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_31fundamental_group = {"fundamental_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_31fundamental_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_30fundamental_group};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_31fundamental_group(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_simplify_presentation = 0;
  PyObject *__pyx_v_fillings_may_affect_generators = 0;
  PyObject *__pyx_v_minimize_number_of_generators = 0;
  PyObject *__pyx_v_try_hard_to_shorten_relators = 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("fundamental_group (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_simplify_presentation,&__pyx_mstate_global->__pyx_n_u_fillings_may_affect_generators,&__pyx_mstate_global->__pyx_n_u_minimize_number_of_generators,&__pyx_mstate_global->__pyx_n_u_try_hard_to_shorten_relators,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 430, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fundamental_group", 0) < 0) __PYX_ERR(2, 430, __pyx_L3_error)

      /* "cython/core/manifold.pyx":432
 *     def fundamental_group(
 *             self,
 *             simplify_presentation : bool = True,             # <<<<<<<<<<<<<<
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":433
 *             self,
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,             # <<<<<<<<<<<<<<
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":434
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,             # <<<<<<<<<<<<<<
 *             try_hard_to_shorten_relators : bool = True
 *         ) -> HolonomyGroup:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":435
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True             # <<<<<<<<<<<<<<
 *         ) -> HolonomyGroup:
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/manifold.pyx":432
 *     def fundamental_group(
 *             self,
 *             simplify_presentation : bool = True,             # <<<<<<<<<<<<<<
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":433
 *             self,
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,             # <<<<<<<<<<<<<<
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":434
 *             simplify_presentation : bool = True,
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,             # <<<<<<<<<<<<<<
 *             try_hard_to_shorten_relators : bool = True
 *         ) -> HolonomyGroup:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":435
 *             fillings_may_affect_generators : bool = True,
 *             minimize_number_of_generators : bool = True,
 *             try_hard_to_shorten_relators : bool = True             # <<<<<<<<<<<<<<
 *         ) -> HolonomyGroup:
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_simplify_presentation = values[0];
    __pyx_v_fillings_may_affect_generators = values[1];
    __pyx_v_minimize_number_of_generators = values[2];
    __pyx_v_try_hard_to_shorten_relators = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fundamental_group", 0, 0, 4, __pyx_nargs); __PYX_ERR(2, 430, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.fundamental_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_30fundamental_group(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_simplify_presentation, __pyx_v_fillings_may_affect_generators, __pyx_v_minimize_number_of_generators, __pyx_v_try_hard_to_shorten_relators);

  /* "cython/core/manifold.pyx":430
 *         return filled
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_30fundamental_group(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_simplify_presentation, PyObject *__pyx_v_fillings_may_affect_generators, PyObject *__pyx_v_minimize_number_of_generators, PyObject *__pyx_v_try_hard_to_shorten_relators) {
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fundamental_group", 0);

  /* "cython/core/manifold.pyx":469
 *            BacA
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":470
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         args = (simplify_presentation, fillings_may_affect_generators,
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 470, __pyx_L1_error)

    /* "cython/core/manifold.pyx":469
 *            BacA
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":472
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         args = (simplify_presentation, fillings_may_affect_generators,             # <<<<<<<<<<<<<<
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:
*/
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_simplify_presentation);
  __Pyx_GIVEREF(__pyx_v_simplify_presentation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_simplify_presentation) != (0)) __PYX_ERR(2, 472, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_fillings_may_affect_generators);
  __Pyx_GIVEREF(__pyx_v_fillings_may_affect_generators);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fillings_may_affect_generators) != (0)) __PYX_ERR(2, 472, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_minimize_number_of_generators);
  __Pyx_GIVEREF(__pyx_v_minimize_number_of_generators);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_minimize_number_of_generators) != (0)) __PYX_ERR(2, 472, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_try_hard_to_shorten_relators);
  __Pyx_GIVEREF(__pyx_v_try_hard_to_shorten_relators);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_try_hard_to_shorten_relators) != (0)) __PYX_ERR(2, 472, __pyx_L1_error);
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":474
 *         args = (simplify_presentation, fillings_may_affect_generators,
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/manifold.pyx":475
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 475, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyNumber_Add(__pyx_mstate_global->__pyx_tuple[15], __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 475, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L8_try_return;

      /* "cython/core/manifold.pyx":474
 *         args = (simplify_presentation, fillings_may_affect_generators,
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":476
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;

    /* "cython/core/manifold.pyx":474
 *         args = (simplify_presentation, fillings_may_affect_generators,
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:
*/
    __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_L8_try_return:;
    __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_L0;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
  }

  /* "cython/core/manifold.pyx":479
 *             pass
 * 
 *         result = HolonomyGroup(self, *args)             # <<<<<<<<<<<<<<
 *         return self._cache.save(result, 'fundamental_group', *args)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_HolonomyGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 479, __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)) != (0)) __PYX_ERR(2, 479, __pyx_L1_error);
  __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":480
 * 
 *         result = HolonomyGroup(self, *args)
 *         return self._cache.save(result, 'fundamental_group', *args)             # <<<<<<<<<<<<<<
 * 
 *     def symmetry_group(self, of_link : bool = False) -> SymmetryGroup:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_mstate_global->__pyx_n_u_save); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_result);
  __Pyx_GIVEREF(__pyx_v_result);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_result) != (0)) __PYX_ERR(2, 480, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fundamental_group);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fundamental_group);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_n_u_fundamental_group) != (0)) __PYX_ERR(2, 480, __pyx_L1_error);
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":430
 *         return filled
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Manifold.fundamental_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":482
 *         return self._cache.save(result, 'fundamental_group', *args)
 * 
 *     def symmetry_group(self, of_link : bool = False) -> SymmetryGroup:             # <<<<<<<<<<<<<<
 *         """
 *         Returns the symmetry group of the Manifold.
*/

/* Python wrapper */
static struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_pw_8SnapPyHP_8Manifold_33symmetry_group(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_8SnapPyHP_8Manifold_32symmetry_group, "\n        Returns the symmetry group of the Manifold.\n        If the flag \"of_link\" is set, then it only returns symmetries\n        that preserves the meridians.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_33symmetry_group = {"symmetry_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_33symmetry_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_32symmetry_group};
static struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_pw_8SnapPyHP_8Manifold_33symmetry_group(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_of_link = 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;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("symmetry_group (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_of_link,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 482, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "symmetry_group", 0) < 0) __PYX_ERR(2, 482, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_of_link = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("symmetry_group", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 482, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.symmetry_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_32symmetry_group(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_of_link);

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

static struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_pf_8SnapPyHP_8Manifold_32symmetry_group(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_of_link) {
  SymmetryGroup *__pyx_v_symmetries_of_manifold;
  SymmetryGroup *__pyx_v_symmetries_of_link;
  Triangulation *__pyx_v_c_symmetric_triangulation;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_symmetric_triangulation = 0;
  Boolean __pyx_v_is_full_group;
  FuncResult __pyx_v_result;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_symmetry_group = 0;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  FuncResult __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("symmetry_group", 0);

  /* "cython/core/manifold.pyx":488
 *         that preserves the meridians.
 *         """
 *         cdef c_SymmetryGroup* symmetries_of_manifold = NULL             # <<<<<<<<<<<<<<
 *         cdef c_SymmetryGroup* symmetries_of_link = NULL
 *         cdef c_Triangulation* c_symmetric_triangulation = NULL
*/
  __pyx_v_symmetries_of_manifold = NULL;

  /* "cython/core/manifold.pyx":489
 *         """
 *         cdef c_SymmetryGroup* symmetries_of_manifold = NULL
 *         cdef c_SymmetryGroup* symmetries_of_link = NULL             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_symmetric_triangulation = NULL
 *         cdef Manifold symmetric_triangulation
*/
  __pyx_v_symmetries_of_link = NULL;

  /* "cython/core/manifold.pyx":490
 *         cdef c_SymmetryGroup* symmetries_of_manifold = NULL
 *         cdef c_SymmetryGroup* symmetries_of_link = NULL
 *         cdef c_Triangulation* c_symmetric_triangulation = NULL             # <<<<<<<<<<<<<<
 *         cdef Manifold symmetric_triangulation
 *         cdef Boolean is_full_group
*/
  __pyx_v_c_symmetric_triangulation = NULL;

  /* "cython/core/manifold.pyx":496
 *         cdef SymmetryGroup symmetry_group
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":497
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 497, __pyx_L1_error)

    /* "cython/core/manifold.pyx":496
 *         cdef SymmetryGroup symmetry_group
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":499
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetry_group', of_link)
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/manifold.pyx":500
 * 
 *         try:
 *             return self._cache.lookup('symmetry_group', of_link)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __pyx_v_self->__pyx_base._cache;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_symmetry_group, __pyx_v_of_link};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_lookup, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 500, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup))))) __PYX_ERR(2, 500, __pyx_L4_error)
      __pyx_r = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L8_try_return;

      /* "cython/core/manifold.pyx":499
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetry_group', of_link)
 *         except KeyError:
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":501
 *         try:
 *             return self._cache.lookup('symmetry_group', of_link)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;

    /* "cython/core/manifold.pyx":499
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetry_group', of_link)
 *         except KeyError:
*/
    __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_L8_try_return:;
    __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_L0;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
  }

  /* "cython/core/manifold.pyx":504
 *             pass
 * 
 *         result = compute_symmetry_group(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         &symmetries_of_manifold,
 *                                         &symmetries_of_link,
*/
  __pyx_t_10 = compute_symmetry_group(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_symmetries_of_manifold), (&__pyx_v_symmetries_of_link), (&__pyx_v_c_symmetric_triangulation), (&__pyx_v_is_full_group)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 504, __pyx_L1_error)
  __pyx_v_result = __pyx_t_10;

  /* "cython/core/manifold.pyx":510
 *                                         &is_full_group)
 * 
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise ValueError('SnapPea failed to compute any part '
 *                              'of the symmetry group.')
*/
  __pyx_t_1 = (__pyx_v_result != func_OK);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":511
 * 
 *         if result != func_OK:
 *             raise ValueError('SnapPea failed to compute any part '             # <<<<<<<<<<<<<<
 *                              'of the symmetry group.')
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_3 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_SnapPea_failed_to_compute_any_pa};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 511, __pyx_L1_error)

    /* "cython/core/manifold.pyx":510
 *                                         &is_full_group)
 * 
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise ValueError('SnapPea failed to compute any part '
 *                              'of the symmetry group.')
*/
  }

  /* "cython/core/manifold.pyx":514
 *                              'of the symmetry group.')
 * 
 *         symmetric_triangulation = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         symmetric_triangulation.set_c_triangulation(c_symmetric_triangulation)
 *         self._cache.save(symmetric_triangulation, 'symmetric_triangulation')
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(2, 514, __pyx_L1_error)
  __pyx_v_symmetric_triangulation = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":515
 * 
 *         symmetric_triangulation = self.__class__('empty')
 *         symmetric_triangulation.set_c_triangulation(c_symmetric_triangulation)             # <<<<<<<<<<<<<<
 *         self._cache.save(symmetric_triangulation, 'symmetric_triangulation')
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_symmetric_triangulation->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_symmetric_triangulation), __pyx_v_c_symmetric_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":516
 *         symmetric_triangulation = self.__class__('empty')
 *         symmetric_triangulation.set_c_triangulation(c_symmetric_triangulation)
 *         self._cache.save(symmetric_triangulation, 'symmetric_triangulation')             # <<<<<<<<<<<<<<
 * 
 *         symmetry_group = SymmetryGroup(B2B(is_full_group), True)
*/
  __pyx_t_3 = __pyx_v_self->__pyx_base._cache;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_symmetric_triangulation), __pyx_mstate_global->__pyx_n_u_symmetric_triangulation};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_save, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":518
 *         self._cache.save(symmetric_triangulation, 'symmetric_triangulation')
 * 
 *         symmetry_group = SymmetryGroup(B2B(is_full_group), True)             # <<<<<<<<<<<<<<
 *         if of_link:
 *             free_symmetry_group(symmetries_of_manifold)
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup); 
  __pyx_t_11 = __pyx_f_8SnapPyHP_B2B(__pyx_v_is_full_group); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_11, Py_True};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 518, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_symmetry_group = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":519
 * 
 *         symmetry_group = SymmetryGroup(B2B(is_full_group), True)
 *         if of_link:             # <<<<<<<<<<<<<<
 *             free_symmetry_group(symmetries_of_manifold)
 *             symmetry_group._set_c_symmetry_group(symmetries_of_link)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_of_link); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 519, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":520
 *         symmetry_group = SymmetryGroup(B2B(is_full_group), True)
 *         if of_link:
 *             free_symmetry_group(symmetries_of_manifold)             # <<<<<<<<<<<<<<
 *             symmetry_group._set_c_symmetry_group(symmetries_of_link)
 *         else:
*/
    free_symmetry_group(__pyx_v_symmetries_of_manifold); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 520, __pyx_L1_error)

    /* "cython/core/manifold.pyx":521
 *         if of_link:
 *             free_symmetry_group(symmetries_of_manifold)
 *             symmetry_group._set_c_symmetry_group(symmetries_of_link)             # <<<<<<<<<<<<<<
 *         else:
 *             free_symmetry_group(symmetries_of_link)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *)__pyx_v_symmetry_group->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_symmetry_group, __pyx_v_symmetries_of_link); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":519
 * 
 *         symmetry_group = SymmetryGroup(B2B(is_full_group), True)
 *         if of_link:             # <<<<<<<<<<<<<<
 *             free_symmetry_group(symmetries_of_manifold)
 *             symmetry_group._set_c_symmetry_group(symmetries_of_link)
*/
    goto __pyx_L13;
  }

  /* "cython/core/manifold.pyx":523
 *             symmetry_group._set_c_symmetry_group(symmetries_of_link)
 *         else:
 *             free_symmetry_group(symmetries_of_link)             # <<<<<<<<<<<<<<
 *             symmetry_group._set_c_symmetry_group(symmetries_of_manifold)
 * 
*/
  /*else*/ {
    free_symmetry_group(__pyx_v_symmetries_of_link); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 523, __pyx_L1_error)

    /* "cython/core/manifold.pyx":524
 *         else:
 *             free_symmetry_group(symmetries_of_link)
 *             symmetry_group._set_c_symmetry_group(symmetries_of_manifold)             # <<<<<<<<<<<<<<
 * 
 *         return self._cache.save(symmetry_group, 'symmetry_group', of_link)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *)__pyx_v_symmetry_group->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_symmetry_group, __pyx_v_symmetries_of_manifold); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L13:;

  /* "cython/core/manifold.pyx":526
 *             symmetry_group._set_c_symmetry_group(symmetries_of_manifold)
 * 
 *         return self._cache.save(symmetry_group, 'symmetry_group', of_link)             # <<<<<<<<<<<<<<
 * 
 *     def symmetric_triangulation(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_4 = __pyx_v_self->__pyx_base._cache;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_symmetry_group), __pyx_mstate_global->__pyx_n_u_symmetry_group, __pyx_v_of_link};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_save, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup))))) __PYX_ERR(2, 526, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":482
 *         return self._cache.save(result, 'fundamental_group', *args)
 * 
 *     def symmetry_group(self, of_link : bool = False) -> SymmetryGroup:             # <<<<<<<<<<<<<<
 *         """
 *         Returns the symmetry group of the Manifold.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.Manifold.symmetry_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_symmetric_triangulation);
  __Pyx_XDECREF((PyObject *)__pyx_v_symmetry_group);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":528
 *         return self._cache.save(symmetry_group, 'symmetry_group', of_link)
 * 
 *     def symmetric_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Dehn filling description of the manifold realizing
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_35symmetric_triangulation(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_8SnapPyHP_8Manifold_34symmetric_triangulation, "\n        Returns a Dehn filling description of the manifold realizing\n        the symmetry group.\n\n        >>> M = Manifold('m003(-3,1)')\n        >>> M.symmetry_group()\n        D6\n        >>> N = M.symmetric_triangulation()\n        >>> N\n        m003(1,0)(1,0)(1,0)\n        >>> N.dehn_fill( [(0,0), (0,0), (0,0)] )\n        >>> N.symmetry_group(of_link=True)\n        D6\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_35symmetric_triangulation = {"symmetric_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_35symmetric_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_34symmetric_triangulation};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_35symmetric_triangulation(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("symmetric_triangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("symmetric_triangulation", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("symmetric_triangulation", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_34symmetric_triangulation(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_34symmetric_triangulation(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("symmetric_triangulation", 0);

  /* "cython/core/manifold.pyx":543
 *         D6
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetric_triangulation')
 *         except KeyError:
*/
  {
    __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:*/ {

      /* "cython/core/manifold.pyx":544
 *         """
 *         try:
 *             return self._cache.lookup('symmetric_triangulation')             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             self.symmetry_group()
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __pyx_v_self->__pyx_base._cache;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_symmetric_triangulation};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_lookup, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 544, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/manifold.pyx":543
 *         D6
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetric_triangulation')
 *         except KeyError:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":545
 *         try:
 *             return self._cache.lookup('symmetric_triangulation')
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             self.symmetry_group()
 *             return self._cache.lookup('symmetric_triangulation')
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("SnapPyHP.Manifold.symmetric_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(2, 545, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "cython/core/manifold.pyx":546
 *             return self._cache.lookup('symmetric_triangulation')
 *         except KeyError:
 *             self.symmetry_group()             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetric_triangulation')
 * 
*/
      __pyx_t_10 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_symmetry_group, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 546, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/manifold.pyx":547
 *         except KeyError:
 *             self.symmetry_group()
 *             return self._cache.lookup('symmetric_triangulation')             # <<<<<<<<<<<<<<
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Manifold':
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_10 = __pyx_v_self->__pyx_base._cache;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_n_u_symmetric_triangulation};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_lookup, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 547, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "cython/core/manifold.pyx":543
 *         D6
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetric_triangulation')
 *         except KeyError:
*/
    __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;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":528
 *         return self._cache.save(symmetry_group, 'symmetry_group', of_link)
 * 
 *     def symmetric_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Dehn filling description of the manifold realizing
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.Manifold.symmetric_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":549
 *             return self._cache.lookup('symmetric_triangulation')
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Manifold':             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`Manifold` representing the finite cover specified by a
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_37cover(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_8SnapPyHP_8Manifold_36cover, "\n        Returns a :class:`Manifold` representing the finite cover specified by a\n        transitive permutation representation.  The representation is\n        specified by a list of permutations, one for each generator of the\n        simplified presentation of the fundamental group.  Each permutation is\n        specified as a list ``P`` such such that ``set(P) == set(range(d))``\n        where ``d`` is the degree of the cover.\n\n        >>> M = Manifold('m004')\n        >>> N0 = M.cover([[1, 3, 0, 4, 2], [0, 2, 1, 4, 3]])\n        >>> abs(N0.volume()/M.volume() - 5) < 0.0000000001\n        True\n\n\n        If within SageMath, the permutations can also be of type\n        ``PermutationGroupElement``, in which case they act on the set\n        ``range(1, d + 1)``.  Or, you can specify a GAP or Magma subgroup\n        of the fundamental group.     Some examples::\n\n          sage: M = Manifold('m004')\n\n        The basic method::\n\n          sage: N0 = M.cover([[1, 3, 0, 4, 2], [0, 2, 1, 4, 3]])\n\n        From a Gap subgroup::\n\n          sage: G = gap(M.fundamental_group())\n          sage: H = G.LowIndexSubgroupsFpGroup(5)[9]\n          sage: N1 = M.cover(H)\n          sage: N0 == N1\n          True\n\n        Or a homomorphism to a permutation group::\n\n          sage: f = G.GQuotients(PSL(2,7))[1]\n          sage: N2 = M.cover(f)\n          sage: N2.volume()/M.volume() # doctest: +NUMERIC9\n          8.00000000\n\n        Or maybe we want larger cover coming from the kernel of this::\n\n          sage: N3 = M.cover(f.Kernel())\n          sage: N3.volume()/M.volume() # doctest: +NUMERIC9\n          168.00000000\n\n        Check the homology against what Gap computes directly::\n\n          sage: N3.homology().betti_number()\n          32\n          sage: len([ x for x in f.Kernel().AbelianInvariants().sage() if x == 0])\n          32\n\n        We can do the same for Magma::\n\n          sage: G = magma(M.fundamental_group())             #doctest: +SKI""P\n          sage: Q, f = G.pQuotient(5, 1, nvals = 2)          #doctest: +SKIP\n          sage: M.cover(f.Kernel()).volume()                 #doctest: +SKIP\n          10.14941606\n          sage: h = G.SimpleQuotients(1, 11, 2, 10000)[1,1]  #doctest: +SKIP\n          sage: N4 = M.cover(h)                              #doctest: +SKIP\n          sage: N2 == N4                                     #doctest: +SKIP\n          True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_37cover = {"cover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_37cover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_36cover};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_37cover(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_permutation_rep = 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("cover (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_permutation_rep,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 549, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 549, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cover", 0) < 0) __PYX_ERR(2, 549, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cover", 1, 1, 1, i); __PYX_ERR(2, 549, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 549, __pyx_L3_error)
    }
    __pyx_v_permutation_rep = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cover", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 549, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_36cover(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_permutation_rep);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_36cover(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_permutation_rep) {
  PyObject *__pyx_v_cover = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cover", 0);

  /* "cython/core/manifold.pyx":614
 *           True
 *         """
 *         cover = Triangulation.cover(self, permutation_rep)             # <<<<<<<<<<<<<<
 *         return Manifold_from_Triangulation(cover, recompute=False,
 *                                            manifold_class=self.__class__)
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_permutation_rep};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cover, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_cover = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":615
 *         """
 *         cover = Triangulation.cover(self, permutation_rep)
 *         return Manifold_from_Triangulation(cover, recompute=False,             # <<<<<<<<<<<<<<
 *                                            manifold_class=self.__class__)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Manifold_from_Triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/manifold.pyx":616
 *         cover = Triangulation.cover(self, permutation_rep)
 *         return Manifold_from_Triangulation(cover, recompute=False,
 *                                            manifold_class=self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     def covers(
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, __pyx_v_cover};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_recompute, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(2, 615, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_manifold_class_2, __pyx_t_5, __pyx_t_6, __pyx_callargs+2, 1) < 0) __PYX_ERR(2, 615, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":549
 *             return self._cache.lookup('symmetric_triangulation')
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Manifold':             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`Manifold` representing the finite cover specified by a
*/

  /* 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("SnapPyHP.Manifold.cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cover);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":618
 *                                            manifold_class=self.__class__)
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_39covers(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_8SnapPyHP_8Manifold_38covers, "\n        Returns a list of :class:`Manifold`\\ s corresponding to all of the\n        finite covers of the given degree.  The default method is\n        'low_index' for general covers and 'snappea' for cyclic\n        covers.  The former uses Sim's algorithm while the latter\n        uses the original Snappea algorithm.\n\n        WARNING: If the degree is large this might take a very, very,\n        very long time.\n\n        >>> M = Manifold('m003')\n        >>> covers = M.covers(4)\n        >>> sorted(N.homology() for N in covers)\n        [Z/3 + Z/15 + Z, Z/5 + Z + Z]\n\n        It is faster to look just at cyclic covers.\n\n        >>> covers = M.covers(4, cover_type='cyclic')\n        >>> [(N, N.homology()) for N in covers]\n        [(m003~cyc~0(0,0), Z/3 + Z/15 + Z)]\n\n        Here we check that we get the same number of covers with the\n        'snappea' and 'low_index' methods.\n\n        >>> M = Manifold('m125')\n        >>> len(M.covers(5))\n        19\n        >>> len(M.covers(5, method='snappea'))\n        19\n\n        If you are using Sage, you can use GAP to find the subgroups,\n        which is often much faster, by specifying the optional\n        argument method = 'gap' If you have Magma installed, you can\n        used it to do the heavy lifting by specifying method='magma'.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_39covers = {"covers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_39covers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_38covers};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_39covers(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_degree = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_cover_type = 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("covers (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,&__pyx_mstate_global->__pyx_n_u_method,&__pyx_mstate_global->__pyx_n_u_cover_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 618, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "covers", 0) < 0) __PYX_ERR(2, 618, __pyx_L3_error)

      /* "cython/core/manifold.pyx":621
 *             self,
 *             degree,
 *             method : typing.Optional[str] = None,             # <<<<<<<<<<<<<<
 *             cover_type : str  = 'all'
 *         ) -> 'list[snappy.Manifold]':
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_all));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("covers", 0, 1, 3, i); __PYX_ERR(2, 618, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 618, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_all));
    }
    __pyx_v_degree = values[0];
    __pyx_v_method = ((PyObject*)values[1]);
    __pyx_v_cover_type = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("covers", 0, 1, 3, __pyx_nargs); __PYX_ERR(2, 618, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method), (&PyUnicode_Type), 1, "method", 2))) __PYX_ERR(2, 621, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cover_type), (&PyUnicode_Type), 0, "cover_type", 2))) __PYX_ERR(2, 622, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_38covers(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_degree, __pyx_v_method, __pyx_v_cover_type);

  /* "cython/core/manifold.pyx":618
 *                                            manifold_class=self.__class__)
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_38covers(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type) {
  PyObject *__pyx_v_covers = NULL;
  PyObject *__pyx_9genexpr46__pyx_v_cover = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("covers", 0);

  /* "cython/core/manifold.pyx":659
 *         used it to do the heavy lifting by specifying method='magma'.
 *         """
 *         covers = Triangulation.covers(self, degree, method,cover_type)             # <<<<<<<<<<<<<<
 *         return [Manifold_from_Triangulation(cover,
 *                                             recompute=False,
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_degree, __pyx_v_method, __pyx_v_cover_type};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_covers, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_covers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":660
 *         """
 *         covers = Triangulation.covers(self, degree, method,cover_type)
 *         return [Manifold_from_Triangulation(cover,             # <<<<<<<<<<<<<<
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/manifold.pyx":663
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
 *                 for cover in covers]             # <<<<<<<<<<<<<<
 * 
 *     cdef _real_volume(self):
*/
    if (likely(PyList_CheckExact(__pyx_v_covers)) || PyTuple_CheckExact(__pyx_v_covers)) {
      __pyx_t_2 = __pyx_v_covers; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_covers); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 663, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 663, __pyx_L5_error)
    }
    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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 663, __pyx_L5_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4);
          ++__pyx_t_4;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 663, __pyx_L5_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
          #endif
          ++__pyx_t_4;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 663, __pyx_L5_error)
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 663, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_cover, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/manifold.pyx":660
 *         """
 *         covers = Triangulation.covers(self, degree, method,cover_type)
 *         return [Manifold_from_Triangulation(cover,             # <<<<<<<<<<<<<<
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Manifold_from_Triangulation); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 660, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_8);

      /* "cython/core/manifold.pyx":662
 *         return [Manifold_from_Triangulation(cover,
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)             # <<<<<<<<<<<<<<
 *                 for cover in covers]
 * 
*/
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 662, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_7, __pyx_9genexpr46__pyx_v_cover};
        __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 660, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_recompute, Py_False, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(2, 660, __pyx_L5_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_manifold_class_2, __pyx_t_9, __pyx_t_10, __pyx_callargs+2, 1) < 0) __PYX_ERR(2, 660, __pyx_L5_error)
        __pyx_t_6 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 660, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 660, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/manifold.pyx":663
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
 *                 for cover in covers]             # <<<<<<<<<<<<<<
 * 
 *     cdef _real_volume(self):
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_cover); __pyx_9genexpr46__pyx_v_cover = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_cover); __pyx_9genexpr46__pyx_v_cover = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":618
 *                                            manifold_class=self.__class__)
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/

  /* function exit code */
  __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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.Manifold.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_covers);
  __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_cover);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":665
 *                 for cover in covers]
 * 
 *     cdef _real_volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the (real) volume as a Number.
*/

static PyObject *__pyx_f_8SnapPyHP_8Manifold__real_volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  int __pyx_v_acc;
  PyObject *__pyx_v_solution_type = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_9genexpr47__pyx_v_z = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  __pyx_t_8SnapPyHP_Real __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_real_volume", 0);

  /* "cython/core/manifold.pyx":671
 *         cdef int acc
 *         cdef solution_type
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         solution_type = self.solution_type()
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":672
 *         cdef solution_type
 *         if self.c_triangulation is NULL:
 *             return 0             # <<<<<<<<<<<<<<
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_r = __pyx_mstate_global->__pyx_int_0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":671
 *         cdef int acc
 *         cdef solution_type
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         solution_type = self.solution_type()
*/
  }

  /* "cython/core/manifold.pyx":673
 *         if self.c_triangulation is NULL:
 *             return 0
 *         solution_type = self.solution_type()             # <<<<<<<<<<<<<<
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('Solution type is: %s' % solution_type)
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_solution_type, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_solution_type = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":674
 *             return 0
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Solution type is: %s' % solution_type)
 *         if Number._default_precision > 64:
*/
  __Pyx_INCREF(__pyx_v_solution_type);
  __pyx_t_2 = __pyx_v_solution_type;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_not_attempted, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 674, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_no_solution_found, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 674, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_t_1;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/manifold.pyx":675
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('Solution type is: %s' % solution_type)             # <<<<<<<<<<<<<<
 *         if Number._default_precision > 64:
 *             # must provide a start value to get the correct precision
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Solution_type_is_s, __pyx_v_solution_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 675, __pyx_L1_error)

    /* "cython/core/manifold.pyx":674
 *             return 0
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Solution type is: %s' % solution_type)
 *         if Number._default_precision > 64:
*/
  }

  /* "cython/core/manifold.pyx":676
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('Solution type is: %s' % solution_type)
 *         if Number._default_precision > 64:             # <<<<<<<<<<<<<<
 *             # must provide a start value to get the correct precision
 *             result = sum(
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_default_precision); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_mstate_global->__pyx_int_64, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "cython/core/manifold.pyx":678
 *         if Number._default_precision > 64:
 *             # must provide a start value to get the correct precision
 *             result = sum(             # <<<<<<<<<<<<<<
 *                 [z.volume() for z in self._get_tetrahedra_shapes('filled')],
 *                 Number(0))
*/
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_sum);
    __pyx_t_7 = __pyx_builtin_sum; 
    { /* enter inner scope */

      /* "cython/core/manifold.pyx":679
 *             # must provide a start value to get the correct precision
 *             result = sum(
 *                 [z.volume() for z in self._get_tetrahedra_shapes('filled')],             # <<<<<<<<<<<<<<
 *                 Number(0))
 *         else:
*/
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 679, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_filled_2};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_tetrahedra_shapes, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 679, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
        __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 679, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 679, __pyx_L10_error)
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 679, __pyx_L10_error)
              #endif
              if (__pyx_t_10 >= __pyx_temp) break;
            }
            __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_10);
            ++__pyx_t_10;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 679, __pyx_L10_error)
              #endif
              if (__pyx_t_10 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10));
            #else
            __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10);
            #endif
            ++__pyx_t_10;
          }
          if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 679, __pyx_L10_error)
        } else {
          __pyx_t_8 = __pyx_t_11(__pyx_t_9);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 679, __pyx_L10_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_z, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_12 = __pyx_9genexpr47__pyx_v_z;
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_volume, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 679, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(2, 679, __pyx_L10_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_z); __pyx_9genexpr47__pyx_v_z = 0;
      goto __pyx_L14_exit_scope;
      __pyx_L10_error:;
      __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_z); __pyx_9genexpr47__pyx_v_z = 0;
      goto __pyx_L1_error;
      __pyx_L14_exit_scope:;
    } /* exit inner scope */

    /* "cython/core/manifold.pyx":680
 *             result = sum(
 *                 [z.volume() for z in self._get_tetrahedra_shapes('filled')],
 *                 Number(0))             # <<<<<<<<<<<<<<
 *         else:
 *             result = Number(<double>volume(self.c_triangulation, &acc))
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_9};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":676
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('Solution type is: %s' % solution_type)
 *         if Number._default_precision > 64:             # <<<<<<<<<<<<<<
 *             # must provide a start value to get the correct precision
 *             result = sum(
*/
    goto __pyx_L7;
  }

  /* "cython/core/manifold.pyx":682
 *                 Number(0))
 *         else:
 *             result = Number(<double>volume(self.c_triangulation, &acc))             # <<<<<<<<<<<<<<
 *             result.accuracy = acc
 *         return result
*/
  /*else*/ {
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_13 = volume(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_acc)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 682, __pyx_L1_error)
    __pyx_t_3 = PyFloat_FromDouble(((double)__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 682, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":683
 *         else:
 *             result = Number(<double>volume(self.c_triangulation, &acc))
 *             result.accuracy = acc             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_acc); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_2) < 0) __PYX_ERR(2, 683, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L7:;

  /* "cython/core/manifold.pyx":684
 *             result = Number(<double>volume(self.c_triangulation, &acc))
 *             result.accuracy = acc
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef _cusped_complex_volume(self, Complex *volume, int *accuracy):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":665
 *                 for cover in covers]
 * 
 *     cdef _real_volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the (real) volume as a Number.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Manifold._real_volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_solution_type);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":686
 *         return result
 * 
 *     cdef _cusped_complex_volume(self, Complex *volume, int *accuracy):             # <<<<<<<<<<<<<<
 *         """
 *         Computes the complex volume of the manifold, computed using
*/

static PyObject *__pyx_f_8SnapPyHP_8Manifold__cusped_complex_volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, Complex *__pyx_v_volume, int *__pyx_v_accuracy) {
  const char* __pyx_v_err_msg;
  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;
  size_t __pyx_t_5;
  Complex __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_cusped_complex_volume", 0);

  /* "cython/core/manifold.pyx":703
 *         True
 *         """
 *         cdef const_char_ptr err_msg=NULL             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/
  __pyx_v_err_msg = NULL;

  /* "cython/core/manifold.pyx":704
 *         """
 *         cdef const_char_ptr err_msg=NULL
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":705
 *         cdef const_char_ptr err_msg=NULL
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         volume[0] = complex_volume(self.c_triangulation,
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 705, __pyx_L1_error)

    /* "cython/core/manifold.pyx":704
 *         """
 *         cdef const_char_ptr err_msg=NULL
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":707
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         volume[0] = complex_volume(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                    &err_msg,
 *                                    accuracy)
*/
  __pyx_t_6 = complex_volume(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_err_msg), __pyx_v_accuracy); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 707, __pyx_L1_error)
  (__pyx_v_volume[0]) = __pyx_t_6;

  /* "cython/core/manifold.pyx":710
 *                                    &err_msg,
 *                                    accuracy)
 *         if err_msg is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         raise ValueError(err_msg)
*/
  __pyx_t_1 = (__pyx_v_err_msg == NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":711
 *                                    accuracy)
 *         if err_msg is NULL:
 *             return             # <<<<<<<<<<<<<<
 *         raise ValueError(err_msg)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":710
 *                                    &err_msg,
 *                                    accuracy)
 *         if err_msg is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         raise ValueError(err_msg)
*/
  }

  /* "cython/core/manifold.pyx":712
 *         if err_msg is NULL:
 *             return
 *         raise ValueError(err_msg)             # <<<<<<<<<<<<<<
 * 
 *     def _complex_volume(self):
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __pyx_t_3 = __pyx_builtin_ValueError; 
  __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_err_msg); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(2, 712, __pyx_L1_error)

  /* "cython/core/manifold.pyx":686
 *         return result
 * 
 *     cdef _cusped_complex_volume(self, Complex *volume, int *accuracy):             # <<<<<<<<<<<<<<
 *         """
 *         Computes the complex volume of the manifold, computed using
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Manifold._cusped_complex_volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":714
 *         raise ValueError(err_msg)
 * 
 *     def _complex_volume(self):             # <<<<<<<<<<<<<<
 *         cdef Complex volume
 *         cdef int accuracy
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_41_complex_volume(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_41_complex_volume = {"_complex_volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_41_complex_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_41_complex_volume(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("_complex_volume (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_complex_volume", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_complex_volume", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_40_complex_volume(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_40_complex_volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  Complex __pyx_v_volume;
  int __pyx_v_accuracy;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  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("_complex_volume", 0);

  /* "cython/core/manifold.pyx":717
 *         cdef Complex volume
 *         cdef int accuracy
 *         if True in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             set_CS_value(self.c_triangulation, volume.imag / PI_SQUARED_BY_2)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_complete};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(Py_True, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":718
 *         cdef int accuracy
 *         if True in self.cusp_info('is_complete'):
 *             self._cusped_complex_volume(&volume, &accuracy)             # <<<<<<<<<<<<<<
 *             set_CS_value(self.c_triangulation, volume.imag / PI_SQUARED_BY_2)
 *             result = Complex2Number(volume)
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_cusped_complex_volume(__pyx_v_self, (&__pyx_v_volume), (&__pyx_v_accuracy)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":719
 *         if True in self.cusp_info('is_complete'):
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             set_CS_value(self.c_triangulation, volume.imag / PI_SQUARED_BY_2)             # <<<<<<<<<<<<<<
 *             result = Complex2Number(volume)
 *             result.accuracy = accuracy
*/
    set_CS_value(__pyx_v_self->__pyx_base.c_triangulation, (__pyx_v_volume.imag / PI_SQUARED_BY_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 719, __pyx_L1_error)

    /* "cython/core/manifold.pyx":720
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             set_CS_value(self.c_triangulation, volume.imag / PI_SQUARED_BY_2)
 *             result = Complex2Number(volume)             # <<<<<<<<<<<<<<
 *             result.accuracy = accuracy
 *         else:
*/
    __pyx_t_1 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_volume); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":721
 *             set_CS_value(self.c_triangulation, volume.imag / PI_SQUARED_BY_2)
 *             result = Complex2Number(volume)
 *             result.accuracy = accuracy             # <<<<<<<<<<<<<<
 *         else:
 *             result = self._real_volume() + (
*/
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_1) < 0) __PYX_ERR(2, 721, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":717
 *         cdef Complex volume
 *         cdef int accuracy
 *         if True in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             set_CS_value(self.c_triangulation, volume.imag / PI_SQUARED_BY_2)
*/
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":723
 *             result.accuracy = accuracy
 *         else:
 *             result = self._real_volume() + (             # <<<<<<<<<<<<<<
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))
*/
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_real_volume(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/manifold.pyx":724
 *         else:
 *             result = self._real_volume() + (
 *                 self._chern_simons() *             # <<<<<<<<<<<<<<
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))
 *         return self._number_(result)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_chern_simons(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/manifold.pyx":725
 *             result = self._real_volume() + (
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))             # <<<<<<<<<<<<<<
 *         return self._number_(result)
 * 
*/
    __pyx_t_5 = __pyx_f_8SnapPyHP_Real2Number(PI_SQUARED_BY_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "cython/core/manifold.pyx":724
 *         else:
 *             result = self._real_volume() + (
 *                 self._chern_simons() *             # <<<<<<<<<<<<<<
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))
 *         return self._number_(result)
*/
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":725
 *             result = self._real_volume() + (
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))             # <<<<<<<<<<<<<<
 *         return self._number_(result)
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_I};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":723
 *             result.accuracy = accuracy
 *         else:
 *             result = self._real_volume() + (             # <<<<<<<<<<<<<<
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))
*/
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_result = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "cython/core/manifold.pyx":726
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))
 *         return self._number_(result)             # <<<<<<<<<<<<<<
 * 
 *     def volume(self, accuracy=False, verified = False, bits_prec = None):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_result};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":714
 *         raise ValueError(err_msg)
 * 
 *     def _complex_volume(self):             # <<<<<<<<<<<<<<
 *         cdef Complex volume
 *         cdef int accuracy
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Manifold._complex_volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":728
 *         return self._number_(result)
 * 
 *     def volume(self, accuracy=False, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the volume of the current solution to the hyperbolic
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_43volume(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_8SnapPyHP_8Manifold_42volume, "\n        Returns the volume of the current solution to the hyperbolic\n        gluing equations; if the solution is sufficiently non-degenerate,\n        this is the sum of the volumes of the hyperbolic pieces in\n        the geometric decomposition of the manifold.\n\n        >>> M = Manifold('m004')\n        >>> M.volume() # doctest: +NUMERIC6\n        2.02988321\n        >>> M.solution_type()\n        'all tetrahedra positively oriented'\n\n        The return value has an extra attribute, accuracy, which is the\n        number of digits of accuracy as *estimated* by SnapPea.  When\n        printing the volume, the result is rounded to 1 more than this\n        number of digits.\n\n        >>> vol, accuracy = M.volume(accuracy = True)\n        >>> accuracy in (10, 63) # Low precision, High precision\n        True\n\n        Inside SageMath, verified computation of the volume of a\n        hyperbolic manifold is also possible (this will verify first\n        that the manifold is indeed hyperbolic)::\n\n            sage: M.volume(verified=True, bits_prec=100)   #doctest: +NUMERIC24\n            2.029883212819307250042405109?\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_43volume = {"volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_43volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_42volume};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_43volume(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_accuracy = 0;
  PyObject *__pyx_v_verified = 0;
  PyObject *__pyx_v_bits_prec = 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("volume (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_accuracy,&__pyx_mstate_global->__pyx_n_u_verified,&__pyx_mstate_global->__pyx_n_u_bits_prec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 728, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 728, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 728, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 728, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "volume", 0) < 0) __PYX_ERR(2, 728, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 728, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 728, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 728, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_accuracy = values[0];
    __pyx_v_verified = values[1];
    __pyx_v_bits_prec = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("volume", 0, 0, 3, __pyx_nargs); __PYX_ERR(2, 728, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_42volume(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_accuracy, __pyx_v_verified, __pyx_v_bits_prec);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_42volume(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_accuracy, PyObject *__pyx_v_verified, PyObject *__pyx_v_bits_prec) {
  PyObject *__pyx_v_vol = 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;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("volume", 0);

  /* "cython/core/manifold.pyx":758
 *         """
 * 
 *         if verified or bits_prec:             # <<<<<<<<<<<<<<
 *             if accuracy:
 *                 raise ValueError(
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_verified); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 758, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bits_prec); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 758, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":759
 * 
 *         if verified or bits_prec:
 *             if accuracy:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'SnapPea kernel style estimation of accuracy not available '
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_accuracy); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 759, __pyx_L1_error)
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":760
 *         if verified or bits_prec:
 *             if accuracy:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'SnapPea kernel style estimation of accuracy not available '
 *                     'for arbitrary precision/interval arithmetic.')
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_5 = __pyx_builtin_ValueError; 
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_SnapPea_kernel_style_estimation};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 760, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(2, 760, __pyx_L1_error)

      /* "cython/core/manifold.pyx":759
 * 
 *         if verified or bits_prec:
 *             if accuracy:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'SnapPea kernel style estimation of accuracy not available '
*/
    }

    /* "cython/core/manifold.pyx":764
 *                     'for arbitrary precision/interval arithmetic.')
 * 
 *             return verify.compute_volume(             # <<<<<<<<<<<<<<
 *                 self, verified=verified, bits_prec=bits_prec)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_verify); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_compute_volume); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":765
 * 
 *             return verify.compute_volume(
 *                 self, verified=verified, bits_prec=bits_prec)             # <<<<<<<<<<<<<<
 * 
 *         vol = self._real_volume()
*/
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_5, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_verified, __pyx_v_verified, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(2, 764, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bits_prec, __pyx_v_bits_prec, __pyx_t_4, __pyx_callargs+2, 1) < 0) __PYX_ERR(2, 764, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":758
 *         """
 * 
 *         if verified or bits_prec:             # <<<<<<<<<<<<<<
 *             if accuracy:
 *                 raise ValueError(
*/
  }

  /* "cython/core/manifold.pyx":767
 *                 self, verified=verified, bits_prec=bits_prec)
 * 
 *         vol = self._real_volume()             # <<<<<<<<<<<<<<
 *         if accuracy:
 *             return (self._number_(vol), vol.accuracy)
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_real_volume(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_vol = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":768
 * 
 *         vol = self._real_volume()
 *         if accuracy:             # <<<<<<<<<<<<<<
 *             return (self._number_(vol), vol.accuracy)
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_accuracy); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 768, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":769
 *         vol = self._real_volume()
 *         if accuracy:
 *             return (self._number_(vol), vol.accuracy)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._number_(vol)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_vol};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 769, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_vol, __pyx_mstate_global->__pyx_n_u_accuracy); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(2, 769, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7) != (0)) __PYX_ERR(2, 769, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":768
 * 
 *         vol = self._real_volume()
 *         if accuracy:             # <<<<<<<<<<<<<<
 *             return (self._number_(vol), vol.accuracy)
 *         else:
*/
  }

  /* "cython/core/manifold.pyx":771
 *             return (self._number_(vol), vol.accuracy)
 *         else:
 *             return self._number_(vol)             # <<<<<<<<<<<<<<
 * 
 *     cdef _old_chern_simons(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_vol};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":728
 *         return self._number_(result)
 * 
 *     def volume(self, accuracy=False, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the volume of the current solution to the hyperbolic
*/

  /* 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_7);
  __Pyx_AddTraceback("SnapPyHP.Manifold.volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vol);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":773
 *             return self._number_(vol)
 * 
 *     cdef _old_chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Chern-Simons invariant as a Number.  The value
*/

static PyObject *__pyx_f_8SnapPyHP_8Manifold__old_chern_simons(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  Boolean __pyx_v_is_known;
  Boolean __pyx_v_requires_initialization;
  __pyx_t_8SnapPyHP_Real __pyx_v_CS;
  int __pyx_v_accuracy;
  PyObject *__pyx_v_cs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_old_chern_simons", 0);

  /* "cython/core/manifold.pyx":783
 *         cdef int accuracy
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         get_CS_value(self.c_triangulation,
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":784
 * 
 *         if self.c_triangulation is NULL:
 *             return 0             # <<<<<<<<<<<<<<
 *         get_CS_value(self.c_triangulation,
 *                      &is_known,
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_r = __pyx_mstate_global->__pyx_int_0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":783
 *         cdef int accuracy
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         get_CS_value(self.c_triangulation,
*/
  }

  /* "cython/core/manifold.pyx":785
 *         if self.c_triangulation is NULL:
 *             return 0
 *         get_CS_value(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                      &is_known,
 *                      &CS,
*/
  get_CS_value(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_is_known), (&__pyx_v_CS), (&__pyx_v_accuracy), (&__pyx_v_requires_initialization)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 785, __pyx_L1_error)

  /* "cython/core/manifold.pyx":790
 *                      &accuracy,
 *                      &requires_initialization)
 *         if not is_known:             # <<<<<<<<<<<<<<
 *             raise ValueError("The Chern-Simons invariant isn't "
 *                              "currently known.")
*/
  __pyx_t_1 = (!(__pyx_v_is_known != 0));
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":791
 *                      &requires_initialization)
 *         if not is_known:
 *             raise ValueError("The Chern-Simons invariant isn't "             # <<<<<<<<<<<<<<
 *                              "currently known.")
 *         cs = Real2Number(CS)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Chern_Simons_invariant_isn_t};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 791, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 791, __pyx_L1_error)

    /* "cython/core/manifold.pyx":790
 *                      &accuracy,
 *                      &requires_initialization)
 *         if not is_known:             # <<<<<<<<<<<<<<
 *             raise ValueError("The Chern-Simons invariant isn't "
 *                              "currently known.")
*/
  }

  /* "cython/core/manifold.pyx":793
 *             raise ValueError("The Chern-Simons invariant isn't "
 *                              "currently known.")
 *         cs = Real2Number(CS)             # <<<<<<<<<<<<<<
 *         cs.accuracy = accuracy
 *         return cs
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_Real2Number(__pyx_v_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":794
 *                              "currently known.")
 *         cs = Real2Number(CS)
 *         cs.accuracy = accuracy             # <<<<<<<<<<<<<<
 *         return cs
 * 
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cs, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_2) < 0) __PYX_ERR(2, 794, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":795
 *         cs = Real2Number(CS)
 *         cs.accuracy = accuracy
 *         return cs             # <<<<<<<<<<<<<<
 * 
 *     cdef _chern_simons(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cs);
  __pyx_r = __pyx_v_cs;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":773
 *             return self._number_(vol)
 * 
 *     cdef _old_chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Chern-Simons invariant as a Number.  The value
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.Manifold._old_chern_simons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":797
 *         return cs
 * 
 *     cdef _chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Chern-Simons invariant as a Number.  The value
*/

static PyObject *__pyx_f_8SnapPyHP_8Manifold__chern_simons(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  Complex __pyx_v_volume;
  __pyx_t_8SnapPyHP_Real __pyx_v_cs_value;
  int __pyx_v_accuracy;
  PyObject *__pyx_v_solution_type = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  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("_chern_simons", 0);

  /* "cython/core/manifold.pyx":806
 *         cdef Real cs_value
 *         cdef int accuracy
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         solution_type = self.solution_type()
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":807
 *         cdef int accuracy
 *         if self.c_triangulation is NULL:
 *             return 0             # <<<<<<<<<<<<<<
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_r = __pyx_mstate_global->__pyx_int_0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":806
 *         cdef Real cs_value
 *         cdef int accuracy
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         solution_type = self.solution_type()
*/
  }

  /* "cython/core/manifold.pyx":808
 *         if self.c_triangulation is NULL:
 *             return 0
 *         solution_type = self.solution_type()             # <<<<<<<<<<<<<<
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('The solution type is: %s' % solution_type)
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_solution_type, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_solution_type = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":809
 *             return 0
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):             # <<<<<<<<<<<<<<
 *             raise ValueError('The solution type is: %s' % solution_type)
 *         if True not in self.cusp_info('is_complete'):
*/
  __Pyx_INCREF(__pyx_v_solution_type);
  __pyx_t_2 = __pyx_v_solution_type;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_not_attempted, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 809, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_no_solution_found, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 809, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_t_1;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/manifold.pyx":810
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('The solution type is: %s' % solution_type)             # <<<<<<<<<<<<<<
 *         if True not in self.cusp_info('is_complete'):
 *             result = self._old_chern_simons()
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_The_solution_type_is_s, __pyx_v_solution_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 810, __pyx_L1_error)

    /* "cython/core/manifold.pyx":809
 *             return 0
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):             # <<<<<<<<<<<<<<
 *             raise ValueError('The solution type is: %s' % solution_type)
 *         if True not in self.cusp_info('is_complete'):
*/
  }

  /* "cython/core/manifold.pyx":811
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('The solution type is: %s' % solution_type)
 *         if True not in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *             result = self._old_chern_simons()
 *         else:
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_complete};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(Py_True, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "cython/core/manifold.pyx":812
 *             raise ValueError('The solution type is: %s' % solution_type)
 *         if True not in self.cusp_info('is_complete'):
 *             result = self._old_chern_simons()             # <<<<<<<<<<<<<<
 *         else:
 *             self._cusped_complex_volume(&volume, &accuracy)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_old_chern_simons(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":811
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('The solution type is: %s' % solution_type)
 *         if True not in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *             result = self._old_chern_simons()
 *         else:
*/
    goto __pyx_L7;
  }

  /* "cython/core/manifold.pyx":814
 *             result = self._old_chern_simons()
 *         else:
 *             self._cusped_complex_volume(&volume, &accuracy)             # <<<<<<<<<<<<<<
 *             cs_value = volume.imag / PI_SQUARED_BY_2
 *             result = Real2Number(cs_value)
*/
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_cusped_complex_volume(__pyx_v_self, (&__pyx_v_volume), (&__pyx_v_accuracy)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":815
 *         else:
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             cs_value = volume.imag / PI_SQUARED_BY_2             # <<<<<<<<<<<<<<
 *             result = Real2Number(cs_value)
 *             result.accuracy = accuracy - 1 if accuracy else None
*/
    __pyx_v_cs_value = (__pyx_v_volume.imag / PI_SQUARED_BY_2);

    /* "cython/core/manifold.pyx":816
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             cs_value = volume.imag / PI_SQUARED_BY_2
 *             result = Real2Number(cs_value)             # <<<<<<<<<<<<<<
 *             result.accuracy = accuracy - 1 if accuracy else None
 *             set_CS_value(self.c_triangulation, cs_value)
*/
    __pyx_t_2 = __pyx_f_8SnapPyHP_Real2Number(__pyx_v_cs_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":817
 *             cs_value = volume.imag / PI_SQUARED_BY_2
 *             result = Real2Number(cs_value)
 *             result.accuracy = accuracy - 1 if accuracy else None             # <<<<<<<<<<<<<<
 *             set_CS_value(self.c_triangulation, cs_value)
 *         return result
*/
    __pyx_t_5 = (__pyx_v_accuracy != 0);
    if (__pyx_t_5) {
      __pyx_t_6 = __Pyx_PyLong_From_long((__pyx_v_accuracy - 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_2 = Py_None;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_2) < 0) __PYX_ERR(2, 817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":818
 *             result = Real2Number(cs_value)
 *             result.accuracy = accuracy - 1 if accuracy else None
 *             set_CS_value(self.c_triangulation, cs_value)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
    set_CS_value(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_cs_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 818, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "cython/core/manifold.pyx":819
 *             result.accuracy = accuracy - 1 if accuracy else None
 *             set_CS_value(self.c_triangulation, cs_value)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def chern_simons(self, accuracy = False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":797
 *         return cs
 * 
 *     cdef _chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Chern-Simons invariant as a Number.  The value
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.Manifold._chern_simons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_solution_type);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":821
 *         return result
 * 
 *     def chern_simons(self, accuracy = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Chern-Simons invariant of the manifold (normalized by
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_45chern_simons(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_8SnapPyHP_8Manifold_44chern_simons, "\n        Returns the Chern-Simons invariant of the manifold (normalized by\n        dividing it by :math:`2 \\pi^2`), if it is known.\n\n        >>> M = Manifold('m015')\n        >>> M.chern_simons() # doctest: +NUMERIC6\n        -0.15320413\n\n        The return value has an extra attribute, accuracy, which\n        is the number of digits of accuracy as *estimated* by SnapPea.\n\n        >>> cs, accuracy = M.chern_simons(accuracy = True)\n        >>> accuracy in (8, 9, 56, 57) # Low and High precision\n        True\n\n        By default, when the manifold has at least one cusp, Zickert's\n        algorithm is used; when the manifold is closed we use SnapPea's\n        original algorithm, which is based on Meyerhoff-Hodgson-Neumann.\n\n        Note: When computing the Chern-Simons invariant of a closed\n        manifold, one must sometimes compute it first for the unfilled\n        manifold so as to initialize SnapPea's internals.  For instance,\n\n        >>> M = Manifold('5_2')\n        >>> M.chern_simons() # doctest: +NUMERIC6\n        -0.15320413\n        >>> M.dehn_fill( (1,2) )\n        >>> M.chern_simons() # doctest: +NUMERIC6\n        0.07731787\n\n        works, but will fail with\n        ``ValueError: The Chern-Simons invariant isn't currently known.``\n        if the first call to chern_simons is not made.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_45chern_simons = {"chern_simons", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_45chern_simons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_44chern_simons};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_45chern_simons(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_accuracy = 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("chern_simons (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_accuracy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 821, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "chern_simons", 0) < 0) __PYX_ERR(2, 821, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_accuracy = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chern_simons", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 821, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.chern_simons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_44chern_simons(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_accuracy);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_44chern_simons(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_accuracy) {
  PyObject *__pyx_v_cs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("chern_simons", 0);

  /* "cython/core/manifold.pyx":857
 *         """
 * 
 *         cs = self._chern_simons()             # <<<<<<<<<<<<<<
 *         if accuracy:
 *             return (self._number_(cs), cs.accuracy)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_chern_simons(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":858
 * 
 *         cs = self._chern_simons()
 *         if accuracy:             # <<<<<<<<<<<<<<
 *             return (self._number_(cs), cs.accuracy)
 *         else:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_accuracy); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 858, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/manifold.pyx":859
 *         cs = self._chern_simons()
 *         if accuracy:
 *             return (self._number_(cs), cs.accuracy)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._number_(cs)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_cs};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cs, __pyx_mstate_global->__pyx_n_u_accuracy); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 859, __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) != (0)) __PYX_ERR(2, 859, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(2, 859, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":858
 * 
 *         cs = self._chern_simons()
 *         if accuracy:             # <<<<<<<<<<<<<<
 *             return (self._number_(cs), cs.accuracy)
 *         else:
*/
  }

  /* "cython/core/manifold.pyx":861
 *             return (self._number_(cs), cs.accuracy)
 *         else:
 *             return self._number_(cs)             # <<<<<<<<<<<<<<
 * 
 *     def without_hyperbolic_structure(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_cs};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":821
 *         return result
 * 
 *     def chern_simons(self, accuracy = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Chern-Simons invariant of the manifold (normalized by
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Manifold.chern_simons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":863
 *             return self._number_(cs)
 * 
 *     def without_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns self as a :class:`Triangulation`, forgetting the hyperbolic
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_47without_hyperbolic_structure(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_8SnapPyHP_8Manifold_46without_hyperbolic_structure, "\n        Returns self as a :class:`Triangulation`, forgetting the hyperbolic\n        structure in the process.\n\n        >>> M = Manifold('9_42')\n        >>> T = M.without_hyperbolic_structure()\n        >>> hasattr(T, 'volume')\n        False\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_47without_hyperbolic_structure = {"without_hyperbolic_structure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_47without_hyperbolic_structure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_46without_hyperbolic_structure};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_47without_hyperbolic_structure(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("without_hyperbolic_structure (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("without_hyperbolic_structure", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("without_hyperbolic_structure", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_46without_hyperbolic_structure(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_46without_hyperbolic_structure(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("without_hyperbolic_structure", 0);

  /* "cython/core/manifold.pyx":873
 *         False
 *         """
 *         return Triangulation_from_Manifold(self)             # <<<<<<<<<<<<<<
 * 
 *     def _polish_hyperbolic_structures(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Triangulation_from_Manifold); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":863
 *             return self._number_(cs)
 * 
 *     def without_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns self as a :class:`Triangulation`, forgetting the hyperbolic
*/

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

/* "cython/core/manifold.pyx":875
 *         return Triangulation_from_Manifold(self)
 * 
 *     def _polish_hyperbolic_structures(self):             # <<<<<<<<<<<<<<
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_49_polish_hyperbolic_structures(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_49_polish_hyperbolic_structures = {"_polish_hyperbolic_structures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_49_polish_hyperbolic_structures, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_49_polish_hyperbolic_structures(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("_polish_hyperbolic_structures (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_polish_hyperbolic_structures", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_polish_hyperbolic_structures", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_48_polish_hyperbolic_structures(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_48_polish_hyperbolic_structures(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_polish_hyperbolic_structures", 0);

  /* "cython/core/manifold.pyx":876
 * 
 *     def _polish_hyperbolic_structures(self):
 *         polish_hyperbolic_structures(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,
*/
  polish_hyperbolic_structures(__pyx_v_self->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":875
 *         return Triangulation_from_Manifold(self)
 * 
 *     def _polish_hyperbolic_structures(self):             # <<<<<<<<<<<<<<
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
*/

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

/* "cython/core/manifold.pyx":878
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,             # <<<<<<<<<<<<<<
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_51tetrahedra_shapes(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_8SnapPyHP_8Manifold_50tetrahedra_shapes, "\n        Gives the shapes of the tetrahedra in the current solution to\n        the gluing equations.  Returns a list containing one info object\n        for each tetrahedron.  The keys are:\n\n        - rect : the shape of the tetrahedron, as a point in the\n          complex plane.\n\n        - log : the log of the shape\n\n        - accuracies: a list of the approximate accuracies of the\n          shapes, in order (rect re, rect im, log re, log im)\n\n        If the optional variable 'part' is set to one of the above,\n        then the function returns only that component of the data.\n\n        If the flag 'fixed_alignment' is set to False, then the edges\n        used to report the shape parameters are chosen so as to\n        normalize the triangle.\n\n        >>> M = Manifold('m015')\n        >>> M.tetrahedra_shapes(part='rect') # doctest: +NUMERIC6\n        [0.66235898 + 0.56227951*I, 0.66235898 + 0.56227951*I, 0.66235898 + 0.56227951*I]\n        >>> M.tetrahedra_shapes() #doctest:+SKIP\n        [{'accuracies': (11, 11, 12, 11), 'log': -0.14059979 + 0.70385772*I, 'rect': 0.66235898 + 0.56227951*I},\n         {'accuracies': (11, 11, 11, 11), 'log': -0.14059979 + 0.70385772*I, 'rect': 0.66235898 + 0.56227951*I},\n         {'accuracies': (11, 11, 11, 11), 'log': -0.14059979 + 0.70385772*I, 'rect': 0.66235898 + 0.56227951*I}]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_51tetrahedra_shapes = {"tetrahedra_shapes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_51tetrahedra_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_50tetrahedra_shapes};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_51tetrahedra_shapes(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_part = 0;
  PyObject *__pyx_v_fixed_alignment = 0;
  PyObject *__pyx_v_bits_prec = 0;
  PyObject *__pyx_v_dec_prec = 0;
  PyObject *__pyx_v_intervals = 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("tetrahedra_shapes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_part,&__pyx_mstate_global->__pyx_n_u_fixed_alignment,&__pyx_mstate_global->__pyx_n_u_bits_prec,&__pyx_mstate_global->__pyx_n_u_dec_prec,&__pyx_mstate_global->__pyx_n_u_intervals,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 878, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tetrahedra_shapes", 0) < 0) __PYX_ERR(2, 878, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":879
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,
 *                           bits_prec=None, dec_prec=None,             # <<<<<<<<<<<<<<
 *                           intervals=False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/manifold.pyx":880
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):             # <<<<<<<<<<<<<<
 *         """
 *         Gives the shapes of the tetrahedra in the current solution to
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/manifold.pyx":878
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,             # <<<<<<<<<<<<<<
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":879
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,
 *                           bits_prec=None, dec_prec=None,             # <<<<<<<<<<<<<<
 *                           intervals=False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/manifold.pyx":880
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):             # <<<<<<<<<<<<<<
 *         """
 *         Gives the shapes of the tetrahedra in the current solution to
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_part = values[0];
    __pyx_v_fixed_alignment = values[1];
    __pyx_v_bits_prec = values[2];
    __pyx_v_dec_prec = values[3];
    __pyx_v_intervals = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tetrahedra_shapes", 0, 0, 5, __pyx_nargs); __PYX_ERR(2, 878, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_50tetrahedra_shapes(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_part, __pyx_v_fixed_alignment, __pyx_v_bits_prec, __pyx_v_dec_prec, __pyx_v_intervals);

  /* "cython/core/manifold.pyx":878
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,             # <<<<<<<<<<<<<<
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_50tetrahedra_shapes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_part, PyObject *__pyx_v_fixed_alignment, PyObject *__pyx_v_bits_prec, PyObject *__pyx_v_dec_prec, PyObject *__pyx_v_intervals) {
  __pyx_t_8SnapPyHP_Real __pyx_v_rect_re;
  __pyx_t_8SnapPyHP_Real __pyx_v_rect_im;
  __pyx_t_8SnapPyHP_Real __pyx_v_log_re;
  __pyx_t_8SnapPyHP_Real __pyx_v_log_im;
  int __pyx_v_acc_rec_re;
  int __pyx_v_acc_rec_im;
  int __pyx_v_acc_log_re;
  int __pyx_v_acc_log_im;
  Boolean __pyx_v_is_geometric;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_shapes = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_rect_shape = NULL;
  PyObject *__pyx_v_log_shape = NULL;
  PyObject *__pyx_v_engine = NULL;
  PyObject *__pyx_9genexpr48__pyx_v_a = NULL;
  PyObject *__pyx_9genexpr49__pyx_v_a = NULL;
  PyObject *__pyx_9genexpr50__pyx_v_z = NULL;
  PyObject *__pyx_9genexpr51__pyx_v_a = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  Boolean __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tetrahedra_shapes", 0);

  /* "cython/core/manifold.pyx":913
 *         cdef Boolean is_geometric
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return []
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":914
 * 
 *         if self.c_triangulation is NULL:
 *             return []             # <<<<<<<<<<<<<<
 * 
 *         # The SnapPea kernel itself supports non-orientable manifolds,
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":913
 *         cdef Boolean is_geometric
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return []
 * 
*/
  }

  /* "cython/core/manifold.pyx":919
 *         # but the extensions in snap and verify don't.
 *         # Thus work in double cover and use every other shape.
 *         if not self.is_orientable() and (bits_prec or dec_prec or intervals):             # <<<<<<<<<<<<<<
 *             result = self.orientation_cover().tetrahedra_shapes(
 *                                        part=part,
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_bits_prec); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 919, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_dec_prec); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 919, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_intervals); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 919, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":920
 *         # Thus work in double cover and use every other shape.
 *         if not self.is_orientable() and (bits_prec or dec_prec or intervals):
 *             result = self.orientation_cover().tetrahedra_shapes(             # <<<<<<<<<<<<<<
 *                                        part=part,
 *                                        fixed_alignment=fixed_alignment,
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_orientation_cover, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_3 = __pyx_t_7;
    __Pyx_INCREF(__pyx_t_3);

    /* "cython/core/manifold.pyx":924
 *                                        fixed_alignment=fixed_alignment,
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]             # <<<<<<<<<<<<<<
 *             if part is not None:
 *                 return result
*/
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_3, NULL};
      __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_part, __pyx_v_part, __pyx_t_8, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 920, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fixed_alignment, __pyx_v_fixed_alignment, __pyx_t_8, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 920, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bits_prec, __pyx_v_bits_prec, __pyx_t_8, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 920, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dec_prec, __pyx_v_dec_prec, __pyx_t_8, __pyx_callargs+1, 3) < 0) __PYX_ERR(2, 920, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_intervals, __pyx_v_intervals, __pyx_t_8, __pyx_callargs+1, 4) < 0) __PYX_ERR(2, 920, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_tetrahedra_shapes, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_slice[3]); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_result = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cython/core/manifold.pyx":925
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]
 *             if part is not None:             # <<<<<<<<<<<<<<
 *                 return result
 *             else:
*/
    __pyx_t_1 = (__pyx_v_part != Py_None);
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":926
 *                                        intervals=intervals)[::2]
 *             if part is not None:
 *                 return result             # <<<<<<<<<<<<<<
 *             else:
 *                 return ListOnePerLine(result)
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "cython/core/manifold.pyx":925
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]
 *             if part is not None:             # <<<<<<<<<<<<<<
 *                 return result
 *             else:
*/
    }

    /* "cython/core/manifold.pyx":928
 *                 return result
 *             else:
 *                 return ListOnePerLine(result)             # <<<<<<<<<<<<<<
 * 
 *         result = []
*/
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ListOnePerLine); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_result};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 928, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;
    }

    /* "cython/core/manifold.pyx":919
 *         # but the extensions in snap and verify don't.
 *         # Thus work in double cover and use every other shape.
 *         if not self.is_orientable() and (bits_prec or dec_prec or intervals):             # <<<<<<<<<<<<<<
 *             result = self.orientation_cover().tetrahedra_shapes(
 *                                        part=part,
*/
  }

  /* "cython/core/manifold.pyx":930
 *                 return ListOnePerLine(result)
 * 
 *         result = []             # <<<<<<<<<<<<<<
 *         if bits_prec or dec_prec:
 *             if fixed_alignment is False:
*/
  __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_result = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "cython/core/manifold.pyx":931
 * 
 *         result = []
 *         if bits_prec or dec_prec:             # <<<<<<<<<<<<<<
 *             if fixed_alignment is False:
 *                 raise ValueError(
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_bits_prec); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 931, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_dec_prec); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 931, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_6;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":932
 *         result = []
 *         if bits_prec or dec_prec:
 *             if fixed_alignment is False:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'High precision shapes must be computed '
*/
    __pyx_t_1 = (__pyx_v_fixed_alignment == Py_False);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":933
 *         if bits_prec or dec_prec:
 *             if fixed_alignment is False:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'High precision shapes must be computed '
 *                     'in the fixed alignment')
*/
      __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_2 = __pyx_builtin_ValueError; 
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_High_precision_shapes_must_be_co};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 933, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(2, 933, __pyx_L1_error)

      /* "cython/core/manifold.pyx":932
 *         result = []
 *         if bits_prec or dec_prec:
 *             if fixed_alignment is False:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'High precision shapes must be computed '
*/
    }

    /* "cython/core/manifold.pyx":936
 *                     'High precision shapes must be computed '
 *                     'in the fixed alignment')
 *             shapes = snap.polished_tetrahedra_shapes(             # <<<<<<<<<<<<<<
 *                 self, dec_prec=dec_prec, bits_prec=bits_prec,
 *                 ignore_solution_type=True)
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_snap); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_polished_tetrahedra_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/manifold.pyx":938
 *             shapes = snap.polished_tetrahedra_shapes(
 *                 self, dec_prec=dec_prec, bits_prec=bits_prec,
 *                 ignore_solution_type=True)             # <<<<<<<<<<<<<<
 *             for z in shapes:
 *                 result.append(ShapeInfo(rect=z,
*/
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
      __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 936, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dec_prec, __pyx_v_dec_prec, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(2, 936, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bits_prec, __pyx_v_bits_prec, __pyx_t_8, __pyx_callargs+2, 1) < 0) __PYX_ERR(2, 936, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_solution_type, Py_True, __pyx_t_8, __pyx_callargs+2, 2) < 0) __PYX_ERR(2, 936, __pyx_L1_error)
      __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 936, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_v_shapes = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cython/core/manifold.pyx":939
 *                 self, dec_prec=dec_prec, bits_prec=bits_prec,
 *                 ignore_solution_type=True)
 *             for z in shapes:             # <<<<<<<<<<<<<<
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),
*/
    if (likely(PyList_CheckExact(__pyx_v_shapes)) || PyTuple_CheckExact(__pyx_v_shapes)) {
      __pyx_t_7 = __pyx_v_shapes; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 939, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 939, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 939, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 939, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 939, __pyx_L1_error)
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_7);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 939, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":940
 *                 ignore_solution_type=True)
 *             for z in shapes:
 *                 result.append(ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))
*/
      __pyx_t_8 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ShapeInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 940, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/manifold.pyx":941
 *             for z in shapes:
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),             # <<<<<<<<<<<<<<
 *                                         accuracies=(None, None, None, None)))
 *         else:
*/
      __pyx_t_12 = __pyx_v_z;
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
        __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_log, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 941, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }

      /* "cython/core/manifold.pyx":942
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(self.num_tetrahedra()):
*/
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_8);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_8, NULL};
        __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 940, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rect, __pyx_v_z, __pyx_t_12, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 940, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_log, __pyx_t_11, __pyx_t_12, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 940, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_accuracies, __pyx_mstate_global->__pyx_tuple[20], __pyx_t_12, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 940, __pyx_L1_error)
        __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 940, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }

      /* "cython/core/manifold.pyx":940
 *                 ignore_solution_type=True)
 *             for z in shapes:
 *                 result.append(ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))
*/
      __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 940, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":939
 *                 self, dec_prec=dec_prec, bits_prec=bits_prec,
 *                 ignore_solution_type=True)
 *             for z in shapes:             # <<<<<<<<<<<<<<
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),
*/
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/manifold.pyx":931
 * 
 *         result = []
 *         if bits_prec or dec_prec:             # <<<<<<<<<<<<<<
 *             if fixed_alignment is False:
 *                 raise ValueError(
*/
    goto __pyx_L10;
  }

  /* "cython/core/manifold.pyx":944
 *                                         accuracies=(None, None, None, None)))
 *         else:
 *             for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *                 get_tet_shape(self.c_triangulation, i, filled, fixed_alignment,
 *                               &rect_re, &rect_im, &log_re, &log_im,
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_2 = __pyx_builtin_range; 
    __pyx_t_11 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_12};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 944, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 944, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 944, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9));
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 944, __pyx_L1_error)
      } else {
        __pyx_t_7 = __pyx_t_10(__pyx_t_2);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 944, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":945
 *         else:
 *             for i in range(self.num_tetrahedra()):
 *                 get_tet_shape(self.c_triangulation, i, filled, fixed_alignment,             # <<<<<<<<<<<<<<
 *                               &rect_re, &rect_im, &log_re, &log_im,
 *                               &acc_rec_re, &acc_rec_im,
*/
      __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_v_i); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 945, __pyx_L1_error)
      __pyx_t_15 = __Pyx_PyLong_As_Boolean(__pyx_v_fixed_alignment); if (unlikely((__pyx_t_15 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(2, 945, __pyx_L1_error)

      /* "cython/core/manifold.pyx":949
 *                               &acc_rec_re, &acc_rec_im,
 *                               &acc_log_re, &acc_log_im,
 *                               &is_geometric)             # <<<<<<<<<<<<<<
 * 
 *                 rect_shape=Number(RealImag2gen(rect_re, rect_im))
*/
      get_tet_shape(__pyx_v_self->__pyx_base.c_triangulation, __pyx_t_14, filled, __pyx_t_15, (&__pyx_v_rect_re), (&__pyx_v_rect_im), (&__pyx_v_log_re), (&__pyx_v_log_im), (&__pyx_v_acc_rec_re), (&__pyx_v_acc_rec_im), (&__pyx_v_acc_log_re), (&__pyx_v_acc_log_im), (&__pyx_v_is_geometric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 945, __pyx_L1_error)

      /* "cython/core/manifold.pyx":951
 *                               &is_geometric)
 * 
 *                 rect_shape=Number(RealImag2gen(rect_re, rect_im))             # <<<<<<<<<<<<<<
 *                 rect_shape.accuracy=min(acc_rec_re, acc_rec_im)
 *                 log_shape=Number(RealImag2gen(log_re, log_im))
*/
      __pyx_t_12 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 951, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = __pyx_f_8SnapPyHP_RealImag2gen(__pyx_v_rect_re, __pyx_v_rect_im); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 951, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_12);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 951, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_rect_shape, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":952
 * 
 *                 rect_shape=Number(RealImag2gen(rect_re, rect_im))
 *                 rect_shape.accuracy=min(acc_rec_re, acc_rec_im)             # <<<<<<<<<<<<<<
 *                 log_shape=Number(RealImag2gen(log_re, log_im))
 *                 log_shape.accuracy=min(acc_log_re, acc_log_im)
*/
      __pyx_t_14 = __pyx_v_acc_rec_im;
      __pyx_t_16 = __pyx_v_acc_rec_re;
      __pyx_t_1 = (__pyx_t_14 < __pyx_t_16);
      if (__pyx_t_1) {
        __pyx_t_17 = __pyx_t_14;
      } else {
        __pyx_t_17 = __pyx_t_16;
      }
      __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 952, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect_shape, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_7) < 0) __PYX_ERR(2, 952, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":953
 *                 rect_shape=Number(RealImag2gen(rect_re, rect_im))
 *                 rect_shape.accuracy=min(acc_rec_re, acc_rec_im)
 *                 log_shape=Number(RealImag2gen(log_re, log_im))             # <<<<<<<<<<<<<<
 *                 log_shape.accuracy=min(acc_log_re, acc_log_im)
 *                 if part in ['rect', 'log', 'accuracies']:
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __pyx_f_8SnapPyHP_RealImag2gen(__pyx_v_log_re, __pyx_v_log_im); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_12};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 953, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_log_shape, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":954
 *                 rect_shape.accuracy=min(acc_rec_re, acc_rec_im)
 *                 log_shape=Number(RealImag2gen(log_re, log_im))
 *                 log_shape.accuracy=min(acc_log_re, acc_log_im)             # <<<<<<<<<<<<<<
 *                 if part in ['rect', 'log', 'accuracies']:
 *                     # Don't compute volumes as they will be thrown away.
*/
      __pyx_t_17 = __pyx_v_acc_log_im;
      __pyx_t_14 = __pyx_v_acc_log_re;
      __pyx_t_1 = (__pyx_t_17 < __pyx_t_14);
      if (__pyx_t_1) {
        __pyx_t_16 = __pyx_t_17;
      } else {
        __pyx_t_16 = __pyx_t_14;
      }
      __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_log_shape, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_7) < 0) __PYX_ERR(2, 954, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":955
 *                 log_shape=Number(RealImag2gen(log_re, log_im))
 *                 log_shape.accuracy=min(acc_log_re, acc_log_im)
 *                 if part in ['rect', 'log', 'accuracies']:             # <<<<<<<<<<<<<<
 *                     # Don't compute volumes as they will be thrown away.
 *                     result.append(ShapeInfo(
*/
      __Pyx_INCREF(__pyx_v_part);
      __pyx_t_7 = __pyx_v_part;
      __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_rect, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 955, __pyx_L1_error)
      if (!__pyx_t_6) {
      } else {
        __pyx_t_1 = __pyx_t_6;
        goto __pyx_L20_bool_binop_done;
      }
      __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_log, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 955, __pyx_L1_error)
      if (!__pyx_t_6) {
      } else {
        __pyx_t_1 = __pyx_t_6;
        goto __pyx_L20_bool_binop_done;
      }
      __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_accuracies, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 955, __pyx_L1_error)
      __pyx_t_1 = __pyx_t_6;
      __pyx_L20_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = __pyx_t_1;
      if (__pyx_t_6) {

        /* "cython/core/manifold.pyx":957
 *                 if part in ['rect', 'log', 'accuracies']:
 *                     # Don't compute volumes as they will be thrown away.
 *                     result.append(ShapeInfo(             # <<<<<<<<<<<<<<
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
*/
        __pyx_t_11 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ShapeInfo); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 957, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);

        /* "cython/core/manifold.pyx":958
 *                     # Don't compute volumes as they will be thrown away.
 *                     result.append(ShapeInfo(
 *                             rect=self._number_(rect_shape),             # <<<<<<<<<<<<<<
 *                             log=self._number_(log_shape),
 *                             accuracies=(acc_rec_re, acc_rec_im,
*/
        __pyx_t_8 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_rect_shape};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 958, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }

        /* "cython/core/manifold.pyx":959
 *                     result.append(ShapeInfo(
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),             # <<<<<<<<<<<<<<
 *                             accuracies=(acc_rec_re, acc_rec_im,
 *                                         acc_log_re, acc_log_im)))
*/
        __pyx_t_18 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_18);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_v_log_shape};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 959, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }

        /* "cython/core/manifold.pyx":960
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
 *                             accuracies=(acc_rec_re, acc_rec_im,             # <<<<<<<<<<<<<<
 *                                         acc_log_re, acc_log_im)))
 *                 else:
*/
        __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_acc_rec_re); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 960, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
        __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_acc_rec_im); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 960, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);

        /* "cython/core/manifold.pyx":961
 *                             log=self._number_(log_shape),
 *                             accuracies=(acc_rec_re, acc_rec_im,
 *                                         acc_log_re, acc_log_im)))             # <<<<<<<<<<<<<<
 *                 else:
 *                     result.append(ShapeInfo(
*/
        __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_acc_log_re); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 961, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_acc_log_im); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 961, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);

        /* "cython/core/manifold.pyx":960
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
 *                             accuracies=(acc_rec_re, acc_rec_im,             # <<<<<<<<<<<<<<
 *                                         acc_log_re, acc_log_im)))
 *                 else:
*/
        __pyx_t_22 = PyTuple_New(4); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 960, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_22);
        __Pyx_GIVEREF(__pyx_t_18);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_18) != (0)) __PYX_ERR(2, 960, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_19);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_19) != (0)) __PYX_ERR(2, 960, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_20);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_20) != (0)) __PYX_ERR(2, 960, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_21);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_t_21) != (0)) __PYX_ERR(2, 960, __pyx_L1_error);
        __pyx_t_18 = 0;
        __pyx_t_19 = 0;
        __pyx_t_20 = 0;
        __pyx_t_21 = 0;
        __pyx_t_4 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_11);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_4 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_11, NULL};
          __pyx_t_21 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 957, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_21);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rect, __pyx_t_3, __pyx_t_21, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 957, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_log, __pyx_t_8, __pyx_t_21, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 957, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_accuracies, __pyx_t_22, __pyx_t_21, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 957, __pyx_L1_error)
          __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_12, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_21);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 957, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }

        /* "cython/core/manifold.pyx":957
 *                 if part in ['rect', 'log', 'accuracies']:
 *                     # Don't compute volumes as they will be thrown away.
 *                     result.append(ShapeInfo(             # <<<<<<<<<<<<<<
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
*/
        __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cython/core/manifold.pyx":955
 *                 log_shape=Number(RealImag2gen(log_re, log_im))
 *                 log_shape.accuracy=min(acc_log_re, acc_log_im)
 *                 if part in ['rect', 'log', 'accuracies']:             # <<<<<<<<<<<<<<
 *                     # Don't compute volumes as they will be thrown away.
 *                     result.append(ShapeInfo(
*/
        goto __pyx_L19;
      }

      /* "cython/core/manifold.pyx":963
 *                                         acc_log_re, acc_log_im)))
 *                 else:
 *                     result.append(ShapeInfo(             # <<<<<<<<<<<<<<
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
*/
      /*else*/ {
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_ShapeInfo); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 963, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);

        /* "cython/core/manifold.pyx":964
 *                 else:
 *                     result.append(ShapeInfo(
 *                             rect=self._number_(rect_shape),             # <<<<<<<<<<<<<<
 *                             log=self._number_(log_shape),
 *                             volume=rect_shape.volume(),
*/
        __pyx_t_8 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_rect_shape};
          __pyx_t_22 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 964, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
        }

        /* "cython/core/manifold.pyx":965
 *                     result.append(ShapeInfo(
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),             # <<<<<<<<<<<<<<
 *                             volume=rect_shape.volume(),
 *                             accuracies=(acc_rec_re, acc_rec_im,
*/
        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_log_shape};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 965, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }

        /* "cython/core/manifold.pyx":966
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
 *                             volume=rect_shape.volume(),             # <<<<<<<<<<<<<<
 *                             accuracies=(acc_rec_re, acc_rec_im,
 *                                         acc_log_re, acc_log_im)))
*/
        __pyx_t_11 = __pyx_v_rect_shape;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_volume, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 966, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }

        /* "cython/core/manifold.pyx":967
 *                             log=self._number_(log_shape),
 *                             volume=rect_shape.volume(),
 *                             accuracies=(acc_rec_re, acc_rec_im,             # <<<<<<<<<<<<<<
 *                                         acc_log_re, acc_log_im)))
 * 
*/
        __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_acc_rec_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 967, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_acc_rec_im); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 967, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);

        /* "cython/core/manifold.pyx":968
 *                             volume=rect_shape.volume(),
 *                             accuracies=(acc_rec_re, acc_rec_im,
 *                                         acc_log_re, acc_log_im)))             # <<<<<<<<<<<<<<
 * 
 *         if intervals:
*/
        __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_acc_log_re); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_acc_log_im); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);

        /* "cython/core/manifold.pyx":967
 *                             log=self._number_(log_shape),
 *                             volume=rect_shape.volume(),
 *                             accuracies=(acc_rec_re, acc_rec_im,             # <<<<<<<<<<<<<<
 *                                         acc_log_re, acc_log_im)))
 * 
*/
        __pyx_t_23 = PyTuple_New(4); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 967, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_23);
        __Pyx_GIVEREF(__pyx_t_11);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_11) != (0)) __PYX_ERR(2, 967, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_20);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_20) != (0)) __PYX_ERR(2, 967, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_19);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_19) != (0)) __PYX_ERR(2, 967, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_18);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_18) != (0)) __PYX_ERR(2, 967, __pyx_L1_error);
        __pyx_t_11 = 0;
        __pyx_t_20 = 0;
        __pyx_t_19 = 0;
        __pyx_t_18 = 0;
        __pyx_t_4 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_21))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_21);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_21);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_21, __pyx__function);
          __pyx_t_4 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_12, NULL};
          __pyx_t_18 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 963, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rect, __pyx_t_22, __pyx_t_18, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 963, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_log, __pyx_t_8, __pyx_t_18, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 963, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_volume, __pyx_t_3, __pyx_t_18, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 963, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_accuracies, __pyx_t_23, __pyx_t_18, __pyx_callargs+1, 3) < 0) __PYX_ERR(2, 963, __pyx_L1_error)
          __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_21, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_18);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 963, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }

        /* "cython/core/manifold.pyx":963
 *                                         acc_log_re, acc_log_im)))
 *                 else:
 *                     result.append(ShapeInfo(             # <<<<<<<<<<<<<<
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
*/
        __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 963, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L19:;

      /* "cython/core/manifold.pyx":944
 *                                         accuracies=(None, None, None, None)))
 *         else:
 *             for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *                 get_tet_shape(self.c_triangulation, i, filled, fixed_alignment,
 *                               &rect_re, &rect_im, &log_re, &log_im,
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L10:;

  /* "cython/core/manifold.pyx":970
 *                                         acc_log_re, acc_log_im)))
 * 
 *         if intervals:             # <<<<<<<<<<<<<<
 *             if bits_prec or dec_prec:
 *                 engine = verify.CertifiedShapesEngine(
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_intervals); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 970, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":971
 * 
 *         if intervals:
 *             if bits_prec or dec_prec:             # <<<<<<<<<<<<<<
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bits_prec); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 971, __pyx_L1_error)
    if (!__pyx_t_1) {
    } else {
      __pyx_t_6 = __pyx_t_1;
      goto __pyx_L26_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dec_prec); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 971, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_1;
    __pyx_L26_bool_binop_done:;
    if (__pyx_t_6) {

      /* "cython/core/manifold.pyx":972
 *         if intervals:
 *             if bits_prec or dec_prec:
 *                 engine = verify.CertifiedShapesEngine(             # <<<<<<<<<<<<<<
 *                     self, [a['rect'] for a in result],
 *                     dec_prec=dec_prec, bits_prec=bits_prec)
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_verify); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_CertifiedShapesEngine); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;

      /* "cython/core/manifold.pyx":973
 *             if bits_prec or dec_prec:
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],             # <<<<<<<<<<<<<<
 *                     dec_prec=dec_prec, bits_prec=bits_prec)
 *             else:
*/
      { /* enter inner scope */
        __pyx_t_21 = PyList_New(0); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 973, __pyx_L30_error)
        __Pyx_GOTREF(__pyx_t_21);
        if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
          __pyx_t_23 = __pyx_v_result; __Pyx_INCREF(__pyx_t_23);
          __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_23 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 973, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_23);
          __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_23); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 973, __pyx_L30_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_23))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_23);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 973, __pyx_L30_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_23, __pyx_t_9);
              ++__pyx_t_9;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_23);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 973, __pyx_L30_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_23, __pyx_t_9));
              #else
              __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_23, __pyx_t_9);
              #endif
              ++__pyx_t_9;
            }
            if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 973, __pyx_L30_error)
          } else {
            __pyx_t_3 = __pyx_t_10(__pyx_t_23);
            if (unlikely(!__pyx_t_3)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 973, __pyx_L30_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_a, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_9genexpr48__pyx_v_a, __pyx_mstate_global->__pyx_n_u_rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 973, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_21, (PyObject*)__pyx_t_3))) __PYX_ERR(2, 973, __pyx_L30_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
        __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_a); __pyx_9genexpr48__pyx_v_a = 0;
        goto __pyx_L34_exit_scope;
        __pyx_L30_error:;
        __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_a); __pyx_9genexpr48__pyx_v_a = 0;
        goto __pyx_L1_error;
        __pyx_L34_exit_scope:;
      } /* exit inner scope */

      /* "cython/core/manifold.pyx":974
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],
 *                     dec_prec=dec_prec, bits_prec=bits_prec)             # <<<<<<<<<<<<<<
 *             else:
 *                 engine = verify.CertifiedShapesEngine(
*/
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_18))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_18);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_7, ((PyObject *)__pyx_v_self), __pyx_t_21};
        __pyx_t_23 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 972, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_23);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dec_prec, __pyx_v_dec_prec, __pyx_t_23, __pyx_callargs+3, 0) < 0) __PYX_ERR(2, 972, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bits_prec, __pyx_v_bits_prec, __pyx_t_23, __pyx_callargs+3, 1) < 0) __PYX_ERR(2, 972, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_18, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_23);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 972, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_v_engine = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cython/core/manifold.pyx":971
 * 
 *         if intervals:
 *             if bits_prec or dec_prec:             # <<<<<<<<<<<<<<
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],
*/
      goto __pyx_L25;
    }

    /* "cython/core/manifold.pyx":976
 *                     dec_prec=dec_prec, bits_prec=bits_prec)
 *             else:
 *                 engine = verify.CertifiedShapesEngine(             # <<<<<<<<<<<<<<
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = self._precision())
*/
    /*else*/ {
      __pyx_t_18 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_verify); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_CertifiedShapesEngine); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;

      /* "cython/core/manifold.pyx":977
 *             else:
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],             # <<<<<<<<<<<<<<
 *                     bits_prec = self._precision())
 *             if not engine.expand_until_certified():
*/
      { /* enter inner scope */
        __pyx_t_23 = PyList_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 977, __pyx_L37_error)
        __Pyx_GOTREF(__pyx_t_23);
        if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
          __pyx_t_7 = __pyx_v_result; __Pyx_INCREF(__pyx_t_7);
          __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 977, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 977, __pyx_L37_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 977, __pyx_L37_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_9);
              ++__pyx_t_9;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 977, __pyx_L37_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9));
              #else
              __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9);
              #endif
              ++__pyx_t_9;
            }
            if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 977, __pyx_L37_error)
          } else {
            __pyx_t_3 = __pyx_t_10(__pyx_t_7);
            if (unlikely(!__pyx_t_3)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 977, __pyx_L37_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_a, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_9genexpr49__pyx_v_a, __pyx_mstate_global->__pyx_n_u_rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 977, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_23, (PyObject*)__pyx_t_3))) __PYX_ERR(2, 977, __pyx_L37_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_a); __pyx_9genexpr49__pyx_v_a = 0;
        goto __pyx_L41_exit_scope;
        __pyx_L37_error:;
        __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_a); __pyx_9genexpr49__pyx_v_a = 0;
        goto __pyx_L1_error;
        __pyx_L41_exit_scope:;
      } /* exit inner scope */

      /* "cython/core/manifold.pyx":978
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = self._precision())             # <<<<<<<<<<<<<<
 *             if not engine.expand_until_certified():
 *                 raise RuntimeError('Could not certify shape intervals, either '
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_precision, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 978, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_21))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_21);
        assert(__pyx_t_18);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_21);
        __Pyx_INCREF(__pyx_t_18);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_21, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_18, ((PyObject *)__pyx_v_self), __pyx_t_23};
        __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 976, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bits_prec, __pyx_t_7, __pyx_t_3, __pyx_callargs+3, 0) < 0) __PYX_ERR(2, 976, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_21, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 976, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_v_engine = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L25:;

    /* "cython/core/manifold.pyx":979
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = self._precision())
 *             if not engine.expand_until_certified():             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('Could not certify shape intervals, either '
 *                                    'there are degenerate shapes or the '
*/
    __pyx_t_21 = __pyx_v_engine;
    __Pyx_INCREF(__pyx_t_21);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_21, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_expand_until_certified, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 979, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 979, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = (!__pyx_t_6);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":980
 *                     bits_prec = self._precision())
 *             if not engine.expand_until_certified():
 *                 raise RuntimeError('Could not certify shape intervals, either '             # <<<<<<<<<<<<<<
 *                                    'there are degenerate shapes or the '
 *                                    'precision must be increased.')
*/
      __pyx_t_21 = NULL;
      __Pyx_INCREF(__pyx_builtin_RuntimeError);
      __pyx_t_3 = __pyx_builtin_RuntimeError; 
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_mstate_global->__pyx_kp_u_Could_not_certify_shape_interval};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 980, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 980, __pyx_L1_error)

      /* "cython/core/manifold.pyx":979
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = self._precision())
 *             if not engine.expand_until_certified():             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('Could not certify shape intervals, either '
 *                                    'there are degenerate shapes or the '
*/
    }

    /* "cython/core/manifold.pyx":983
 *                                    'there are degenerate shapes or the '
 *                                    'precision must be increased.')
 *             result = [ ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
*/
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L45_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/manifold.pyx":986
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
 *                        for z in engine.certified_shapes ]             # <<<<<<<<<<<<<<
 * 
 *         if part is not None:
*/
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_engine, __pyx_mstate_global->__pyx_n_u_certified_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 986, __pyx_L45_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_21 = __pyx_t_3; __Pyx_INCREF(__pyx_t_21);
        __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_21 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 986, __pyx_L45_error)
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_21); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 986, __pyx_L45_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_21))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_21);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 986, __pyx_L45_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_21, __pyx_t_9);
            ++__pyx_t_9;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_21);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 986, __pyx_L45_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_21, __pyx_t_9));
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_21, __pyx_t_9);
            #endif
            ++__pyx_t_9;
          }
          if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 986, __pyx_L45_error)
        } else {
          __pyx_t_3 = __pyx_t_10(__pyx_t_21);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 986, __pyx_L45_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_z, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cython/core/manifold.pyx":983
 *                                    'there are degenerate shapes or the '
 *                                    'precision must be increased.')
 *             result = [ ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
*/
        __pyx_t_7 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_ShapeInfo); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 983, __pyx_L45_error)
        __Pyx_GOTREF(__pyx_t_23);

        /* "cython/core/manifold.pyx":984
 *                                    'precision must be increased.')
 *             result = [ ShapeInfo(rect=z,
 *                                  log=z.log(),             # <<<<<<<<<<<<<<
 *                                  accuracies=(None,None,None,None))
 *                        for z in engine.certified_shapes ]
*/
        __pyx_t_8 = __pyx_9genexpr50__pyx_v_z;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
          __pyx_t_18 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_log, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 984, __pyx_L45_error)
          __Pyx_GOTREF(__pyx_t_18);
        }

        /* "cython/core/manifold.pyx":985
 *             result = [ ShapeInfo(rect=z,
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))             # <<<<<<<<<<<<<<
 *                        for z in engine.certified_shapes ]
 * 
*/
        __pyx_t_4 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_23))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_23);
          assert(__pyx_t_7);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_23);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_23, __pyx__function);
          __pyx_t_4 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_7, NULL};
          __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 983, __pyx_L45_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rect, __pyx_9genexpr50__pyx_v_z, __pyx_t_8, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 983, __pyx_L45_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_log, __pyx_t_18, __pyx_t_8, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 983, __pyx_L45_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_accuracies, __pyx_mstate_global->__pyx_tuple[20], __pyx_t_8, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 983, __pyx_L45_error)
          __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_23, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 983, __pyx_L45_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(2, 983, __pyx_L45_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cython/core/manifold.pyx":986
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
 *                        for z in engine.certified_shapes ]             # <<<<<<<<<<<<<<
 * 
 *         if part is not None:
*/
      }
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_z); __pyx_9genexpr50__pyx_v_z = 0;
      goto __pyx_L49_exit_scope;
      __pyx_L45_error:;
      __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_z); __pyx_9genexpr50__pyx_v_z = 0;
      goto __pyx_L1_error;
      __pyx_L49_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":970
 *                                         acc_log_re, acc_log_im)))
 * 
 *         if intervals:             # <<<<<<<<<<<<<<
 *             if bits_prec or dec_prec:
 *                 engine = verify.CertifiedShapesEngine(
*/
  }

  /* "cython/core/manifold.pyx":988
 *                        for z in engine.certified_shapes ]
 * 
 *         if part is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 return [a[part] for a in result]
*/
  __pyx_t_1 = (__pyx_v_part != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":989
 * 
 *         if part is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 return [a[part] for a in result]
 *             except KeyError:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
      __Pyx_XGOTREF(__pyx_t_24);
      __Pyx_XGOTREF(__pyx_t_25);
      __Pyx_XGOTREF(__pyx_t_26);
      /*try:*/ {

        /* "cython/core/manifold.pyx":990
 *         if part is not None:
 *             try:
 *                 return [a[part] for a in result]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise ValueError('A non-existent shape data type '
*/
        __Pyx_XDECREF(__pyx_r);
        { /* enter inner scope */
          __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 990, __pyx_L59_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
            __pyx_t_21 = __pyx_v_result; __Pyx_INCREF(__pyx_t_21);
            __pyx_t_9 = 0;
            __pyx_t_10 = NULL;
          } else {
            __pyx_t_9 = -1; __pyx_t_21 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 990, __pyx_L59_error)
            __Pyx_GOTREF(__pyx_t_21);
            __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_21); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 990, __pyx_L59_error)
          }
          for (;;) {
            if (likely(!__pyx_t_10)) {
              if (likely(PyList_CheckExact(__pyx_t_21))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_21);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 990, __pyx_L59_error)
                  #endif
                  if (__pyx_t_9 >= __pyx_temp) break;
                }
                __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_21, __pyx_t_9);
                ++__pyx_t_9;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_21);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 990, __pyx_L59_error)
                  #endif
                  if (__pyx_t_9 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_21, __pyx_t_9));
                #else
                __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_21, __pyx_t_9);
                #endif
                ++__pyx_t_9;
              }
              if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 990, __pyx_L59_error)
            } else {
              __pyx_t_3 = __pyx_t_10(__pyx_t_21);
              if (unlikely(!__pyx_t_3)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 990, __pyx_L59_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_a, __pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_9genexpr51__pyx_v_a, __pyx_v_part); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 990, __pyx_L59_error)
            __Pyx_GOTREF(__pyx_t_3);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(2, 990, __pyx_L59_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_a); __pyx_9genexpr51__pyx_v_a = 0;
          goto __pyx_L63_exit_scope;
          __pyx_L59_error:;
          __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_a); __pyx_9genexpr51__pyx_v_a = 0;
          goto __pyx_L51_error;
          __pyx_L63_exit_scope:;
        } /* exit inner scope */
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L55_try_return;

        /* "cython/core/manifold.pyx":989
 * 
 *         if part is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 return [a[part] for a in result]
 *             except KeyError:
*/
      }
      __pyx_L51_error:;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
      __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/manifold.pyx":991
 *             try:
 *                 return [a[part] for a in result]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise ValueError('A non-existent shape data type '
 *                                  'was specified.')
*/
      __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_16) {
        __Pyx_AddTraceback("SnapPyHP.Manifold.tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_21, &__pyx_t_3) < 0) __PYX_ERR(2, 991, __pyx_L53_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_21);
        __Pyx_XGOTREF(__pyx_t_3);

        /* "cython/core/manifold.pyx":992
 *                 return [a[part] for a in result]
 *             except KeyError:
 *                 raise ValueError('A non-existent shape data type '             # <<<<<<<<<<<<<<
 *                                  'was specified.')
 *         else:
*/
        __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_18 = __pyx_builtin_ValueError; 
        __pyx_t_4 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_A_non_existent_shape_data_type_w};
          __pyx_t_23 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 992, __pyx_L53_except_error)
          __Pyx_GOTREF(__pyx_t_23);
        }
        __Pyx_Raise(__pyx_t_23, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
        __PYX_ERR(2, 992, __pyx_L53_except_error)
      }
      goto __pyx_L53_except_error;

      /* "cython/core/manifold.pyx":989
 * 
 *         if part is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 return [a[part] for a in result]
 *             except KeyError:
*/
      __pyx_L53_except_error:;
      __Pyx_XGIVEREF(__pyx_t_24);
      __Pyx_XGIVEREF(__pyx_t_25);
      __Pyx_XGIVEREF(__pyx_t_26);
      __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
      goto __pyx_L1_error;
      __pyx_L55_try_return:;
      __Pyx_XGIVEREF(__pyx_t_24);
      __Pyx_XGIVEREF(__pyx_t_25);
      __Pyx_XGIVEREF(__pyx_t_26);
      __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
      goto __pyx_L0;
    }

    /* "cython/core/manifold.pyx":988
 *                        for z in engine.certified_shapes ]
 * 
 *         if part is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 return [a[part] for a in result]
*/
  }

  /* "cython/core/manifold.pyx":995
 *                                  'was specified.')
 *         else:
 *             return ListOnePerLine(result)             # <<<<<<<<<<<<<<
 * 
 *     def _get_tetrahedra_shapes(self, which_solution):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_21 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ListOnePerLine); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_21);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_21);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_v_result};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":878
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,             # <<<<<<<<<<<<<<
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_AddTraceback("SnapPyHP.Manifold.tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_shapes);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_rect_shape);
  __Pyx_XDECREF(__pyx_v_log_shape);
  __Pyx_XDECREF(__pyx_v_engine);
  __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_a);
  __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_a);
  __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_z);
  __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":997
 *             return ListOnePerLine(result)
 * 
 *     def _get_tetrahedra_shapes(self, which_solution):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the tetrahedra shapes from one of the two
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_53_get_tetrahedra_shapes(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_8SnapPyHP_8Manifold_52_get_tetrahedra_shapes, "\n        Return a list of the tetrahedra shapes from one of the two\n        solutions maintained in the SnapPea triangulation structure.\n        The which_solution argument must take one of the values\n        'filled' or 'complete'.  This sets fixed_alignment = True.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_53_get_tetrahedra_shapes = {"_get_tetrahedra_shapes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_53_get_tetrahedra_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_52_get_tetrahedra_shapes};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_53_get_tetrahedra_shapes(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_which_solution = 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_tetrahedra_shapes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_solution,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 997, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_tetrahedra_shapes", 0) < 0) __PYX_ERR(2, 997, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_tetrahedra_shapes", 1, 1, 1, i); __PYX_ERR(2, 997, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 997, __pyx_L3_error)
    }
    __pyx_v_which_solution = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_tetrahedra_shapes", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 997, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._get_tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_52_get_tetrahedra_shapes(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_which_solution);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_52_get_tetrahedra_shapes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_which_solution) {
  int __pyx_v_i;
  __pyx_t_8SnapPyHP_Real __pyx_v_rect_re;
  __pyx_t_8SnapPyHP_Real __pyx_v_rect_im;
  __pyx_t_8SnapPyHP_Real __pyx_v_log_re;
  __pyx_t_8SnapPyHP_Real __pyx_v_log_im;
  int __pyx_v_acc_rec_re;
  int __pyx_v_acc_rec_im;
  int __pyx_v_acc_log_re;
  int __pyx_v_acc_log_im;
  Boolean __pyx_v_is_geometric;
  FillingStatus __pyx_v_soln;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_tetrahedra_shapes", 0);

  /* "cython/core/manifold.pyx":1010
 *         cdef c_FillingStatus soln
 * 
 *         if which_solution == 'filled':             # <<<<<<<<<<<<<<
 *             soln = filled
 *         elif which_solution == 'complete':
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_which_solution, __pyx_mstate_global->__pyx_n_u_filled_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1010, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1011
 * 
 *         if which_solution == 'filled':
 *             soln = filled             # <<<<<<<<<<<<<<
 *         elif which_solution == 'complete':
 *             soln = complete
*/
    __pyx_v_soln = filled;

    /* "cython/core/manifold.pyx":1010
 *         cdef c_FillingStatus soln
 * 
 *         if which_solution == 'filled':             # <<<<<<<<<<<<<<
 *             soln = filled
 *         elif which_solution == 'complete':
*/
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":1012
 *         if which_solution == 'filled':
 *             soln = filled
 *         elif which_solution == 'complete':             # <<<<<<<<<<<<<<
 *             soln = complete
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_which_solution, __pyx_mstate_global->__pyx_n_u_complete_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1012, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1013
 *             soln = filled
 *         elif which_solution == 'complete':
 *             soln = complete             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Please specify 'filled' or 'complete'.")
*/
    __pyx_v_soln = complete;

    /* "cython/core/manifold.pyx":1012
 *         if which_solution == 'filled':
 *             soln = filled
 *         elif which_solution == 'complete':             # <<<<<<<<<<<<<<
 *             soln = complete
 *         else:
*/
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":1015
 *             soln = complete
 *         else:
 *             raise ValueError("Please specify 'filled' or 'complete'.")             # <<<<<<<<<<<<<<
 *         result = []
 *         for i in range(self.num_tetrahedra()):
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Please_specify_filled_or_complet};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1015, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/manifold.pyx":1016
 *         else:
 *             raise ValueError("Please specify 'filled' or 'complete'.")
 *         result = []             # <<<<<<<<<<<<<<
 *         for i in range(self.num_tetrahedra()):
 *             get_tet_shape(self.c_triangulation, i, soln, True,
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1017
 *             raise ValueError("Please specify 'filled' or 'complete'.")
 *         result = []
 *         for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *             get_tet_shape(self.c_triangulation, i, soln, True,
 *                           &rect_re, &rect_im, &log_re, &log_im,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "cython/core/manifold.pyx":1018
 *         result = []
 *         for i in range(self.num_tetrahedra()):
 *             get_tet_shape(self.c_triangulation, i, soln, True,             # <<<<<<<<<<<<<<
 *                           &rect_re, &rect_im, &log_re, &log_im,
 *                           &acc_rec_re, &acc_rec_im, &acc_log_re, &acc_log_im,
*/
    get_tet_shape(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_i, __pyx_v_soln, 1, (&__pyx_v_rect_re), (&__pyx_v_rect_im), (&__pyx_v_log_re), (&__pyx_v_log_im), (&__pyx_v_acc_rec_re), (&__pyx_v_acc_rec_im), (&__pyx_v_acc_log_re), (&__pyx_v_acc_log_im), (&__pyx_v_is_geometric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1018, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1022
 *                           &acc_rec_re, &acc_rec_im, &acc_log_re, &acc_log_im,
 *                           &is_geometric)
 *             result.append(Number(RealImag2gen(rect_re, rect_im)))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __pyx_f_8SnapPyHP_RealImag2gen(__pyx_v_rect_re, __pyx_v_rect_im); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 1022, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/manifold.pyx":1023
 *                           &is_geometric)
 *             result.append(Number(RealImag2gen(rect_re, rect_im)))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def set_tetrahedra_shapes(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":997
 *             return ListOnePerLine(result)
 * 
 *     def _get_tetrahedra_shapes(self, which_solution):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the tetrahedra shapes from one of the two
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.Manifold._get_tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1025
 *         return result
 * 
 *     def set_tetrahedra_shapes(self,             # <<<<<<<<<<<<<<
 *                               filled_shapes=None,
 *                               complete_shapes=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_55set_tetrahedra_shapes(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_8SnapPyHP_8Manifold_54set_tetrahedra_shapes, "\n        Replaces the tetrahedron shapes with those in the given lists,\n        and sets the Dehn filling coefficients as specified by the\n        fillings argument.  The shapes will get double precision\n        values; polishing will be needed for high precision shapes.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_55set_tetrahedra_shapes = {"set_tetrahedra_shapes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_55set_tetrahedra_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_54set_tetrahedra_shapes};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_55set_tetrahedra_shapes(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_filled_shapes = 0;
  PyObject *__pyx_v_complete_shapes = 0;
  PyObject *__pyx_v_fillings = 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_tetrahedra_shapes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filled_shapes,&__pyx_mstate_global->__pyx_n_u_complete_shapes,&__pyx_mstate_global->__pyx_n_u_fillings,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1025, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_tetrahedra_shapes", 0) < 0) __PYX_ERR(2, 1025, __pyx_L3_error)

      /* "cython/core/manifold.pyx":1026
 * 
 *     def set_tetrahedra_shapes(self,
 *                               filled_shapes=None,             # <<<<<<<<<<<<<<
 *                               complete_shapes=None,
 *                               fillings=None, ):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/manifold.pyx":1027
 *     def set_tetrahedra_shapes(self,
 *                               filled_shapes=None,
 *                               complete_shapes=None,             # <<<<<<<<<<<<<<
 *                               fillings=None, ):
 *         """
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/manifold.pyx":1028
 *                               filled_shapes=None,
 *                               complete_shapes=None,
 *                               fillings=None, ):             # <<<<<<<<<<<<<<
 *         """
 *         Replaces the tetrahedron shapes with those in the given lists,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/manifold.pyx":1026
 * 
 *     def set_tetrahedra_shapes(self,
 *                               filled_shapes=None,             # <<<<<<<<<<<<<<
 *                               complete_shapes=None,
 *                               fillings=None, ):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/manifold.pyx":1027
 *     def set_tetrahedra_shapes(self,
 *                               filled_shapes=None,
 *                               complete_shapes=None,             # <<<<<<<<<<<<<<
 *                               fillings=None, ):
 *         """
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/manifold.pyx":1028
 *                               filled_shapes=None,
 *                               complete_shapes=None,
 *                               fillings=None, ):             # <<<<<<<<<<<<<<
 *         """
 *         Replaces the tetrahedron shapes with those in the given lists,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_filled_shapes = values[0];
    __pyx_v_complete_shapes = values[1];
    __pyx_v_fillings = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_tetrahedra_shapes", 0, 0, 3, __pyx_nargs); __PYX_ERR(2, 1025, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.set_tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_54set_tetrahedra_shapes(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_filled_shapes, __pyx_v_complete_shapes, __pyx_v_fillings);

  /* "cython/core/manifold.pyx":1025
 *         return result
 * 
 *     def set_tetrahedra_shapes(self,             # <<<<<<<<<<<<<<
 *                               filled_shapes=None,
 *                               complete_shapes=None,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_54set_tetrahedra_shapes(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_filled_shapes, PyObject *__pyx_v_complete_shapes, PyObject *__pyx_v_fillings) {
  int __pyx_v_i;
  int __pyx_v_N;
  Complex *__pyx_v_filled_shape_array;
  Complex *__pyx_v_complete_shape_array;
  PyObject *__pyx_v_shape = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_double_complex __pyx_t_10;
  Complex __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_tetrahedra_shapes", 0);

  /* "cython/core/manifold.pyx":1036
 *         """
 *         cdef int i, N
 *         cdef Complex *filled_shape_array = NULL             # <<<<<<<<<<<<<<
 *         cdef Complex *complete_shape_array = NULL
 * 
*/
  __pyx_v_filled_shape_array = NULL;

  /* "cython/core/manifold.pyx":1037
 *         cdef int i, N
 *         cdef Complex *filled_shape_array = NULL
 *         cdef Complex *complete_shape_array = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL:
*/
  __pyx_v_complete_shape_array = NULL;

  /* "cython/core/manifold.pyx":1039
 *         cdef Complex *complete_shape_array = NULL
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         N = get_num_tetrahedra(self.c_triangulation)
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1040
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         N = get_num_tetrahedra(self.c_triangulation)
 *         if filled_shapes is not None:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1040, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1040, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1039
 *         cdef Complex *complete_shape_array = NULL
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         N = get_num_tetrahedra(self.c_triangulation)
*/
  }

  /* "cython/core/manifold.pyx":1041
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         N = get_num_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if filled_shapes is not None:
 *             filled_shape_array = <Complex *>malloc(N*sizeof(Complex))
*/
  __pyx_t_6 = get_num_tetrahedra(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1041, __pyx_L1_error)
  __pyx_v_N = __pyx_t_6;

  /* "cython/core/manifold.pyx":1042
 *             raise ValueError('The Triangulation is empty.')
 *         N = get_num_tetrahedra(self.c_triangulation)
 *         if filled_shapes is not None:             # <<<<<<<<<<<<<<
 *             filled_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(filled_shapes):
*/
  __pyx_t_1 = (__pyx_v_filled_shapes != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1043
 *         N = get_num_tetrahedra(self.c_triangulation)
 *         if filled_shapes is not None:
 *             filled_shape_array = <Complex *>malloc(N*sizeof(Complex))             # <<<<<<<<<<<<<<
 *             for i, shape in enumerate(filled_shapes):
 *                 filled_shape_array[i] = complex2Complex(complex(shape))
*/
    __pyx_v_filled_shape_array = ((Complex *)malloc((__pyx_v_N * (sizeof(Complex)))));

    /* "cython/core/manifold.pyx":1044
 *         if filled_shapes is not None:
 *             filled_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(filled_shapes):             # <<<<<<<<<<<<<<
 *                 filled_shape_array[i] = complex2Complex(complex(shape))
 *         if complete_shapes is not None:
*/
    __pyx_t_6 = 0;
    if (likely(PyList_CheckExact(__pyx_v_filled_shapes)) || PyTuple_CheckExact(__pyx_v_filled_shapes)) {
      __pyx_t_2 = __pyx_v_filled_shapes; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_filled_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1044, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1044, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1044, __pyx_L1_error)
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1044, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_v_i = __pyx_t_6;
      __pyx_t_6 = (__pyx_t_6 + 1);

      /* "cython/core/manifold.pyx":1045
 *             filled_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(filled_shapes):
 *                 filled_shape_array[i] = complex2Complex(complex(shape))             # <<<<<<<<<<<<<<
 *         if complete_shapes is not None:
 *             complete_shape_array = <Complex *>malloc(N*sizeof(Complex))
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF((PyObject *)(&PyComplex_Type));
      __pyx_t_9 = ((PyObject *)(&PyComplex_Type)); 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_shape};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_10 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1045, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = __pyx_f_8SnapPyHP_complex2Complex(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1045, __pyx_L1_error)
      (__pyx_v_filled_shape_array[__pyx_v_i]) = __pyx_t_11;

      /* "cython/core/manifold.pyx":1044
 *         if filled_shapes is not None:
 *             filled_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(filled_shapes):             # <<<<<<<<<<<<<<
 *                 filled_shape_array[i] = complex2Complex(complex(shape))
 *         if complete_shapes is not None:
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1042
 *             raise ValueError('The Triangulation is empty.')
 *         N = get_num_tetrahedra(self.c_triangulation)
 *         if filled_shapes is not None:             # <<<<<<<<<<<<<<
 *             filled_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(filled_shapes):
*/
  }

  /* "cython/core/manifold.pyx":1046
 *             for i, shape in enumerate(filled_shapes):
 *                 filled_shape_array[i] = complex2Complex(complex(shape))
 *         if complete_shapes is not None:             # <<<<<<<<<<<<<<
 *             complete_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(complete_shapes):
*/
  __pyx_t_1 = (__pyx_v_complete_shapes != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1047
 *                 filled_shape_array[i] = complex2Complex(complex(shape))
 *         if complete_shapes is not None:
 *             complete_shape_array = <Complex *>malloc(N*sizeof(Complex))             # <<<<<<<<<<<<<<
 *             for i, shape in enumerate(complete_shapes):
 *                 complete_shape_array[i] = complex2Complex(complex(shape))
*/
    __pyx_v_complete_shape_array = ((Complex *)malloc((__pyx_v_N * (sizeof(Complex)))));

    /* "cython/core/manifold.pyx":1048
 *         if complete_shapes is not None:
 *             complete_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(complete_shapes):             # <<<<<<<<<<<<<<
 *                 complete_shape_array[i] = complex2Complex(complex(shape))
 *         if fillings:
*/
    __pyx_t_6 = 0;
    if (likely(PyList_CheckExact(__pyx_v_complete_shapes)) || PyTuple_CheckExact(__pyx_v_complete_shapes)) {
      __pyx_t_2 = __pyx_v_complete_shapes; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_complete_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1048, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1048, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1048, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1048, __pyx_L1_error)
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1048, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_v_i = __pyx_t_6;
      __pyx_t_6 = (__pyx_t_6 + 1);

      /* "cython/core/manifold.pyx":1049
 *             complete_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(complete_shapes):
 *                 complete_shape_array[i] = complex2Complex(complex(shape))             # <<<<<<<<<<<<<<
 *         if fillings:
 *             set_cusps(self.c_triangulation, fillings)
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF((PyObject *)(&PyComplex_Type));
      __pyx_t_3 = ((PyObject *)(&PyComplex_Type)); 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_shape};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_10 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1049, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = __pyx_f_8SnapPyHP_complex2Complex(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1049, __pyx_L1_error)
      (__pyx_v_complete_shape_array[__pyx_v_i]) = __pyx_t_11;

      /* "cython/core/manifold.pyx":1048
 *         if complete_shapes is not None:
 *             complete_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(complete_shapes):             # <<<<<<<<<<<<<<
 *                 complete_shape_array[i] = complex2Complex(complex(shape))
 *         if fillings:
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1046
 *             for i, shape in enumerate(filled_shapes):
 *                 filled_shape_array[i] = complex2Complex(complex(shape))
 *         if complete_shapes is not None:             # <<<<<<<<<<<<<<
 *             complete_shape_array = <Complex *>malloc(N*sizeof(Complex))
 *             for i, shape in enumerate(complete_shapes):
*/
  }

  /* "cython/core/manifold.pyx":1050
 *             for i, shape in enumerate(complete_shapes):
 *                 complete_shape_array[i] = complex2Complex(complex(shape))
 *         if fillings:             # <<<<<<<<<<<<<<
 *             set_cusps(self.c_triangulation, fillings)
 *         set_tet_shapes(self.c_triangulation,
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fillings); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1050, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1051
 *                 complete_shape_array[i] = complex2Complex(complex(shape))
 *         if fillings:
 *             set_cusps(self.c_triangulation, fillings)             # <<<<<<<<<<<<<<
 *         set_tet_shapes(self.c_triangulation,
 *                        filled_shape_array,
*/
    __pyx_t_6 = __pyx_f_8SnapPyHP_set_cusps(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_fillings); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1051, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1050
 *             for i, shape in enumerate(complete_shapes):
 *                 complete_shape_array[i] = complex2Complex(complex(shape))
 *         if fillings:             # <<<<<<<<<<<<<<
 *             set_cusps(self.c_triangulation, fillings)
 *         set_tet_shapes(self.c_triangulation,
*/
  }

  /* "cython/core/manifold.pyx":1052
 *         if fillings:
 *             set_cusps(self.c_triangulation, fillings)
 *         set_tet_shapes(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                        filled_shape_array,
 *                        complete_shape_array)
*/
  set_tet_shapes(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_filled_shape_array, __pyx_v_complete_shape_array);

  /* "cython/core/manifold.pyx":1055
 *                        filled_shape_array,
 *                        complete_shape_array)
 *         compute_holonomies(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         compute_edge_angle_sums(self.c_triangulation)
 *         if filled_shape_array != NULL:
*/
  compute_holonomies(__pyx_v_self->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":1056
 *                        complete_shape_array)
 *         compute_holonomies(self.c_triangulation)
 *         compute_edge_angle_sums(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if filled_shape_array != NULL:
 *             free(filled_shape_array)
*/
  compute_edge_angle_sums(__pyx_v_self->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":1057
 *         compute_holonomies(self.c_triangulation)
 *         compute_edge_angle_sums(self.c_triangulation)
 *         if filled_shape_array != NULL:             # <<<<<<<<<<<<<<
 *             free(filled_shape_array)
 *         if complete_shape_array != NULL:
*/
  __pyx_t_1 = (__pyx_v_filled_shape_array != NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1058
 *         compute_edge_angle_sums(self.c_triangulation)
 *         if filled_shape_array != NULL:
 *             free(filled_shape_array)             # <<<<<<<<<<<<<<
 *         if complete_shape_array != NULL:
 *             free(complete_shape_array)
*/
    free(__pyx_v_filled_shape_array);

    /* "cython/core/manifold.pyx":1057
 *         compute_holonomies(self.c_triangulation)
 *         compute_edge_angle_sums(self.c_triangulation)
 *         if filled_shape_array != NULL:             # <<<<<<<<<<<<<<
 *             free(filled_shape_array)
 *         if complete_shape_array != NULL:
*/
  }

  /* "cython/core/manifold.pyx":1059
 *         if filled_shape_array != NULL:
 *             free(filled_shape_array)
 *         if complete_shape_array != NULL:             # <<<<<<<<<<<<<<
 *             free(complete_shape_array)
 *         self._cache.clear(message='Manifold.set_tetrahedra_shapes')
*/
  __pyx_t_1 = (__pyx_v_complete_shape_array != NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1060
 *             free(filled_shape_array)
 *         if complete_shape_array != NULL:
 *             free(complete_shape_array)             # <<<<<<<<<<<<<<
 *         self._cache.clear(message='Manifold.set_tetrahedra_shapes')
 * 
*/
    free(__pyx_v_complete_shape_array);

    /* "cython/core/manifold.pyx":1059
 *         if filled_shape_array != NULL:
 *             free(filled_shape_array)
 *         if complete_shape_array != NULL:             # <<<<<<<<<<<<<<
 *             free(complete_shape_array)
 *         self._cache.clear(message='Manifold.set_tetrahedra_shapes')
*/
  }

  /* "cython/core/manifold.pyx":1061
 *         if complete_shape_array != NULL:
 *             free(complete_shape_array)
 *         self._cache.clear(message='Manifold.set_tetrahedra_shapes')             # <<<<<<<<<<<<<<
 * 
 *     def solution_type(self, enum=False):
*/
  __pyx_t_4 = __pyx_v_self->__pyx_base._cache;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_Manifold_set_tetrahedra_shapes, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 1061, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1025
 *         return result
 * 
 *     def set_tetrahedra_shapes(self,             # <<<<<<<<<<<<<<
 *                               filled_shapes=None,
 *                               complete_shapes=None,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.Manifold.set_tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_shape);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1063
 *         self._cache.clear(message='Manifold.set_tetrahedra_shapes')
 * 
 *     def solution_type(self, enum=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the type of the current solution to the gluing
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_57solution_type(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_8SnapPyHP_8Manifold_56solution_type, "\n        Returns the type of the current solution to the gluing\n        equations, basically a summary of how degenerate the solution\n        is.  If the flag :attr:`enum=True` is set, then an integer value is\n        returned. The possible answers are:\n\n        - 0: ``not attempted``\n\n        - 1: ``all tetrahedra positively oriented`` aka *geometric_solution*\n\n          Should correspond to a genuine hyperbolic structure.\n\n        - 2: ``contains negatively oriented tetrahedra`` aka *nongeometric solution*\n\n          Probably corresponds to a hyperbolic structure but some\n          simplices have reversed orientations.\n\n        - 3: ``contains flat tetrahedra`` (should be called ``all tetrahedra flat``)\n\n          All tetrahedra have shape in :math:`\\mathbb{R} - \\{0, 1\\}`.\n\n        - 4: ``contains degenerate tetrahedra``\n\n          Some shapes are close to :math:`\\{0,1, \\infty\\}`.\n\n        - 5: ``unrecognized solution type``\n\n        - 6: ``no solution found``\n\n        >>> M = Manifold('m007')\n        >>> M.solution_type()\n        'all tetrahedra positively oriented'\n        >>> M.dehn_fill( (3,1) )\n        >>> M.solution_type()\n        'contains negatively oriented tetrahedra'\n        >>> M.dehn_fill( (3,-1) )\n        >>> M.solution_type()\n        'contains degenerate tetrahedra'\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_57solution_type = {"solution_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_57solution_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_56solution_type};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_57solution_type(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_enum = 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("solution_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_enum,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1063, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solution_type", 0) < 0) __PYX_ERR(2, 1063, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_enum = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solution_type", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 1063, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.solution_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_56solution_type(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_enum);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_56solution_type(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_enum) {
  SolutionType __pyx_v_solution_type;
  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;
  size_t __pyx_t_5;
  SolutionType __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("solution_type", 0);

  /* "cython/core/manifold.pyx":1105
 *         cdef c_SolutionType solution_type
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         solution_type = get_filled_solution_type(self.c_triangulation)
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1106
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         solution_type = get_filled_solution_type(self.c_triangulation)
 *         if enum:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1106, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1105
 *         cdef c_SolutionType solution_type
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         solution_type = get_filled_solution_type(self.c_triangulation)
*/
  }

  /* "cython/core/manifold.pyx":1107
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         solution_type = get_filled_solution_type(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if enum:
 *             return solution_type
*/
  __pyx_t_6 = get_filled_solution_type(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1107, __pyx_L1_error)
  __pyx_v_solution_type = __pyx_t_6;

  /* "cython/core/manifold.pyx":1108
 *             raise ValueError('The Triangulation is empty.')
 *         solution_type = get_filled_solution_type(self.c_triangulation)
 *         if enum:             # <<<<<<<<<<<<<<
 *             return solution_type
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_enum); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1108, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1109
 *         solution_type = get_filled_solution_type(self.c_triangulation)
 *         if enum:
 *             return solution_type             # <<<<<<<<<<<<<<
 *         else:
 *             return SolutionType[solution_type]
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_SolutionType(__pyx_v_solution_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1108
 *             raise ValueError('The Triangulation is empty.')
 *         solution_type = get_filled_solution_type(self.c_triangulation)
 *         if enum:             # <<<<<<<<<<<<<<
 *             return solution_type
 *         else:
*/
  }

  /* "cython/core/manifold.pyx":1111
 *             return solution_type
 *         else:
 *             return SolutionType[solution_type]             # <<<<<<<<<<<<<<
 * 
 *     def set_target_holonomy(self, target, which_cusp=0, recompute=True):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SolutionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyLong_From_SolutionType(__pyx_v_solution_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":1063
 *         self._cache.clear(message='Manifold.set_tetrahedra_shapes')
 * 
 *     def solution_type(self, enum=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the type of the current solution to the gluing
*/

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

/* "cython/core/manifold.pyx":1113
 *             return SolutionType[solution_type]
 * 
 *     def set_target_holonomy(self, target, which_cusp=0, recompute=True):             # <<<<<<<<<<<<<<
 *         """
 *         M.set_target_holonomy(target, which_cusp=0, recompute=True)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_59set_target_holonomy(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_8SnapPyHP_8Manifold_58set_target_holonomy, "\n        M.set_target_holonomy(target, which_cusp=0, recompute=True)\n\n        Computes a geometric structure in which the Dehn filling curve\n        on the specified cusp has holonomy equal to the target value.\n        The holonomies of Dehn filling curves on other cusps are left\n        unchanged.  If the 'recompute' flag is False, the Dehn filling\n        equations are modified, but not solved.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_59set_target_holonomy = {"set_target_holonomy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_59set_target_holonomy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_58set_target_holonomy};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_59set_target_holonomy(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_target = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_recompute = 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_target_holonomy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_target,&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_recompute,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1113, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_target_holonomy", 0) < 0) __PYX_ERR(2, 1113, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_target_holonomy", 0, 1, 3, i); __PYX_ERR(2, 1113, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1113, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_target = values[0];
    __pyx_v_which_cusp = values[1];
    __pyx_v_recompute = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_target_holonomy", 0, 1, 3, __pyx_nargs); __PYX_ERR(2, 1113, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.set_target_holonomy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_58set_target_holonomy(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_target, __pyx_v_which_cusp, __pyx_v_recompute);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_58set_target_holonomy(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_recompute) {
  Complex __pyx_v_c_target;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Complex __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_target_holonomy", 0);

  /* "cython/core/manifold.pyx":1124
 *         """
 *         cdef Complex c_target
 *         c_target = Object2Complex(target)             # <<<<<<<<<<<<<<
 *         set_target_holonomy(self.c_triangulation,
 *                             which_cusp, c_target, recompute)
*/
  __pyx_t_1 = __pyx_f_8SnapPyHP_Object2Complex(__pyx_v_target); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1124, __pyx_L1_error)
  __pyx_v_c_target = __pyx_t_1;

  /* "cython/core/manifold.pyx":1126
 *         c_target = Object2Complex(target)
 *         set_target_holonomy(self.c_triangulation,
 *                             which_cusp, c_target, recompute)             # <<<<<<<<<<<<<<
 * 
 *     def cusp_info(self, data_spec=None, verified = False, bits_prec = None):
*/
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1126, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_recompute); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1126, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1125
 *         cdef Complex c_target
 *         c_target = Object2Complex(target)
 *         set_target_holonomy(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                             which_cusp, c_target, recompute)
 * 
*/
  set_target_holonomy(__pyx_v_self->__pyx_base.c_triangulation, __pyx_t_2, __pyx_v_c_target, __pyx_t_3);

  /* "cython/core/manifold.pyx":1113
 *             return SolutionType[solution_type]
 * 
 *     def set_target_holonomy(self, target, which_cusp=0, recompute=True):             # <<<<<<<<<<<<<<
 *         """
 *         M.set_target_holonomy(target, which_cusp=0, recompute=True)
*/

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

/* "cython/core/manifold.pyx":1128
 *                             which_cusp, c_target, recompute)
 * 
 *     def cusp_info(self, data_spec=None, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_61cusp_info(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_8SnapPyHP_8Manifold_60cusp_info, "\n        Returns an info object containing information about the given\n        cusp.   Usage:\n\n        >>> M = Manifold('v3227(0,0)(1,2)(3,2)')\n        >>> M.cusp_info(1)\n        Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0)\n\n        To get more detailed information about the cusp, we do\n\n        >>> c = M.cusp_info(0)\n        >>> c.shape # doctest: +NUMERIC6\n        0.11044502 + 0.94677098*I\n        >>> c.modulus# doctest: +NUMERIC6\n        -0.12155872 + 1.04204128*I\n        >>> sorted(c.keys())\n        ['filling', 'holonomies', 'holonomy_accuracy', 'index', 'is_complete', 'modulus', 'shape', 'shape_accuracy', 'topology']\n\n        Here 'shape' is the shape of the cusp, i.e.\n        (longitude/meridian)\n        and 'modulus' is its shape in the geometrically preferred\n        basis, i.e.\n        ( (second shortest translation)/(shortest translation)).\n        For cusps that are filled, one instead cares about the\n        holonomies:\n\n        >>> M.cusp_info(-1)['holonomies'] # doctest: +NUMERIC6\n        (-0.59883089 + 1.09812548*I, 0.89824633 + 1.49440443*I)\n\n        The complex numbers returned for the shape and for the two\n        holonomies have an extra attribute, accuracy, which is\n        SnapPea's *estimate* of their accuracy.\n\n        You can also get information about multiple cusps at once:\n\n        >>> M.cusp_info() # doctest: +NUMERIC6\n        [Cusp 0 : complete torus cusp of shape 0.11044502 + 0.94677098*I,\n         Cusp 1 : torus cusp with Dehn filling coefficients (M, L) = (1.0, 2.0),\n         Cusp 2 : torus cusp with Dehn filling coefficients (M, L) = (3.0, 2.0)]\n        >>> M.cusp_info('is_complete')\n        [True, False, False]\n\n        The cusp shapes can be verified::\n\n            sage: M = Manifold('m292')\n            sage: M.cusp_info('shape', verified = True, bits_prec = 60) # doctest: +NUMERIC12\n            [-0.1766049820997? + 1.2028208192855?*I,\n             -0.17660498""20997? + 1.2028208192855?*I]\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_61cusp_info = {"cusp_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_61cusp_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_60cusp_info};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_61cusp_info(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_data_spec = 0;
  PyObject *__pyx_v_verified = 0;
  PyObject *__pyx_v_bits_prec = 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("cusp_info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data_spec,&__pyx_mstate_global->__pyx_n_u_verified,&__pyx_mstate_global->__pyx_n_u_bits_prec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1128, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cusp_info", 0) < 0) __PYX_ERR(2, 1128, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_data_spec = values[0];
    __pyx_v_verified = values[1];
    __pyx_v_bits_prec = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cusp_info", 0, 0, 3, __pyx_nargs); __PYX_ERR(2, 1128, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.cusp_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_60cusp_info(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_data_spec, __pyx_v_verified, __pyx_v_bits_prec);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_60cusp_info(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_data_spec, PyObject *__pyx_v_verified, PyObject *__pyx_v_bits_prec) {
  int __pyx_v_cusp_index;
  CuspTopology __pyx_v_topology;
  Boolean __pyx_v_is_complete;
  __pyx_t_8SnapPyHP_Real __pyx_v_m;
  __pyx_t_8SnapPyHP_Real __pyx_v_l;
  Complex __pyx_v_initial_shape;
  Complex __pyx_v_current_shape;
  int __pyx_v_initial_shape_accuracy;
  int __pyx_v_current_shape_accuracy;
  Complex __pyx_v_initial_modulus;
  Complex __pyx_v_current_modulus;
  int __pyx_v_meridian_accuracy;
  int __pyx_v_longitude_accuracy;
  int __pyx_v_singularity_index;
  int __pyx_v_accuracy;
  Complex __pyx_v_c_meridian;
  Complex __pyx_v_c_longitude;
  Complex __pyx_v_c_core_length;
  PyObject *__pyx_v_shape = NULL;
  PyObject *__pyx_v_meridian = NULL;
  PyObject *__pyx_v_longitude = NULL;
  PyObject *__pyx_v_modulus = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_v_core_length = NULL;
  PyObject *__pyx_9genexpr52__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr53__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_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 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cusp_info", 0);

  /* "cython/core/manifold.pyx":1189
 *         cdef Complex c_meridian, c_longitude, c_core_length
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1190
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         if verified or bits_prec:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1190, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1189
 *         cdef Complex c_meridian, c_longitude, c_core_length
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":1192
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         if verified or bits_prec:             # <<<<<<<<<<<<<<
 *             if not data_spec == 'shape':
 *                 raise Exception("Verified and arbitrary precision computation "
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verified); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 1192, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_bits_prec); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 1192, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1193
 * 
 *         if verified or bits_prec:
 *             if not data_spec == 'shape':             # <<<<<<<<<<<<<<
 *                 raise Exception("Verified and arbitrary precision computation "
 *                                 "of cusp_info only "
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_data_spec, __pyx_mstate_global->__pyx_n_u_shape, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1193, __pyx_L1_error)
    __pyx_t_6 = (!__pyx_t_1);
    if (unlikely(__pyx_t_6)) {

      /* "cython/core/manifold.pyx":1194
 *         if verified or bits_prec:
 *             if not data_spec == 'shape':
 *                 raise Exception("Verified and arbitrary precision computation "             # <<<<<<<<<<<<<<
 *                                 "of cusp_info only "
 *                                 "implemented for cusp shapes. Pass 'shape' "
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception)));
      __pyx_t_3 = ((PyObject *)(((PyTypeObject*)PyExc_Exception))); 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Verified_and_arbitrary_precision};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 1194, __pyx_L1_error)

      /* "cython/core/manifold.pyx":1193
 * 
 *         if verified or bits_prec:
 *             if not data_spec == 'shape':             # <<<<<<<<<<<<<<
 *                 raise Exception("Verified and arbitrary precision computation "
 *                                 "of cusp_info only "
*/
    }

    /* "cython/core/manifold.pyx":1198
 *                                 "implemented for cusp shapes. Pass 'shape' "
 *                                 "as first argument to cusp_info().")
 *             return cusps_compute_cusp_shapes(self, verified = verified,             # <<<<<<<<<<<<<<
 *                                               bits_prec = bits_prec)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cusps_compute_cusp_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/manifold.pyx":1199
 *                                 "as first argument to cusp_info().")
 *             return cusps_compute_cusp_shapes(self, verified = verified,
 *                                               bits_prec = bits_prec)             # <<<<<<<<<<<<<<
 * 
 *         if data_spec is None:
*/
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
      __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_verified, __pyx_v_verified, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(2, 1198, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bits_prec, __pyx_v_bits_prec, __pyx_t_7, __pyx_callargs+2, 1) < 0) __PYX_ERR(2, 1198, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1192
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         if verified or bits_prec:             # <<<<<<<<<<<<<<
 *             if not data_spec == 'shape':
 *                 raise Exception("Verified and arbitrary precision computation "
*/
  }

  /* "cython/core/manifold.pyx":1201
 *                                               bits_prec = bits_prec)
 * 
 *         if data_spec is None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
*/
  __pyx_t_6 = (__pyx_v_data_spec == Py_None);
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":1202
 * 
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         # Need to check that data_spec has string type
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ListOnePerLine); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1202, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/manifold.pyx":1203
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         # Need to check that data_spec has string type
 *         if isinstance(data_spec, str):
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_10 = __pyx_builtin_range; 
      __pyx_t_12 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
        __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1203, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1203, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
        __pyx_t_10 = __pyx_t_8; __Pyx_INCREF(__pyx_t_10);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1203, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1203, __pyx_L11_error)
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_10))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1203, __pyx_L11_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_13);
            ++__pyx_t_13;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1203, __pyx_L11_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_13));
            #else
            __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_13);
            #endif
            ++__pyx_t_13;
          }
          if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1203, __pyx_L11_error)
        } else {
          __pyx_t_8 = __pyx_t_14(__pyx_t_10);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1203, __pyx_L11_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_9genexpr52__pyx_v_i, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "cython/core/manifold.pyx":1202
 * 
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         # Need to check that data_spec has string type
*/
        __pyx_t_11 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_9genexpr52__pyx_v_i};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1202, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(2, 1202, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cython/core/manifold.pyx":1203
 *         if data_spec is None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         # Need to check that data_spec has string type
 *         if isinstance(data_spec, str):
*/
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i); __pyx_9genexpr52__pyx_v_i = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i); __pyx_9genexpr52__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L15_exit_scope:;
    } /* exit inner scope */
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1201
 *                                               bits_prec = bits_prec)
 * 
 *         if data_spec is None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
*/
  }

  /* "cython/core/manifold.pyx":1205
 *                                    for i in range(self.num_cusps())])
 *         # Need to check that data_spec has string type
 *         if isinstance(data_spec, str):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
*/
  __pyx_t_6 = PyUnicode_Check(__pyx_v_data_spec); 
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":1206
 *         # Need to check that data_spec has string type
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]             # <<<<<<<<<<<<<<
 *         cusp_index = valid_index(
 *             data_spec, self.num_cusps(),
*/
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1206, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1206, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1206, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1206, __pyx_L19_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1206, __pyx_L19_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_13);
            ++__pyx_t_13;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1206, __pyx_L19_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13));
            #else
            __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13);
            #endif
            ++__pyx_t_13;
          }
          if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1206, __pyx_L19_error)
        } else {
          __pyx_t_7 = __pyx_t_14(__pyx_t_3);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1206, __pyx_L19_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_c, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_9genexpr53__pyx_v_c, __pyx_v_data_spec); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1206, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(2, 1206, __pyx_L19_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_c); __pyx_9genexpr53__pyx_v_c = 0;
      goto __pyx_L23_exit_scope;
      __pyx_L19_error:;
      __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_c); __pyx_9genexpr53__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L23_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1205
 *                                    for i in range(self.num_cusps())])
 *         # Need to check that data_spec has string type
 *         if isinstance(data_spec, str):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
*/
  }

  /* "cython/core/manifold.pyx":1207
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(             # <<<<<<<<<<<<<<
 *             data_spec, self.num_cusps(),
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cython/core/manifold.pyx":1208
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
 *             data_spec, self.num_cusps(),             # <<<<<<<<<<<<<<
 *             'The specified cusp (%s) does not exist.')
 * 
*/
  __pyx_t_10 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_10);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_data_spec, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "cython/core/manifold.pyx":1207
 *         if isinstance(data_spec, str):
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(             # <<<<<<<<<<<<<<
 *             data_spec, self.num_cusps(),
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cusp_index = __pyx_t_15;

  /* "cython/core/manifold.pyx":1211
 *             'The specified cusp (%s) does not exist.')
 * 
 *         get_cusp_info(self.c_triangulation, cusp_index,             # <<<<<<<<<<<<<<
 *                       &topology, &is_complete, &m, &l,
 *                       &initial_shape, &current_shape,
*/
  get_cusp_info(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_cusp_index, (&__pyx_v_topology), (&__pyx_v_is_complete), (&__pyx_v_m), (&__pyx_v_l), (&__pyx_v_initial_shape), (&__pyx_v_current_shape), (&__pyx_v_initial_shape_accuracy), (&__pyx_v_current_shape_accuracy), (&__pyx_v_initial_modulus), (&__pyx_v_current_modulus));

  /* "cython/core/manifold.pyx":1216
 *                       &initial_shape_accuracy, &current_shape_accuracy,
 *                       &initial_modulus, &current_modulus)
 *         get_holonomy(self.c_triangulation, cusp_index,             # <<<<<<<<<<<<<<
 *                      &c_meridian, &c_longitude,
 *                      &meridian_accuracy, &longitude_accuracy)
*/
  get_holonomy(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_cusp_index, (&__pyx_v_c_meridian), (&__pyx_v_c_longitude), (&__pyx_v_meridian_accuracy), (&__pyx_v_longitude_accuracy)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1216, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1219
 *                      &c_meridian, &c_longitude,
 *                      &meridian_accuracy, &longitude_accuracy)
 *         shape= Complex2Number(current_shape)             # <<<<<<<<<<<<<<
 *         shape.accuracy = current_shape_accuracy
 *         meridian = Complex2Number(c_meridian)
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_current_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_shape = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1220
 *                      &meridian_accuracy, &longitude_accuracy)
 *         shape= Complex2Number(current_shape)
 *         shape.accuracy = current_shape_accuracy             # <<<<<<<<<<<<<<
 *         meridian = Complex2Number(c_meridian)
 *         meridian.accuracy = meridian_accuracy
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_current_shape_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_shape, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_2) < 0) __PYX_ERR(2, 1220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1221
 *         shape= Complex2Number(current_shape)
 *         shape.accuracy = current_shape_accuracy
 *         meridian = Complex2Number(c_meridian)             # <<<<<<<<<<<<<<
 *         meridian.accuracy = meridian_accuracy
 *         longitude = Complex2Number(c_longitude)
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_c_meridian); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1222
 *         shape.accuracy = current_shape_accuracy
 *         meridian = Complex2Number(c_meridian)
 *         meridian.accuracy = meridian_accuracy             # <<<<<<<<<<<<<<
 *         longitude = Complex2Number(c_longitude)
 *         longitude.accuracy = longitude_accuracy
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_meridian_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_meridian, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_2) < 0) __PYX_ERR(2, 1222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1223
 *         meridian = Complex2Number(c_meridian)
 *         meridian.accuracy = meridian_accuracy
 *         longitude = Complex2Number(c_longitude)             # <<<<<<<<<<<<<<
 *         longitude.accuracy = longitude_accuracy
 *         modulus = Complex2Number(current_modulus)
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_c_longitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_longitude = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1224
 *         meridian.accuracy = meridian_accuracy
 *         longitude = Complex2Number(c_longitude)
 *         longitude.accuracy = longitude_accuracy             # <<<<<<<<<<<<<<
 *         modulus = Complex2Number(current_modulus)
 *         info = {
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_longitude_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_longitude, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_2) < 0) __PYX_ERR(2, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1225
 *         longitude = Complex2Number(c_longitude)
 *         longitude.accuracy = longitude_accuracy
 *         modulus = Complex2Number(current_modulus)             # <<<<<<<<<<<<<<
 *         info = {
 *             'index' : cusp_index,
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_current_modulus); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_modulus = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1227
 *         modulus = Complex2Number(current_modulus)
 *         info = {
 *             'index' : cusp_index,             # <<<<<<<<<<<<<<
 *             'topology' : CuspTopology[topology],
 *             'is_complete' : B2B(is_complete),
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_cusp_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_7) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/manifold.pyx":1228
 *         info = {
 *             'index' : cusp_index,
 *             'topology' : CuspTopology[topology],             # <<<<<<<<<<<<<<
 *             'is_complete' : B2B(is_complete),
 *             'filling' : (Real2float(m), Real2float(l)),
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_CuspTopology); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyLong_From_CuspTopology(__pyx_v_topology); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_topology, __pyx_t_3) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1229
 *             'index' : cusp_index,
 *             'topology' : CuspTopology[topology],
 *             'is_complete' : B2B(is_complete),             # <<<<<<<<<<<<<<
 *             'filling' : (Real2float(m), Real2float(l)),
 *             'shape': self._number_(shape),
*/
  __pyx_t_3 = __pyx_f_8SnapPyHP_B2B(__pyx_v_is_complete); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_complete, __pyx_t_3) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1230
 *             'topology' : CuspTopology[topology],
 *             'is_complete' : B2B(is_complete),
 *             'filling' : (Real2float(m), Real2float(l)),             # <<<<<<<<<<<<<<
 *             'shape': self._number_(shape),
 *             'shape_accuracy': current_shape_accuracy,
*/
  __pyx_t_3 = __pyx_f_8SnapPyHP_Real2float(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8SnapPyHP_Real2float(__pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(2, 1230, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4) != (0)) __PYX_ERR(2, 1230, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_filling, __pyx_t_7) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/manifold.pyx":1231
 *             'is_complete' : B2B(is_complete),
 *             'filling' : (Real2float(m), Real2float(l)),
 *             'shape': self._number_(shape),             # <<<<<<<<<<<<<<
 *             'shape_accuracy': current_shape_accuracy,
 *             'modulus': self._number_(modulus),
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_shape};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_7) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/manifold.pyx":1232
 *             'filling' : (Real2float(m), Real2float(l)),
 *             'shape': self._number_(shape),
 *             'shape_accuracy': current_shape_accuracy,             # <<<<<<<<<<<<<<
 *             'modulus': self._number_(modulus),
 *             'holonomies': (self._number_(meridian), self._number_(longitude)),
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_current_shape_accuracy); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_shape_accuracy, __pyx_t_7) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/manifold.pyx":1233
 *             'shape': self._number_(shape),
 *             'shape_accuracy': current_shape_accuracy,
 *             'modulus': self._number_(modulus),             # <<<<<<<<<<<<<<
 *             'holonomies': (self._number_(meridian), self._number_(longitude)),
 *             'holonomy_accuracy': min(meridian_accuracy,longitude_accuracy)
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_modulus};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_modulus, __pyx_t_7) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/manifold.pyx":1234
 *             'shape_accuracy': current_shape_accuracy,
 *             'modulus': self._number_(modulus),
 *             'holonomies': (self._number_(meridian), self._number_(longitude)),             # <<<<<<<<<<<<<<
 *             'holonomy_accuracy': min(meridian_accuracy,longitude_accuracy)
 *         }
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_meridian};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_longitude};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(2, 1234, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(2, 1234, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_holonomies, __pyx_t_3) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1235
 *             'modulus': self._number_(modulus),
 *             'holonomies': (self._number_(meridian), self._number_(longitude)),
 *             'holonomy_accuracy': min(meridian_accuracy,longitude_accuracy)             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  __pyx_t_15 = __pyx_v_longitude_accuracy;
  __pyx_t_16 = __pyx_v_meridian_accuracy;
  __pyx_t_6 = (__pyx_t_15 < __pyx_t_16);
  if (__pyx_t_6) {
    __pyx_t_17 = __pyx_t_15;
  } else {
    __pyx_t_17 = __pyx_t_16;
  }
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_holonomy_accuracy, __pyx_t_3) < 0) __PYX_ERR(2, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_info = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1238
 *         }
 * 
 *         core_geodesic(self.c_triangulation, cusp_index,             # <<<<<<<<<<<<<<
 *                       &singularity_index, &c_core_length, &accuracy)
 * 
*/
  core_geodesic(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_cusp_index, (&__pyx_v_singularity_index), (&__pyx_v_c_core_length), (&__pyx_v_accuracy)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1238, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1241
 *                       &singularity_index, &c_core_length, &accuracy)
 * 
 *         if singularity_index != 0:             # <<<<<<<<<<<<<<
 *             core_length = Complex2Number(c_core_length)
 *             core_length.accuracy = accuracy
*/
  __pyx_t_6 = (__pyx_v_singularity_index != 0);
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":1242
 * 
 *         if singularity_index != 0:
 *             core_length = Complex2Number(c_core_length)             # <<<<<<<<<<<<<<
 *             core_length.accuracy = accuracy
 *             info.update({
*/
    __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_c_core_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_core_length = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1243
 *         if singularity_index != 0:
 *             core_length = Complex2Number(c_core_length)
 *             core_length.accuracy = accuracy             # <<<<<<<<<<<<<<
 *             info.update({
 *                 'core_length': self._number_(core_length),
*/
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_core_length, __pyx_mstate_global->__pyx_n_u_accuracy, __pyx_t_2) < 0) __PYX_ERR(2, 1243, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1245
 *             core_length.accuracy = accuracy
 *             info.update({
 *                 'core_length': self._number_(core_length),             # <<<<<<<<<<<<<<
 *                 'singularity_index': singularity_index
 *             })
*/
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_core_length};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_core_length, __pyx_t_3) < 0) __PYX_ERR(2, 1245, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1246
 *             info.update({
 *                 'core_length': self._number_(core_length),
 *                 'singularity_index': singularity_index             # <<<<<<<<<<<<<<
 *             })
 * 
*/
    __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_singularity_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_singularity_index, __pyx_t_3) < 0) __PYX_ERR(2, 1245, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1244
 *             core_length = Complex2Number(c_core_length)
 *             core_length.accuracy = accuracy
 *             info.update({             # <<<<<<<<<<<<<<
 *                 'core_length': self._number_(core_length),
 *                 'singularity_index': singularity_index
*/
    __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type__update, __pyx_v_info, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1241
 *                       &singularity_index, &c_core_length, &accuracy)
 * 
 *         if singularity_index != 0:             # <<<<<<<<<<<<<<
 *             core_length = Complex2Number(c_core_length)
 *             core_length.accuracy = accuracy
*/
  }

  /* "cython/core/manifold.pyx":1249
 *             })
 * 
 *         return CuspInfo(**info)             # <<<<<<<<<<<<<<
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CuspInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_Copy(__pyx_v_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1128
 *                             which_cusp, c_target, recompute)
 * 
 *     def cusp_info(self, data_spec=None, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Manifold.cusp_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_shape);
  __Pyx_XDECREF(__pyx_v_meridian);
  __Pyx_XDECREF(__pyx_v_longitude);
  __Pyx_XDECREF(__pyx_v_modulus);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_core_length);
  __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1251
 *         return CuspInfo(**info)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_63dehn_fill(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_8SnapPyHP_8Manifold_62dehn_fill, "\n        Set the Dehn filling coefficients of the cusps.  This can be\n        specified in the following ways, where the cusps are numbered\n        by 0,1,...,(num_cusps - 1).\n\n        - Fill cusp 2:\n\n          >>> M = Manifold('8^4_1')\n          >>> M.dehn_fill((2,3), 2)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(0,0)\n\n        - Fill the last cusp:\n\n          >>> M.dehn_fill((1,5), -1)\n          >>> M\n          8^4_1(0,0)(0,0)(2,3)(1,5)\n\n        - Fill the first two cusps:\n\n          >>> M.dehn_fill( [ (3,0), (1, -4) ])\n          >>> M\n          8^4_1(3,0)(1,-4)(2,3)(1,5)\n\n        - When there is only one cusp, there's a shortcut\n\n          >>> N = Manifold('m004')\n          >>> N.dehn_fill( (-3,4) )\n          >>> N\n          m004(-3,4)\n\n        Does not return a new Manifold.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_63dehn_fill = {"dehn_fill", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_63dehn_fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_62dehn_fill};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_63dehn_fill(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_filling_data = 0;
  PyObject *__pyx_v_which_cusp = 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("dehn_fill (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filling_data,&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1251, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1251, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1251, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dehn_fill", 0) < 0) __PYX_ERR(2, 1251, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dehn_fill", 0, 1, 2, i); __PYX_ERR(2, 1251, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1251, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1251, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_filling_data = values[0];
    __pyx_v_which_cusp = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dehn_fill", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 1251, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.dehn_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_62dehn_fill(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_filling_data, __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_62dehn_fill(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_filling_data, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dehn_fill", 0);

  /* "cython/core/manifold.pyx":1285
 *         Does not return a new Manifold.
 *         """
 *         Triangulation.dehn_fill(self, filling_data, which_cusp)             # <<<<<<<<<<<<<<
 *         do_Dehn_filling(self.c_triangulation)
 *         self._cache.clear(message='Manifold.dehn_fill')
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_filling_data, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1286
 *         """
 *         Triangulation.dehn_fill(self, filling_data, which_cusp)
 *         do_Dehn_filling(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         self._cache.clear(message='Manifold.dehn_fill')
 * 
*/
  do_Dehn_filling(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1286, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1287
 *         Triangulation.dehn_fill(self, filling_data, which_cusp)
 *         do_Dehn_filling(self.c_triangulation)
 *         self._cache.clear(message='Manifold.dehn_fill')             # <<<<<<<<<<<<<<
 * 
 *     def set_peripheral_curves(self, peripheral_data,
*/
  __pyx_t_2 = __pyx_v_self->__pyx_base._cache;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_Manifold_dehn_fill, __pyx_t_4, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 1287, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1251
 *         return CuspInfo(**info)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
*/

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

/* "cython/core/manifold.pyx":1289
 *         self._cache.clear(message='Manifold.dehn_fill')
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_65set_peripheral_curves(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_8SnapPyHP_8Manifold_64set_peripheral_curves, "\n        Each cusp has a preferred marking. In the case of a torus\n        cusp, this is pair of essential simple curves meeting in one\n        point; equivalently, a basis of the first homology of the\n        boundary torus. These curves are called the meridian and the\n        longitude.\n\n        This method changes these markings in various ways.  In many\n        cases, if the flag return_matrices is True then it returns\n        a list of change-of-basis matrices is returned, one per\n        cusp, which will restore the original markings if passed\n        as peripheral_data.\n\n        - Make the shortest curves the meridians, and the second\n          shortest curves the longitudes.\n\n          >>> M = Manifold('5_2')\n          >>> M.cusp_info('shape') # doctest: +NUMERIC6\n          [-2.49024467 + 2.97944707*I]\n          >>> cob = M.set_peripheral_curves('shortest', return_matrices=True)\n          >>> M.cusp_info('shape') # doctest: +NUMERIC6\n          [-0.49024467 + 2.97944707*I]\n          >>> cob\n          [[[1, 0], [-2, 1]]]\n          >>> M.set_peripheral_curves(cob)\n          >>> M.cusp_info('shape') # doctest: +NUMERIC6\n          [-2.49024467 + 2.97944707*I]\n\n          You can also make just the meridians as short as\n          possible while fixing the longitudes via the option\n          'shortest_meridians', and conversely with\n          'shortest_longitudes'.\n\n        - If cusps are Dehn filled, make those curves meridians.\n\n          >>> M = Manifold('m125(0,0)(2,5)')\n          >>> M.set_peripheral_curves('fillings')\n          >>> M\n          m125(0,0)(1,0)\n\n        - Change the basis of a particular cusp, say the first one:\n\n          >>> M.set_peripheral_curves( [ (1,2), (1,3) ] , 0)\n\n          Here (1,2) is the new meridian written in the old basis, and\n          (1,3) the new longitude.\n\n        - Change the basis of all the cusps at once\n\n          >>> new_curves = [ [(1,-1), (1,0)],  [(3,2), (-2,-1)] ]""\n          >>> M.set_peripheral_curves(new_curves)\n          >>> M\n          m125(0,0)(-1,-2)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_65set_peripheral_curves = {"set_peripheral_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_65set_peripheral_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_64set_peripheral_curves};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_65set_peripheral_curves(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_peripheral_data = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_return_matrices = 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_peripheral_curves (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_peripheral_data,&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_return_matrices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1289, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_peripheral_curves", 0) < 0) __PYX_ERR(2, 1289, __pyx_L3_error)

      /* "cython/core/manifold.pyx":1290
 * 
 *     def set_peripheral_curves(self, peripheral_data,
 *                               which_cusp=None, return_matrices=False):             # <<<<<<<<<<<<<<
 *         """
 *         Each cusp has a preferred marking. In the case of a torus
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_peripheral_curves", 0, 1, 3, i); __PYX_ERR(2, 1289, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1289, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_peripheral_data = values[0];
    __pyx_v_which_cusp = values[1];
    __pyx_v_return_matrices = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_peripheral_curves", 0, 1, 3, __pyx_nargs); __PYX_ERR(2, 1289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.set_peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_64set_peripheral_curves(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_peripheral_data, __pyx_v_which_cusp, __pyx_v_return_matrices);

  /* "cython/core/manifold.pyx":1289
 *         self._cache.clear(message='Manifold.dehn_fill')
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_64set_peripheral_curves(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_peripheral_data, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_return_matrices) {
  int __pyx_v_d;
  MatrixInt22 *__pyx_v_matrices;
  PyObject *__pyx_v_cusps = NULL;
  PyObject *__pyx_v_cobs = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_peripheral_curves", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/manifold.pyx":1348
 *         cdef MatrixInt22 *matrices
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1349
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty')             # <<<<<<<<<<<<<<
 * 
 *         if which_cusp is not None:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty_2};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1349, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1348
 *         cdef MatrixInt22 *matrices
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty')
 * 
*/
  }

  /* "cython/core/manifold.pyx":1351
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp is not None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
*/
  __pyx_t_1 = (__pyx_v_which_cusp != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1352
 * 
 *         if which_cusp is not None:
 *             which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *                 which_cusp, self.num_cusps(),
 *                 'The specified cusp (%s) does not exist.')
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/manifold.pyx":1353
 *         if which_cusp is not None:
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),             # <<<<<<<<<<<<<<
 *                 'The specified cusp (%s) does not exist.')
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_which_cusp, __pyx_t_6, __pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1351
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp is not None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
*/
  }

  /* "cython/core/manifold.pyx":1356
 *                 'The specified cusp (%s) does not exist.')
 * 
 *         self._cache.clear(message='Manifold.set_peripheral_curves')             # <<<<<<<<<<<<<<
 * 
 *         if peripheral_data == 'shortest_meridians':
*/
  __pyx_t_3 = __pyx_v_self->__pyx_base._cache;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_Manifold_set_peripheral_curves, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 1356, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1358
 *         self._cache.clear(message='Manifold.set_peripheral_curves')
 * 
 *         if peripheral_data == 'shortest_meridians':             # <<<<<<<<<<<<<<
 *             # For each cusp, replace its current meridian with the
 *             # shortest one possible.
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_peripheral_data, __pyx_mstate_global->__pyx_n_u_shortest_meridians, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1358, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1361
 *             # For each cusp, replace its current meridian with the
 *             # shortest one possible.
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())             # <<<<<<<<<<<<<<
 *             cobs = []
 *             for i in cusps:
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_which_cusp); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1361, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1361, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_which_cusp) != (0)) __PYX_ERR(2, 1361, __pyx_L1_error);
      __pyx_t_2 = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_4 = __pyx_builtin_range; 
      __pyx_t_8 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_2 = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    __pyx_v_cusps = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1362
 *             # shortest one possible.
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []             # <<<<<<<<<<<<<<
 *             for i in cusps:
 *                 d = (1/self.cusp_info(i)['shape']).real().round()
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_cobs = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1363
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = (1/self.cusp_info(i)['shape']).real().round()
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
*/
    if (likely(PyList_CheckExact(__pyx_v_cusps)) || PyTuple_CheckExact(__pyx_v_cusps)) {
      __pyx_t_2 = __pyx_v_cusps; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1363, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1363, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1363, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1363, __pyx_L1_error)
      } else {
        __pyx_t_6 = __pyx_t_10(__pyx_t_2);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1363, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/manifold.pyx":1364
 *             cobs = []
 *             for i in cusps:
 *                 d = (1/self.cusp_info(i)['shape']).real().round()             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 *                 cobs.append([[1,d],[0,1]])
*/
      __pyx_t_11 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_i};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1364, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_mstate_global->__pyx_int_1, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_3 = __pyx_t_8;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_real, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1364, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_4 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1364, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1364, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_d = __pyx_t_12;

      /* "cython/core/manifold.pyx":1365
 *             for i in cusps:
 *                 d = (1/self.cusp_info(i)['shape']).real().round()
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)             # <<<<<<<<<<<<<<
 *                 cobs.append([[1,d],[0,1]])
 *             if return_matrices:
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyLong_From_int((-__pyx_v_d)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(2, 1365, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4) != (0)) __PYX_ERR(2, 1365, __pyx_L1_error);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_8);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_8) != (0)) __PYX_ERR(2, 1365, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[4]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_tuple[4]) != (0)) __PYX_ERR(2, 1365, __pyx_L1_error);
      __pyx_t_8 = 0;
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_4, __pyx_v_i};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_peripheral_curves, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/manifold.pyx":1366
 *                 d = (1/self.cusp_info(i)['shape']).real().round()
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 *                 cobs.append([[1,d],[0,1]])             # <<<<<<<<<<<<<<
 *             if return_matrices:
 *                 return cobs
*/
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(2, 1366, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_6) != (0)) __PYX_ERR(2, 1366, __pyx_L1_error);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(2, 1366, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(2, 1366, __pyx_L1_error);
      __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 1366, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(2, 1366, __pyx_L1_error);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_7); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 1366, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":1363
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = (1/self.cusp_info(i)['shape']).real().round()
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1367
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 *                 cobs.append([[1,d],[0,1]])
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 return cobs
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_matrices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1367, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":1368
 *                 cobs.append([[1,d],[0,1]])
 *             if return_matrices:
 *                 return cobs             # <<<<<<<<<<<<<<
 * 
 *         elif peripheral_data == 'shortest_longitudes':
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_cobs);
      __pyx_r = __pyx_v_cobs;
      goto __pyx_L0;

      /* "cython/core/manifold.pyx":1367
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 *                 cobs.append([[1,d],[0,1]])
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 return cobs
 * 
*/
    }

    /* "cython/core/manifold.pyx":1358
 *         self._cache.clear(message='Manifold.set_peripheral_curves')
 * 
 *         if peripheral_data == 'shortest_meridians':             # <<<<<<<<<<<<<<
 *             # For each cusp, replace its current meridian with the
 *             # shortest one possible.
*/
    goto __pyx_L5;
  }

  /* "cython/core/manifold.pyx":1370
 *                 return cobs
 * 
 *         elif peripheral_data == 'shortest_longitudes':             # <<<<<<<<<<<<<<
 *             # For each cusp, replace its current longitude with the
 *             # shortest one possible.
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_peripheral_data, __pyx_mstate_global->__pyx_n_u_shortest_longitudes, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1370, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1373
 *             # For each cusp, replace its current longitude with the
 *             # shortest one possible.
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())             # <<<<<<<<<<<<<<
 *             cobs = []
 *             for i in cusps:
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_which_cusp); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1373, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1373, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_which_cusp) != (0)) __PYX_ERR(2, 1373, __pyx_L1_error);
      __pyx_t_2 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_4 = __pyx_builtin_range; 
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1373, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1373, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_2 = __pyx_t_7;
      __pyx_t_7 = 0;
    }
    __pyx_v_cusps = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1374
 *             # shortest one possible.
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []             # <<<<<<<<<<<<<<
 *             for i in cusps:
 *                 d = self.cusp_info(i)['shape'].real().round()
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_cobs = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1375
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = self.cusp_info(i)['shape'].real().round()
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
*/
    if (likely(PyList_CheckExact(__pyx_v_cusps)) || PyTuple_CheckExact(__pyx_v_cusps)) {
      __pyx_t_2 = __pyx_v_cusps; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1375, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1375, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1375, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9));
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1375, __pyx_L1_error)
      } else {
        __pyx_t_7 = __pyx_t_10(__pyx_t_2);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1375, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":1376
 *             cobs = []
 *             for i in cusps:
 *                 d = self.cusp_info(i)['shape'].real().round()             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 *                 cobs.append([[1,0],[d,1]])
*/
      __pyx_t_11 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_i};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1376, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __pyx_t_11;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_real, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_4 = __pyx_t_8;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1376, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_d = __pyx_t_12;

      /* "cython/core/manifold.pyx":1377
 *             for i in cusps:
 *                 d = self.cusp_info(i)['shape'].real().round()
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)             # <<<<<<<<<<<<<<
 *                 cobs.append([[1,0],[d,1]])
 *             if return_matrices:
*/
      __pyx_t_8 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_PyLong_From_int((-__pyx_v_d)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 1377, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(2, 1377, __pyx_L1_error);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[5]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_tuple[5]) != (0)) __PYX_ERR(2, 1377, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_11) != (0)) __PYX_ERR(2, 1377, __pyx_L1_error);
      __pyx_t_11 = 0;
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_4, __pyx_v_i};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_peripheral_curves, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":1378
 *                 d = self.cusp_info(i)['shape'].real().round()
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 *                 cobs.append([[1,0],[d,1]])             # <<<<<<<<<<<<<<
 *             if return_matrices:
 *                 return cobs
*/
      __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(2, 1378, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(2, 1378, __pyx_L1_error);
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 1378, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(2, 1378, __pyx_L1_error);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_7) != (0)) __PYX_ERR(2, 1378, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_8);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_8) != (0)) __PYX_ERR(2, 1378, __pyx_L1_error);
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 1378, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":1375
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = self.cusp_info(i)['shape'].real().round()
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1379
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 *                 cobs.append([[1,0],[d,1]])
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 return cobs
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_matrices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1379, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":1380
 *                 cobs.append([[1,0],[d,1]])
 *             if return_matrices:
 *                 return cobs             # <<<<<<<<<<<<<<
 * 
 *         elif peripheral_data == 'shortest':
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_cobs);
      __pyx_r = __pyx_v_cobs;
      goto __pyx_L0;

      /* "cython/core/manifold.pyx":1379
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 *                 cobs.append([[1,0],[d,1]])
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 return cobs
 * 
*/
    }

    /* "cython/core/manifold.pyx":1370
 *                 return cobs
 * 
 *         elif peripheral_data == 'shortest_longitudes':             # <<<<<<<<<<<<<<
 *             # For each cusp, replace its current longitude with the
 *             # shortest one possible.
*/
    goto __pyx_L5;
  }

  /* "cython/core/manifold.pyx":1382
 *                 return cobs
 * 
 *         elif peripheral_data == 'shortest':             # <<<<<<<<<<<<<<
 *             if which_cusp is not None:
 *                 raise ValueError("You must apply 'shortest' to all "
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_peripheral_data, __pyx_mstate_global->__pyx_n_u_shortest, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1382, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1383
 * 
 *         elif peripheral_data == 'shortest':
 *             if which_cusp is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'shortest' to all "
 *                                  "of the cusps.")
*/
    __pyx_t_1 = (__pyx_v_which_cusp != Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":1384
 *         elif peripheral_data == 'shortest':
 *             if which_cusp is not None:
 *                 raise ValueError("You must apply 'shortest' to all "             # <<<<<<<<<<<<<<
 *                                  "of the cusps.")
 *             if return_matrices:
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_8 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_You_must_apply_shortest_to_all_o};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 1384, __pyx_L1_error)

      /* "cython/core/manifold.pyx":1383
 * 
 *         elif peripheral_data == 'shortest':
 *             if which_cusp is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'shortest' to all "
 *                                  "of the cusps.")
*/
    }

    /* "cython/core/manifold.pyx":1386
 *                 raise ValueError("You must apply 'shortest' to all "
 *                                  "of the cusps.")
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_matrices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1386, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":1387
 *                                  "of the cusps.")
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                                  sizeof(MatrixInt22))
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
*/
      __pyx_t_8 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }

      /* "cython/core/manifold.pyx":1388
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
 *                 cobs = []
*/
      __pyx_t_8 = __Pyx_PyLong_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);

      /* "cython/core/manifold.pyx":1387
 *                                  "of the cusps.")
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                                  sizeof(MatrixInt22))
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
*/
      __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1387, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_5));

      /* "cython/core/manifold.pyx":1389
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)             # <<<<<<<<<<<<<<
 *                 cobs = []
 *                 for n in range(self.num_cusps()):
*/
      install_shortest_with_matrices(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_matrices);

      /* "cython/core/manifold.pyx":1390
 *                                                  sizeof(MatrixInt22))
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
 *                 cobs = []             # <<<<<<<<<<<<<<
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][1][1], -matrices[n][0][1] ],
*/
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_cobs = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":1391
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
 *                 cobs = []
 *                 for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                     cobs.append([ [ matrices[n][1][1], -matrices[n][0][1] ],
 *                                   [ -matrices[n][1][0], matrices[n][0][0] ] ])
*/
      __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_builtin_range);
      __pyx_t_2 = __pyx_builtin_range; 
      __pyx_t_11 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1391, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1391, __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_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1391, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1391, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1391, __pyx_L1_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_9);
            ++__pyx_t_9;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1391, __pyx_L1_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9));
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9);
            #endif
            ++__pyx_t_9;
          }
          if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1391, __pyx_L1_error)
        } else {
          __pyx_t_4 = __pyx_t_10(__pyx_t_2);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1391, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cython/core/manifold.pyx":1392
 *                 cobs = []
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][1][1], -matrices[n][0][1] ],             # <<<<<<<<<<<<<<
 *                                   [ -matrices[n][1][0], matrices[n][0][0] ] ])
 *                 free(matrices)
*/
        __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1392, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyLong_From_int((((__pyx_v_matrices[__pyx_t_14])[1])[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1392, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyLong_From_int((-(((__pyx_v_matrices[__pyx_t_14])[0])[1]))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_4);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 1392, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(2, 1392, __pyx_L1_error);
        __pyx_t_4 = 0;
        __pyx_t_7 = 0;

        /* "cython/core/manifold.pyx":1393
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][1][1], -matrices[n][0][1] ],
 *                                   [ -matrices[n][1][0], matrices[n][0][0] ] ])             # <<<<<<<<<<<<<<
 *                 free(matrices)
 *                 return cobs
*/
        __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1393, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyLong_From_int((-(((__pyx_v_matrices[__pyx_t_14])[1])[0]))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1393, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyLong_From_int((((__pyx_v_matrices[__pyx_t_14])[0])[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_7) != (0)) __PYX_ERR(2, 1393, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_4);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_4) != (0)) __PYX_ERR(2, 1393, __pyx_L1_error);
        __pyx_t_7 = 0;
        __pyx_t_4 = 0;

        /* "cython/core/manifold.pyx":1392
 *                 cobs = []
 *                 for n in range(self.num_cusps()):
 *                     cobs.append([ [ matrices[n][1][1], -matrices[n][0][1] ],             # <<<<<<<<<<<<<<
 *                                   [ -matrices[n][1][0], matrices[n][0][0] ] ])
 *                 free(matrices)
*/
        __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_8);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_8) != (0)) __PYX_ERR(2, 1392, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_11);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_11) != (0)) __PYX_ERR(2, 1392, __pyx_L1_error);
        __pyx_t_8 = 0;
        __pyx_t_11 = 0;
        __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 1392, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/manifold.pyx":1391
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
 *                 cobs = []
 *                 for n in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                     cobs.append([ [ matrices[n][1][1], -matrices[n][0][1] ],
 *                                   [ -matrices[n][1][0], matrices[n][0][0] ] ])
*/
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/manifold.pyx":1394
 *                     cobs.append([ [ matrices[n][1][1], -matrices[n][0][1] ],
 *                                   [ -matrices[n][1][0], matrices[n][0][0] ] ])
 *                 free(matrices)             # <<<<<<<<<<<<<<
 *                 return cobs
 *             else:
*/
      free(__pyx_v_matrices);

      /* "cython/core/manifold.pyx":1395
 *                                   [ -matrices[n][1][0], matrices[n][0][0] ] ])
 *                 free(matrices)
 *                 return cobs             # <<<<<<<<<<<<<<
 *             else:
 *                 install_shortest_bases(self.c_triangulation)
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_cobs);
      __pyx_r = __pyx_v_cobs;
      goto __pyx_L0;

      /* "cython/core/manifold.pyx":1386
 *                 raise ValueError("You must apply 'shortest' to all "
 *                                  "of the cusps.")
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))
*/
    }

    /* "cython/core/manifold.pyx":1397
 *                 return cobs
 *             else:
 *                 install_shortest_bases(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    /*else*/ {
      install_shortest_bases(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1397, __pyx_L1_error)
    }

    /* "cython/core/manifold.pyx":1382
 *                 return cobs
 * 
 *         elif peripheral_data == 'shortest':             # <<<<<<<<<<<<<<
 *             if which_cusp is not None:
 *                 raise ValueError("You must apply 'shortest' to all "
*/
    goto __pyx_L5;
  }

  /* "cython/core/manifold.pyx":1400
 * 
 *         else:
 *             return Triangulation.set_peripheral_curves(             # <<<<<<<<<<<<<<
 *                 self, peripheral_data, which_cusp,return_matrices)
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
    __Pyx_INCREF(__pyx_t_4);

    /* "cython/core/manifold.pyx":1401
 *         else:
 *             return Triangulation.set_peripheral_curves(
 *                 self, peripheral_data, which_cusp,return_matrices)             # <<<<<<<<<<<<<<
 * 
 *     def dual_curves(self, max_segments=6):
*/
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_peripheral_data, __pyx_v_which_cusp, __pyx_v_return_matrices};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_peripheral_curves, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1400, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  /* "cython/core/manifold.pyx":1289
 *         self._cache.clear(message='Manifold.dehn_fill')
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.Manifold.set_peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cusps);
  __Pyx_XDECREF(__pyx_v_cobs);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1403
 *                 self, peripheral_data, which_cusp,return_matrices)
 * 
 *     def dual_curves(self, max_segments=6):             # <<<<<<<<<<<<<<
 *         """
 *         Constructs a *reasonable* selection of simple closed curves in
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_67dual_curves(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_8SnapPyHP_8Manifold_66dual_curves, "\n        Constructs a *reasonable* selection of simple closed curves in\n        a manifold's dual 1-skeleton.  In particular, it returns those\n        that appear to represent geodesics. The resulting curves can\n        be drilled out.\n\n        >>> M = Manifold('m015')\n        >>> curves = M.dual_curves()\n        >>> curves # doctest: +NUMERIC6\n        [  0: orientation-preserving curve of length 0.56239915 - 2.81543089*I,\n           1: orientation-preserving curve of length 1.12479830 + 0.65232354*I,\n           2: orientation-preserving curve of length 1.26080402 + 1.97804689*I,\n           3: orientation-preserving curve of length 1.58826933 + 1.67347167*I,\n           4: orientation-preserving curve of length 1.68719745 + 2.81543089*I]\n\n        Each curve is returned as an info object with these keys\n\n        >>> sorted(curves[0].keys())\n        ['complete_length', 'filled_length', 'index', 'max_segments', 'parity']\n\n        We can drill out any of these curves to get a new manifold\n        with one more cusp.\n\n        >>> N = M.drill(curves[0])\n        >>> (M.num_cusps(), N.num_cusps())\n        (1, 2)\n\n        By default, this function only finds curves of length 6; this\n        can be changed by specifying the optional argument\n        max_segments\n\n        >>> M.dual_curves(max_segments=2) # doctest: +NUMERIC6\n        [  0: orientation-preserving curve of length 0.56239915 - 2.81543089*I]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_67dual_curves = {"dual_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_67dual_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_66dual_curves};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_67dual_curves(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_max_segments = 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("dual_curves (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_segments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1403, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1403, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dual_curves", 0) < 0) __PYX_ERR(2, 1403, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1403, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
    }
    __pyx_v_max_segments = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dual_curves", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 1403, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.dual_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_66dual_curves(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_max_segments);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_66dual_curves(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_max_segments) {
  int __pyx_v_i;
  int __pyx_v_num_curves;
  DualOneSkeletonCurve **__pyx_v_curve_list;
  MatrixParity __pyx_v_parity;
  Complex __pyx_v_complete_length;
  Complex __pyx_v_filled_length;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_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 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dual_curves", 0);

  /* "cython/core/manifold.pyx":1443
 *         cdef Complex complete_length, filled_length
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         dual_curves(self.c_triangulation,
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1444
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         dual_curves(self.c_triangulation,
 *                     max_segments,
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1444, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1443
 *         cdef Complex complete_length, filled_length
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         dual_curves(self.c_triangulation,
*/
  }

  /* "cython/core/manifold.pyx":1446
 *             raise ValueError('The Triangulation is empty.')
 *         dual_curves(self.c_triangulation,
 *                     max_segments,             # <<<<<<<<<<<<<<
 *                     &num_curves,
 *                     &curve_list)
*/
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_v_max_segments); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1446, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1445
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         dual_curves(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                     max_segments,
 *                     &num_curves,
*/
  dual_curves(__pyx_v_self->__pyx_base.c_triangulation, __pyx_t_6, (&__pyx_v_num_curves), (&__pyx_v_curve_list)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1445, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1449
 *                     &num_curves,
 *                     &curve_list)
 *         result = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_curves:
 *             get_dual_curve_info(
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1450
 *                     &curve_list)
 *         result = []
 *         for i from 0 <= i < num_curves:             # <<<<<<<<<<<<<<
 *             get_dual_curve_info(
 *                 curve_list[i],
*/
  __pyx_t_6 = __pyx_v_num_curves;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "cython/core/manifold.pyx":1451
 *         result = []
 *         for i from 0 <= i < num_curves:
 *             get_dual_curve_info(             # <<<<<<<<<<<<<<
 *                 curve_list[i],
 *                 &complete_length,
*/
    get_dual_curve_info((__pyx_v_curve_list[__pyx_v_i]), (&__pyx_v_complete_length), (&__pyx_v_filled_length), (&__pyx_v_parity)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1451, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1458
 *                 )
 *             result.append(
 *                 DualCurveInfo(             # <<<<<<<<<<<<<<
 *                     index=i,
 *                     parity=parity,
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_DualCurveInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/manifold.pyx":1459
 *             result.append(
 *                 DualCurveInfo(
 *                     index=i,             # <<<<<<<<<<<<<<
 *                     parity=parity,
 *                     filled_length=self._number_(Complex2Number(filled_length)),
*/
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cython/core/manifold.pyx":1460
 *                 DualCurveInfo(
 *                     index=i,
 *                     parity=parity,             # <<<<<<<<<<<<<<
 *                     filled_length=self._number_(Complex2Number(filled_length)),
 *                     complete_length=self._number_(Complex2Number(complete_length)),
*/
    __pyx_t_8 = __Pyx_PyLong_From_MatrixParity(__pyx_v_parity); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "cython/core/manifold.pyx":1461
 *                     index=i,
 *                     parity=parity,
 *                     filled_length=self._number_(Complex2Number(filled_length)),             # <<<<<<<<<<<<<<
 *                     complete_length=self._number_(Complex2Number(complete_length)),
 *                     max_segments=max_segments
*/
    __pyx_t_10 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_11 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_filled_length); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
      __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }

    /* "cython/core/manifold.pyx":1462
 *                     parity=parity,
 *                     filled_length=self._number_(Complex2Number(filled_length)),
 *                     complete_length=self._number_(Complex2Number(complete_length)),             # <<<<<<<<<<<<<<
 *                     max_segments=max_segments
 *                   )
*/
    __pyx_t_10 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_12 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_complete_length); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }

    /* "cython/core/manifold.pyx":1463
 *                     filled_length=self._number_(Complex2Number(filled_length)),
 *                     complete_length=self._number_(Complex2Number(complete_length)),
 *                     max_segments=max_segments             # <<<<<<<<<<<<<<
 *                   )
 *                )
*/
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_4, NULL};
      __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_index, __pyx_t_7, __pyx_t_12, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 1458, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_parity, __pyx_t_8, __pyx_t_12, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 1458, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filled_length, __pyx_t_9, __pyx_t_12, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 1458, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_complete_length, __pyx_t_11, __pyx_t_12, __pyx_callargs+1, 3) < 0) __PYX_ERR(2, 1458, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_max_segments, __pyx_v_max_segments, __pyx_t_12, __pyx_callargs+1, 4) < 0) __PYX_ERR(2, 1458, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "cython/core/manifold.pyx":1457
 *                 &parity
 *                 )
 *             result.append(             # <<<<<<<<<<<<<<
 *                 DualCurveInfo(
 *                     index=i,
*/
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 1457, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/manifold.pyx":1466
 *                   )
 *                )
 *         free_dual_curves(num_curves, curve_list)             # <<<<<<<<<<<<<<
 *         return ListOnePerLine(result)
 * 
*/
  free_dual_curves(__pyx_v_num_curves, __pyx_v_curve_list); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1466, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1467
 *                )
 *         free_dual_curves(num_curves, curve_list)
 *         return ListOnePerLine(result)             # <<<<<<<<<<<<<<
 * 
 *     def length_spectrum(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ListOnePerLine); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_result};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1403
 *                 self, peripheral_data, which_cusp,return_matrices)
 * 
 *     def dual_curves(self, max_segments=6):             # <<<<<<<<<<<<<<
 *         """
 *         Constructs a *reasonable* selection of simple closed curves in
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Manifold.dual_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1469
 *         return ListOnePerLine(result)
 * 
 *     def length_spectrum(self,             # <<<<<<<<<<<<<<
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_69length_spectrum(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_8SnapPyHP_8Manifold_68length_spectrum, "\n        Returns a list of geodesics (with multiplicities) of length\n        up to the specified cutoff value. (The default cutoff is 1.0.)\n\n        Here's a quick example:\n\n        >>> L = Manifold(\"m016\").length_spectrum(0.75, include_words=True)\n        >>> L # doctest: +SKIP\n        mult  length                                  topology     parity word\n        1     0.58460368501799 +  2.49537045556047*I  circle       +      a\n        1     0.72978937305180 +  3.02669828218116*I  circle       +      Bc\n\n        Access just the length:\n\n        >>> L[0].length # doctest: +NUMERIC6\n        0.584603685017987 + 2.495370455560469*I\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_69length_spectrum = {"length_spectrum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_69length_spectrum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_68length_spectrum};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_69length_spectrum(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_cutoff = 0;
  PyObject *__pyx_v_full_rigor = 0;
  PyObject *__pyx_v_grouped = 0;
  PyObject *__pyx_v_include_words = 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("length_spectrum (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cutoff,&__pyx_mstate_global->__pyx_n_u_full_rigor,&__pyx_mstate_global->__pyx_n_u_grouped,&__pyx_mstate_global->__pyx_n_u_include_words,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1469, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "length_spectrum", 0) < 0) __PYX_ERR(2, 1469, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));

      /* "cython/core/manifold.pyx":1471
 *     def length_spectrum(self,
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,             # <<<<<<<<<<<<<<
 *                         grouped : bool = True,
 *                         include_words : bool = False):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":1472
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,
 *                         grouped : bool = True,             # <<<<<<<<<<<<<<
 *                         include_words : bool = False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":1473
 *                         full_rigor : bool =True,
 *                         grouped : bool = True,
 *                         include_words : bool = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of geodesics (with multiplicities) of length
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));

      /* "cython/core/manifold.pyx":1471
 *     def length_spectrum(self,
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,             # <<<<<<<<<<<<<<
 *                         grouped : bool = True,
 *                         include_words : bool = False):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":1472
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,
 *                         grouped : bool = True,             # <<<<<<<<<<<<<<
 *                         include_words : bool = False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/manifold.pyx":1473
 *                         full_rigor : bool =True,
 *                         grouped : bool = True,
 *                         include_words : bool = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of geodesics (with multiplicities) of length
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_cutoff = values[0];
    __pyx_v_full_rigor = values[1];
    __pyx_v_grouped = values[2];
    __pyx_v_include_words = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("length_spectrum", 0, 0, 4, __pyx_nargs); __PYX_ERR(2, 1469, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.length_spectrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_68length_spectrum(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_full_rigor, __pyx_v_grouped, __pyx_v_include_words);

  /* "cython/core/manifold.pyx":1469
 *         return ListOnePerLine(result)
 * 
 *     def length_spectrum(self,             # <<<<<<<<<<<<<<
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_68length_spectrum(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_full_rigor, PyObject *__pyx_v_grouped, PyObject *__pyx_v_include_words) {
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_D = 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;
  int __pyx_t_7;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("length_spectrum", 0);

  /* "cython/core/manifold.pyx":1491
 *         0.584603685017987 + 2.495370455560469*I
 *         """
 *         args = (cutoff, full_rigor, grouped, include_words)             # <<<<<<<<<<<<<<
 *         try:
 *             return self._cache.lookup('length_spectrum', *args)
*/
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_cutoff);
  __Pyx_GIVEREF(__pyx_v_cutoff);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cutoff) != (0)) __PYX_ERR(2, 1491, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_full_rigor);
  __Pyx_GIVEREF(__pyx_v_full_rigor);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_full_rigor) != (0)) __PYX_ERR(2, 1491, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_grouped);
  __Pyx_GIVEREF(__pyx_v_grouped);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_grouped) != (0)) __PYX_ERR(2, 1491, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_include_words);
  __Pyx_GIVEREF(__pyx_v_include_words);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_include_words) != (0)) __PYX_ERR(2, 1491, __pyx_L1_error);
  __pyx_v_args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1492
 *         """
 *         args = (cutoff, full_rigor, grouped, include_words)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('length_spectrum', *args)
 *         except KeyError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "cython/core/manifold.pyx":1493
 *         args = (cutoff, full_rigor, grouped, include_words)
 *         try:
 *             return self._cache.lookup('length_spectrum', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_mstate_global->__pyx_tuple[21], __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/manifold.pyx":1492
 *         """
 *         args = (cutoff, full_rigor, grouped, include_words)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('length_spectrum', *args)
 *         except KeyError:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1494
 *         try:
 *             return self._cache.lookup('length_spectrum', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 *         D = self.dirichlet_domain(include_words = include_words)
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "cython/core/manifold.pyx":1492
 *         """
 *         args = (cutoff, full_rigor, grouped, include_words)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('length_spectrum', *args)
 *         except KeyError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
  }

  /* "cython/core/manifold.pyx":1496
 *         except KeyError:
 *             pass
 *         D = self.dirichlet_domain(include_words = include_words)             # <<<<<<<<<<<<<<
 *         return self._cache.save(
 *             D.length_spectrum_dicts(
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_include_words, __pyx_v_include_words, __pyx_t_1, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 1496, __pyx_L1_error)
    __pyx_t_6 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_dirichlet_domain, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_D = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/manifold.pyx":1497
 *             pass
 *         D = self.dirichlet_domain(include_words = include_words)
 *         return self._cache.save(             # <<<<<<<<<<<<<<
 *             D.length_spectrum_dicts(
 *                 cutoff_length = cutoff,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_mstate_global->__pyx_n_u_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/manifold.pyx":1498
 *         D = self.dirichlet_domain(include_words = include_words)
 *         return self._cache.save(
 *             D.length_spectrum_dicts(             # <<<<<<<<<<<<<<
 *                 cutoff_length = cutoff,
 *                 full_rigor = full_rigor,
*/
  __pyx_t_5 = __pyx_v_D;
  __Pyx_INCREF(__pyx_t_5);

  /* "cython/core/manifold.pyx":1501
 *                 cutoff_length = cutoff,
 *                 full_rigor = full_rigor,
 *                 grouped = grouped),             # <<<<<<<<<<<<<<
 *             'length_spectrum',
 *             *args)
*/
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cutoff_length, __pyx_v_cutoff, __pyx_t_9, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 1498, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_full_rigor, __pyx_v_full_rigor, __pyx_t_9, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 1498, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grouped, __pyx_v_grouped, __pyx_t_9, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 1498, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_length_spectrum_dicts, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "cython/core/manifold.pyx":1497
 *             pass
 *         D = self.dirichlet_domain(include_words = include_words)
 *         return self._cache.save(             # <<<<<<<<<<<<<<
 *             D.length_spectrum_dicts(
 *                 cutoff_length = cutoff,
*/
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 1497, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_length_spectrum);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_length_spectrum);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_mstate_global->__pyx_n_u_length_spectrum) != (0)) __PYX_ERR(2, 1497, __pyx_L1_error);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1503
 *                 grouped = grouped),
 *             'length_spectrum',
 *             *args)             # <<<<<<<<<<<<<<
 * 
 *     def drill(self, which_curve, max_segments=6):
*/
  __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "cython/core/manifold.pyx":1497
 *             pass
 *         D = self.dirichlet_domain(include_words = include_words)
 *         return self._cache.save(             # <<<<<<<<<<<<<<
 *             D.length_spectrum_dicts(
 *                 cutoff_length = cutoff,
*/
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1469
 *         return ListOnePerLine(result)
 * 
 *     def length_spectrum(self,             # <<<<<<<<<<<<<<
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.Manifold.length_spectrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1505
 *             *args)
 * 
 *     def drill(self, which_curve, max_segments=6):             # <<<<<<<<<<<<<<
 *         """
 *         Drills out the specified dual curve from among all dual curves
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_71drill(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_8SnapPyHP_8Manifold_70drill, "\n        Drills out the specified dual curve from among all dual curves\n        with at most max_segments, which defaults to 6. The method\n        dual_curve allows one to see the properties of curves before\n        choosing which one to drill out.\n\n        >>> M = Manifold('v3000')\n        >>> N = M.drill(0, max_segments=3)\n        >>> (M.num_cusps(), N.num_cusps())\n        (1, 2)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_71drill = {"drill", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_71drill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_70drill};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_71drill(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_which_curve = 0;
  PyObject *__pyx_v_max_segments = 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("drill (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_curve,&__pyx_mstate_global->__pyx_n_u_max_segments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1505, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1505, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1505, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "drill", 0) < 0) __PYX_ERR(2, 1505, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("drill", 0, 1, 2, i); __PYX_ERR(2, 1505, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1505, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1505, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_6));
    }
    __pyx_v_which_curve = values[0];
    __pyx_v_max_segments = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("drill", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 1505, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.drill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_70drill(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_which_curve, __pyx_v_max_segments);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_70drill(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_which_curve, PyObject *__pyx_v_max_segments) {
  int __pyx_v_num_curves;
  DualOneSkeletonCurve **__pyx_v_curve_list;
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_result = 0;
  char *__pyx_v_c_new_name;
  PyObject *__pyx_v_new_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Triangulation *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drill", 0);
  __Pyx_INCREF(__pyx_v_which_curve);
  __Pyx_INCREF(__pyx_v_max_segments);

  /* "cython/core/manifold.pyx":1524
 *         cdef char* c_new_name
 * 
 *         if isinstance(which_curve, DualCurveInfo):             # <<<<<<<<<<<<<<
 *             max_segments = which_curve.max_segments
 *             which_curve = which_curve.index
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_DualCurveInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_which_curve, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/manifold.pyx":1525
 * 
 *         if isinstance(which_curve, DualCurveInfo):
 *             max_segments = which_curve.max_segments             # <<<<<<<<<<<<<<
 *             which_curve = which_curve.index
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_which_curve, __pyx_mstate_global->__pyx_n_u_max_segments); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_max_segments, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":1526
 *         if isinstance(which_curve, DualCurveInfo):
 *             max_segments = which_curve.max_segments
 *             which_curve = which_curve.index             # <<<<<<<<<<<<<<
 * 
 *         new_name = to_byte_str(self.name() + '-%d' % which_curve)
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_which_curve, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_which_curve, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":1524
 *         cdef char* c_new_name
 * 
 *         if isinstance(which_curve, DualCurveInfo):             # <<<<<<<<<<<<<<
 *             max_segments = which_curve.max_segments
 *             which_curve = which_curve.index
*/
  }

  /* "cython/core/manifold.pyx":1528
 *             which_curve = which_curve.index
 * 
 *         new_name = to_byte_str(self.name() + '-%d' % which_curve)             # <<<<<<<<<<<<<<
 *         c_new_name = new_name
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d_4, __pyx_v_which_curve); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_new_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1529
 * 
 *         new_name = to_byte_str(self.name() + '-%d' % which_curve)
 *         c_new_name = new_name             # <<<<<<<<<<<<<<
 * 
 *         dual_curves(self.c_triangulation,
*/
  __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_new_name); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(2, 1529, __pyx_L1_error)
  __pyx_v_c_new_name = __pyx_t_9;

  /* "cython/core/manifold.pyx":1532
 * 
 *         dual_curves(self.c_triangulation,
 *                     max_segments,             # <<<<<<<<<<<<<<
 *                     &num_curves,
 *                     &curve_list)
*/
  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_v_max_segments); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1532, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1531
 *         c_new_name = new_name
 * 
 *         dual_curves(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                     max_segments,
 *                     &num_curves,
*/
  dual_curves(__pyx_v_self->__pyx_base.c_triangulation, __pyx_t_10, (&__pyx_v_num_curves), (&__pyx_v_curve_list)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1531, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1536
 *                     &curve_list)
 * 
 *         if which_curve not in range(num_curves):             # <<<<<<<<<<<<<<
 *             raise IndexError('The drilling curve requested is not '
 *                              'in range(%d).' % num_curves)
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_8 = __pyx_builtin_range; 
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_num_curves); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_which_curve, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/manifold.pyx":1537
 * 
 *         if which_curve not in range(num_curves):
 *             raise IndexError('The drilling curve requested is not '             # <<<<<<<<<<<<<<
 *                              'in range(%d).' % num_curves)
 * 
*/
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_builtin_IndexError);
    __pyx_t_3 = __pyx_builtin_IndexError; 

    /* "cython/core/manifold.pyx":1538
 *         if which_curve not in range(num_curves):
 *             raise IndexError('The drilling curve requested is not '
 *                              'in range(%d).' % num_curves)             # <<<<<<<<<<<<<<
 * 
 *         c_triangulation = drill_cusp(self.c_triangulation,
*/
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_num_curves); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_The_drilling_curve_requested_is, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 1537, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1536
 *                     &curve_list)
 * 
 *         if which_curve not in range(num_curves):             # <<<<<<<<<<<<<<
 *             raise IndexError('The drilling curve requested is not '
 *                              'in range(%d).' % num_curves)
*/
  }

  /* "cython/core/manifold.pyx":1541
 * 
 *         c_triangulation = drill_cusp(self.c_triangulation,
 *                                      curve_list[which_curve],             # <<<<<<<<<<<<<<
 *                                      c_new_name)
 *         free_dual_curves(num_curves, curve_list)
*/
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_curve); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1541, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1540
 *                              'in range(%d).' % num_curves)
 * 
 *         c_triangulation = drill_cusp(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                      curve_list[which_curve],
 *                                      c_new_name)
*/
  __pyx_t_12 = drill_cusp(__pyx_v_self->__pyx_base.c_triangulation, (__pyx_v_curve_list[__pyx_t_11]), __pyx_v_c_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1540, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_12;

  /* "cython/core/manifold.pyx":1543
 *                                      curve_list[which_curve],
 *                                      c_new_name)
 *         free_dual_curves(num_curves, curve_list)             # <<<<<<<<<<<<<<
 * 
 *         if c_triangulation == NULL:
*/
  free_dual_curves(__pyx_v_num_curves, __pyx_v_curve_list); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1543, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1545
 *         free_dual_curves(num_curves, curve_list)
 * 
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The curve is not isotopic to a geodesic.')
 *         else:
*/
  __pyx_t_2 = (__pyx_v_c_triangulation == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/manifold.pyx":1546
 * 
 *         if c_triangulation == NULL:
 *             raise RuntimeError('The curve is not isotopic to a geodesic.')             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.__class__('empty')
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_6 = __pyx_builtin_RuntimeError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_curve_is_not_isotopic_to_a_g};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 1546, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1545
 *         free_dual_curves(num_curves, curve_list)
 * 
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The curve is not isotopic to a geodesic.')
 *         else:
*/
  }

  /* "cython/core/manifold.pyx":1548
 *             raise RuntimeError('The curve is not isotopic to a geodesic.')
 *         else:
 *             result = self.__class__('empty')             # <<<<<<<<<<<<<<
 *             result.set_c_triangulation(c_triangulation)
 *             return result
*/
  /*else*/ {
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(2, 1548, __pyx_L1_error)
    __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":1549
 *         else:
 *             result = self.__class__('empty')
 *             result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *             return result
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_result->__pyx_vtab)->set_c_triangulation(__pyx_v_result, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":1550
 *             result = self.__class__('empty')
 *             result.set_c_triangulation(c_triangulation)
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     def _is_isometric_to(self,
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_result);
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":1505
 *             *args)
 * 
 *     def drill(self, which_curve, max_segments=6):             # <<<<<<<<<<<<<<
 *         """
 *         Drills out the specified dual curve from among all dual curves
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.Manifold.drill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_new_name);
  __Pyx_XDECREF(__pyx_v_which_curve);
  __Pyx_XDECREF(__pyx_v_max_segments);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1552
 *             return result
 * 
 *     def _is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                          Manifold other,
 *                          return_isometries : bool = False):
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_73_is_isometric_to(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_8SnapPyHP_8Manifold_72_is_isometric_to, "\n        Returns ``True`` if M and N are isometric, ``False`` if they not.\n        A ``RuntimeError`` is raised in cases where the SnapPea kernel fails\n        to determine either answer.  (This is fairly common for closed\n        manifolds.)\n\n        >>> M = Manifold('m004')\n        >>> N = Manifold('4_1')\n        >>> K = Manifold('5_2')\n        >>> M.is_isometric_to(N)\n        True\n        >>> N.is_isometric_to(K)\n        False\n\n        We can also get a complete list of isometries between the two\n        manifolds:\n\n        >>> M = Manifold('5^2_1')  # The Whitehead link\n        >>> N = Manifold('m129')\n        >>> isoms = M.is_isometric_to(N, return_isometries = True)\n        >>> isoms[6]  # Includes action on cusps\n        0 -> 1  1 -> 0\n        [1  2]  [-1 -2]\n        [0 -1]  [ 0  1]\n        Extends to link\n\n        Each transformation between cusps is given by a matrix which\n        acts on the left.  That is, the two *columns* of the matrix\n        give the image of the meridian and longitude respectively.  In\n        the above example, the meridian of cusp 0 is sent to the\n        meridian of cusp 1.\n\n        Note: The answer ``True`` is rigorous, but the answer ``False`` may\n        not be as there could be numerical errors resulting in finding\n        an incorrect canonical triangulation.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_73_is_isometric_to = {"_is_isometric_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_73_is_isometric_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_72_is_isometric_to};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_73_is_isometric_to(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
) {
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_other = 0;
  PyObject *__pyx_v_return_isometries = 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("_is_isometric_to (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,&__pyx_mstate_global->__pyx_n_u_return_isometries,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1552, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1552, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1552, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_is_isometric_to", 0) < 0) __PYX_ERR(2, 1552, __pyx_L3_error)

      /* "cython/core/manifold.pyx":1554
 *     def _is_isometric_to(self,
 *                          Manifold other,
 *                          return_isometries : bool = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns ``True`` if M and N are isometric, ``False`` if they not.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_is_isometric_to", 0, 1, 2, i); __PYX_ERR(2, 1552, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1552, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1552, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_other = ((struct __pyx_obj_8SnapPyHP_Manifold *)values[0]);
    __pyx_v_return_isometries = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_is_isometric_to", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 1552, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._is_isometric_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, 1, "other", 0))) __PYX_ERR(2, 1553, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_72_is_isometric_to(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_other, __pyx_v_return_isometries);

  /* "cython/core/manifold.pyx":1552
 *             return result
 * 
 *     def _is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                          Manifold other,
 *                          return_isometries : bool = False):
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_72_is_isometric_to(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_other, PyObject *__pyx_v_return_isometries) {
  Boolean __pyx_v_are_isometric;
  FuncResult __pyx_v_result;
  IsometryList *__pyx_v_isometries;
  PyObject *__pyx_v_ans = 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;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  FuncResult __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_is_isometric_to", 0);

  /* "cython/core/manifold.pyx":1593
 *         cdef Boolean are_isometric
 *         cdef c_FuncResult result
 *         cdef IsometryList *isometries = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:
*/
  __pyx_v_isometries = NULL;

  /* "cython/core/manifold.pyx":1595
 *         cdef IsometryList *isometries = NULL
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifolds must be non-empty.')
 * 
*/
  __pyx_t_2 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_other->__pyx_base.c_triangulation == NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1596
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:
 *             raise ValueError('Manifolds must be non-empty.')             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Manifolds_must_be_non_empty};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 1596, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1595
 *         cdef IsometryList *isometries = NULL
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifolds must be non-empty.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":1598
 *             raise ValueError('Manifolds must be non-empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.homology() != other.homology():
 *                 if return_isometries:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "cython/core/manifold.pyx":1599
 * 
 *         try:
 *             if self.homology() != other.homology():             # <<<<<<<<<<<<<<
 *                 if return_isometries:
 *                     return []
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_homology, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1599, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_4 = ((PyObject *)__pyx_v_other);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_homology, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1599, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1599, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1599, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "cython/core/manifold.pyx":1600
 *         try:
 *             if self.homology() != other.homology():
 *                 if return_isometries:             # <<<<<<<<<<<<<<
 *                     return []
 *                 else:
*/
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_isometries); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1600, __pyx_L6_error)
        if (__pyx_t_1) {

          /* "cython/core/manifold.pyx":1601
 *             if self.homology() != other.homology():
 *                 if return_isometries:
 *                     return []             # <<<<<<<<<<<<<<
 *                 else:
 *                     return False
*/
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1601, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_r = __pyx_t_4;
          __pyx_t_4 = 0;
          goto __pyx_L10_try_return;

          /* "cython/core/manifold.pyx":1600
 *         try:
 *             if self.homology() != other.homology():
 *                 if return_isometries:             # <<<<<<<<<<<<<<
 *                     return []
 *                 else:
*/
        }

        /* "cython/core/manifold.pyx":1603
 *                     return []
 *                 else:
 *                     return False             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             pass
*/
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(Py_False);
          __pyx_r = Py_False;
          goto __pyx_L10_try_return;
        }

        /* "cython/core/manifold.pyx":1599
 * 
 *         try:
 *             if self.homology() != other.homology():             # <<<<<<<<<<<<<<
 *                 if return_isometries:
 *                     return []
*/
      }

      /* "cython/core/manifold.pyx":1598
 *             raise ValueError('Manifolds must be non-empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.homology() != other.homology():
 *                 if return_isometries:
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L11_try_end;
    __pyx_L6_error:;
    __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;

    /* "cython/core/manifold.pyx":1604
 *                 else:
 *                     return False
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_10) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L7_exception_handled;
    }
    goto __pyx_L8_except_error;

    /* "cython/core/manifold.pyx":1598
 *             raise ValueError('Manifolds must be non-empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.homology() != other.homology():
 *                 if return_isometries:
*/
    __pyx_L8_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L10_try_return:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L0;
    __pyx_L7_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    __pyx_L11_try_end:;
  }

  /* "cython/core/manifold.pyx":1607
 *             pass
 * 
 *         if return_isometries:             # <<<<<<<<<<<<<<
 *             result = compute_isometries(self.c_triangulation,
 *                                         other.c_triangulation,
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_isometries); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1607, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1608
 * 
 *         if return_isometries:
 *             result = compute_isometries(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         other.c_triangulation,
 *                                         &are_isometric,
*/
    __pyx_t_11 = compute_isometries(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_other->__pyx_base.c_triangulation, (&__pyx_v_are_isometric), (&__pyx_v_isometries), NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1608, __pyx_L1_error)
    __pyx_v_result = __pyx_t_11;

    /* "cython/core/manifold.pyx":1607
 *             pass
 * 
 *         if return_isometries:             # <<<<<<<<<<<<<<
 *             result = compute_isometries(self.c_triangulation,
 *                                         other.c_triangulation,
*/
    goto __pyx_L16;
  }

  /* "cython/core/manifold.pyx":1613
 *                                         &isometries, NULL)
 *         else:
 *             result = compute_isometries(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         other.c_triangulation,
 *                                         &are_isometric, NULL, NULL)
*/
  /*else*/ {

    /* "cython/core/manifold.pyx":1615
 *             result = compute_isometries(self.c_triangulation,
 *                                         other.c_triangulation,
 *                                         &are_isometric, NULL, NULL)             # <<<<<<<<<<<<<<
 * 
 *         if FuncResult[result] == 'func_bad_input':
*/
    __pyx_t_11 = compute_isometries(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_other->__pyx_base.c_triangulation, (&__pyx_v_are_isometric), NULL, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1613, __pyx_L1_error)
    __pyx_v_result = __pyx_t_11;
  }
  __pyx_L16:;

  /* "cython/core/manifold.pyx":1617
 *                                         &are_isometric, NULL, NULL)
 * 
 *         if FuncResult[result] == 'func_bad_input':             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dehn filling coefficients must be '
 *                              'relatively prime integers.')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FuncResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_func_bad_input, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1618
 * 
 *         if FuncResult[result] == 'func_bad_input':
 *             raise ValueError('The Dehn filling coefficients must be '             # <<<<<<<<<<<<<<
 *                              'relatively prime integers.')
 * 
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_The_Dehn_filling_coefficients_mu};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 1618, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1617
 *                                         &are_isometric, NULL, NULL)
 * 
 *         if FuncResult[result] == 'func_bad_input':             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dehn filling coefficients must be '
 *                              'relatively prime integers.')
*/
  }

  /* "cython/core/manifold.pyx":1621
 *                              'relatively prime integers.')
 * 
 *         if FuncResult[result] == 'func_failed':             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The SnapPea kernel was not able to '
 *                                'determine if the manifolds are isometric.')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FuncResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1621, __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;
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_func_failed, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1622
 * 
 *         if FuncResult[result] == 'func_failed':
 *             raise RuntimeError('The SnapPea kernel was not able to '             # <<<<<<<<<<<<<<
 *                                'determine if the manifolds are isometric.')
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_SnapPea_kernel_was_not_able};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(2, 1622, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1621
 *                              'relatively prime integers.')
 * 
 *         if FuncResult[result] == 'func_failed':             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The SnapPea kernel was not able to '
 *                                'determine if the manifolds are isometric.')
*/
  }

  /* "cython/core/manifold.pyx":1625
 *                                'determine if the manifolds are isometric.')
 * 
 *         ans = bool(are_isometric)             # <<<<<<<<<<<<<<
 * 
 *         if return_isometries:
*/
  __pyx_t_5 = __Pyx_PyLong_From_Boolean(__pyx_v_are_isometric); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_ans = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":1627
 *         ans = bool(are_isometric)
 * 
 *         if return_isometries:             # <<<<<<<<<<<<<<
 *             if not ans:
 *                 return []
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_isometries); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1627, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1628
 * 
 *         if return_isometries:
 *             if not ans:             # <<<<<<<<<<<<<<
 *                 return []
 *             else:
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ans); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1628, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "cython/core/manifold.pyx":1629
 *         if return_isometries:
 *             if not ans:
 *                 return []             # <<<<<<<<<<<<<<
 *             else:
 *                 if isometries is NULL:  # means manifold is closed
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "cython/core/manifold.pyx":1628
 * 
 *         if return_isometries:
 *             if not ans:             # <<<<<<<<<<<<<<
 *                 return []
 *             else:
*/
    }

    /* "cython/core/manifold.pyx":1631
 *                 return []
 *             else:
 *                 if isometries is NULL:  # means manifold is closed             # <<<<<<<<<<<<<<
 *                     raise ValueError("Can't get the list of isometries for closed manifolds")
 *                 ans = IsometryListToIsometries(isometries)
*/
    /*else*/ {
      __pyx_t_2 = (__pyx_v_isometries == NULL);
      if (unlikely(__pyx_t_2)) {

        /* "cython/core/manifold.pyx":1632
 *             else:
 *                 if isometries is NULL:  # means manifold is closed
 *                     raise ValueError("Can't get the list of isometries for closed manifolds")             # <<<<<<<<<<<<<<
 *                 ans = IsometryListToIsometries(isometries)
 *                 free_isometry_list(isometries)
*/
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_4 = __pyx_builtin_ValueError; 
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Can_t_get_the_list_of_isometries};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1632, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(2, 1632, __pyx_L1_error)

        /* "cython/core/manifold.pyx":1631
 *                 return []
 *             else:
 *                 if isometries is NULL:  # means manifold is closed             # <<<<<<<<<<<<<<
 *                     raise ValueError("Can't get the list of isometries for closed manifolds")
 *                 ans = IsometryListToIsometries(isometries)
*/
      }

      /* "cython/core/manifold.pyx":1633
 *                 if isometries is NULL:  # means manifold is closed
 *                     raise ValueError("Can't get the list of isometries for closed manifolds")
 *                 ans = IsometryListToIsometries(isometries)             # <<<<<<<<<<<<<<
 *                 free_isometry_list(isometries)
 * 
*/
      __pyx_t_5 = __pyx_f_8SnapPyHP_IsometryListToIsometries(__pyx_v_isometries); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1633, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_ans, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/manifold.pyx":1634
 *                     raise ValueError("Can't get the list of isometries for closed manifolds")
 *                 ans = IsometryListToIsometries(isometries)
 *                 free_isometry_list(isometries)             # <<<<<<<<<<<<<<
 * 
 *         return ans
*/
      free_isometry_list(__pyx_v_isometries); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1634, __pyx_L1_error)
    }

    /* "cython/core/manifold.pyx":1627
 *         ans = bool(are_isometric)
 * 
 *         if return_isometries:             # <<<<<<<<<<<<<<
 *             if not ans:
 *                 return []
*/
  }

  /* "cython/core/manifold.pyx":1636
 *                 free_isometry_list(isometries)
 * 
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def is_isometric_to(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1552
 *             return result
 * 
 *     def _is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                          Manifold other,
 *                          return_isometries : bool = False):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.Manifold._is_isometric_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1638
 *         return ans
 * 
 *     def is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                         Manifold other,
 *                         return_isometries : bool = False):
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_75is_isometric_to(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_8SnapPyHP_8Manifold_74is_isometric_to, "\n        This is only here to make the tests that use SnapPy.Manifold work.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_75is_isometric_to = {"is_isometric_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_75is_isometric_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_74is_isometric_to};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_75is_isometric_to(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
) {
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_other = 0;
  PyObject *__pyx_v_return_isometries = 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("is_isometric_to (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,&__pyx_mstate_global->__pyx_n_u_return_isometries,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1638, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1638, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1638, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_isometric_to", 0) < 0) __PYX_ERR(2, 1638, __pyx_L3_error)

      /* "cython/core/manifold.pyx":1640
 *     def is_isometric_to(self,
 *                         Manifold other,
 *                         return_isometries : bool = False):             # <<<<<<<<<<<<<<
 *         """
 *         This is only here to make the tests that use SnapPy.Manifold work.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_isometric_to", 0, 1, 2, i); __PYX_ERR(2, 1638, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1638, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1638, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_other = ((struct __pyx_obj_8SnapPyHP_Manifold *)values[0]);
    __pyx_v_return_isometries = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_isometric_to", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 1638, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.is_isometric_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, 1, "other", 0))) __PYX_ERR(2, 1639, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_74is_isometric_to(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_other, __pyx_v_return_isometries);

  /* "cython/core/manifold.pyx":1638
 *         return ans
 * 
 *     def is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                         Manifold other,
 *                         return_isometries : bool = False):
*/

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_74is_isometric_to(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_other, PyObject *__pyx_v_return_isometries) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_isometric_to", 0);

  /* "cython/core/manifold.pyx":1644
 *         This is only here to make the tests that use SnapPy.Manifold work.
 *         """
 *         return self._is_isometric_to(             # <<<<<<<<<<<<<<
 *             other, return_isometries = return_isometries)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);

  /* "cython/core/manifold.pyx":1645
 *         """
 *         return self._is_isometric_to(
 *             other, return_isometries = return_isometries)             # <<<<<<<<<<<<<<
 * 
 *     def is_two_bridge(self) -> bool:
*/
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, ((PyObject *)__pyx_v_other)};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_return_isometries, __pyx_v_return_isometries, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(2, 1644, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_is_isometric_to, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1638
 *         return ans
 * 
 *     def is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                         Manifold other,
 *                         return_isometries : bool = False):
*/

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

/* "cython/core/manifold.pyx":1647
 *             other, return_isometries = return_isometries)
 * 
 *     def is_two_bridge(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         If the manifold is the complement of a two-bridge knot or link
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_77is_two_bridge(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_8SnapPyHP_8Manifold_76is_two_bridge, "\n        If the manifold is the complement of a two-bridge knot or link\n        in :math:`S^3`, then this method returns :math:`(p,q)` where\n        :math:`p/q` is the fraction describing the link.\n        Otherwise, returns ``False``.\n\n        >>> M = Manifold('m004')\n        >>> M.is_two_bridge()\n        (2, 5)\n        >>> M = Manifold('m016')\n        >>> M.is_two_bridge()\n        False\n\n        Note: An answer of ``True`` is rigorous, but not the answer\n        ``False``, as there could be numerical errors resulting in\n        finding an incorrect canonical triangulation.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_77is_two_bridge = {"is_two_bridge", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_77is_two_bridge, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_76is_two_bridge};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_77is_two_bridge(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("is_two_bridge (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_two_bridge", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_two_bridge", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_76is_two_bridge(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_76is_two_bridge(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  Boolean __pyx_v_is_two_bridge;
  long __pyx_v_p;
  long __pyx_v_q;
  Triangulation *__pyx_v_c_canonized_triangulation;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_two_bridge", 0);

  /* "cython/core/manifold.pyx":1669
 *         cdef c_Triangulation *c_canonized_triangulation
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1670
 * 
 *         if self.c_triangulation is NULL:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         copy_triangulation(self.c_triangulation, &c_canonized_triangulation)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1669
 *         cdef c_Triangulation *c_canonized_triangulation
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  }

  /* "cython/core/manifold.pyx":1672
 *             return False
 * 
 *         copy_triangulation(self.c_triangulation, &c_canonized_triangulation)             # <<<<<<<<<<<<<<
 *         proto_canonize(c_canonized_triangulation)
 *         two_bridge(c_canonized_triangulation, &is_two_bridge, &p, &q)
*/
  copy_triangulation(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_c_canonized_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1672, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1673
 * 
 *         copy_triangulation(self.c_triangulation, &c_canonized_triangulation)
 *         proto_canonize(c_canonized_triangulation)             # <<<<<<<<<<<<<<
 *         two_bridge(c_canonized_triangulation, &is_two_bridge, &p, &q)
 *         free_triangulation(c_canonized_triangulation)
*/
  proto_canonize(__pyx_v_c_canonized_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1673, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1674
 *         copy_triangulation(self.c_triangulation, &c_canonized_triangulation)
 *         proto_canonize(c_canonized_triangulation)
 *         two_bridge(c_canonized_triangulation, &is_two_bridge, &p, &q)             # <<<<<<<<<<<<<<
 *         free_triangulation(c_canonized_triangulation)
 *         if is_two_bridge:
*/
  two_bridge(__pyx_v_c_canonized_triangulation, (&__pyx_v_is_two_bridge), (&__pyx_v_p), (&__pyx_v_q)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1674, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1675
 *         proto_canonize(c_canonized_triangulation)
 *         two_bridge(c_canonized_triangulation, &is_two_bridge, &p, &q)
 *         free_triangulation(c_canonized_triangulation)             # <<<<<<<<<<<<<<
 *         if is_two_bridge:
 *             return (p,q)
*/
  free_triangulation(__pyx_v_c_canonized_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1675, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1676
 *         two_bridge(c_canonized_triangulation, &is_two_bridge, &p, &q)
 *         free_triangulation(c_canonized_triangulation)
 *         if is_two_bridge:             # <<<<<<<<<<<<<<
 *             return (p,q)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_is_two_bridge != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1677
 *         free_triangulation(c_canonized_triangulation)
 *         if is_two_bridge:
 *             return (p,q)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2) != (0)) __PYX_ERR(2, 1677, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(2, 1677, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1676
 *         two_bridge(c_canonized_triangulation, &is_two_bridge, &p, &q)
 *         free_triangulation(c_canonized_triangulation)
 *         if is_two_bridge:             # <<<<<<<<<<<<<<
 *             return (p,q)
 *         else:
*/
  }

  /* "cython/core/manifold.pyx":1679
 *             return (p,q)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def _choose_generators(self, compute_corners, centroid_at_origin):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":1647
 *             other, return_isometries = return_isometries)
 * 
 *     def is_two_bridge(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         If the manifold is the complement of a two-bridge knot or link
*/

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

/* "cython/core/manifold.pyx":1681
 *             return False
 * 
 *     def _choose_generators(self, compute_corners, centroid_at_origin):             # <<<<<<<<<<<<<<
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_79_choose_generators(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_79_choose_generators = {"_choose_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_79_choose_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_79_choose_generators(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_compute_corners = 0;
  PyObject *__pyx_v_centroid_at_origin = 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("_choose_generators (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_compute_corners,&__pyx_mstate_global->__pyx_n_u_centroid_at_origin,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1681, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1681, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1681, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_choose_generators", 0) < 0) __PYX_ERR(2, 1681, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_choose_generators", 1, 2, 2, i); __PYX_ERR(2, 1681, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1681, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1681, __pyx_L3_error)
    }
    __pyx_v_compute_corners = values[0];
    __pyx_v_centroid_at_origin = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_choose_generators", 1, 2, 2, __pyx_nargs); __PYX_ERR(2, 1681, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._choose_generators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_78_choose_generators(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_compute_corners, __pyx_v_centroid_at_origin);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_78_choose_generators(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_compute_corners, PyObject *__pyx_v_centroid_at_origin) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  Boolean __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_choose_generators", 0);

  /* "cython/core/manifold.pyx":1683
 *     def _choose_generators(self, compute_corners, centroid_at_origin):
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,             # <<<<<<<<<<<<<<
 *                           centroid_at_origin)
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_Boolean(__pyx_v_compute_corners); if (unlikely((__pyx_t_1 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(2, 1683, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1684
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,
 *                           centroid_at_origin)             # <<<<<<<<<<<<<<
 * 
 *     def _choose_generators_info(self):
*/
  __pyx_t_2 = __Pyx_PyLong_As_Boolean(__pyx_v_centroid_at_origin); if (unlikely((__pyx_t_2 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(2, 1684, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1682
 * 
 *     def _choose_generators(self, compute_corners, centroid_at_origin):
 *         choose_generators(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                           compute_corners,
 *                           centroid_at_origin)
*/
  choose_generators(__pyx_v_self->__pyx_base.c_triangulation, __pyx_t_1, __pyx_t_2);

  /* "cython/core/manifold.pyx":1681
 *             return False
 * 
 *     def _choose_generators(self, compute_corners, centroid_at_origin):             # <<<<<<<<<<<<<<
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,
*/

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

/* "cython/core/manifold.pyx":1686
 *                           centroid_at_origin)
 * 
 *     def _choose_generators_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Extracts, from the bowels of SnapPea, the information about the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_81_choose_generators_info(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_8SnapPyHP_8Manifold_80_choose_generators_info, "\n        Extracts, from the bowels of SnapPea, the information about the\n        underlying generators of the fundamental group.  Returns a\n        list with one entry for each tetrahedra.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_81_choose_generators_info = {"_choose_generators_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_81_choose_generators_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_80_choose_generators_info};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_81_choose_generators_info(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("_choose_generators_info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_choose_generators_info", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_choose_generators_info", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_80_choose_generators_info(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_80_choose_generators_info(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  int __pyx_v_generator_path;
  int __pyx_v_face0_gen;
  int __pyx_v_face1_gen;
  int __pyx_v_face2_gen;
  int __pyx_v_face3_gen;
  Complex __pyx_v_c0;
  Complex __pyx_v_c1;
  Complex __pyx_v_c2;
  Complex __pyx_v_c3;
  int __pyx_v_neighbor0_idx;
  int __pyx_v_neighbor1_idx;
  int __pyx_v_neighbor2_idx;
  int __pyx_v_neighbor3_idx;
  int __pyx_v_perm0;
  int __pyx_v_perm1;
  int __pyx_v_perm2;
  int __pyx_v_perm3;
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_v_i = NULL;
  long __pyx_9genexpr54__pyx_v_i;
  long __pyx_9genexpr55__pyx_v_i;
  long __pyx_9genexpr56__pyx_v_i;
  long __pyx_9genexpr57__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  long __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_choose_generators_info", 0);

  /* "cython/core/manifold.pyx":1697
 *         cdef int perm0, perm1, perm2, perm3
 * 
 *         ans = []             # <<<<<<<<<<<<<<
 *         for i in range(self.num_tetrahedra()):
 *             choose_gen_tetrahedron_info(self.c_triangulation,
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ans = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1698
 * 
 *         ans = []
 *         for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *             choose_gen_tetrahedron_info(self.c_triangulation,
 *                                         i, &generator_path,
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_3 = __pyx_builtin_range; 
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1698, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1698, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1698, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1698, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1698, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":1700
 *         for i in range(self.num_tetrahedra()):
 *             choose_gen_tetrahedron_info(self.c_triangulation,
 *                                         i, &generator_path,             # <<<<<<<<<<<<<<
 *                                         &face0_gen, &face1_gen,
 *                                         &face2_gen, &face3_gen,
*/
    __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1700, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1699
 *         ans = []
 *         for i in range(self.num_tetrahedra()):
 *             choose_gen_tetrahedron_info(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         i, &generator_path,
 *                                         &face0_gen, &face1_gen,
*/
    choose_gen_tetrahedron_info(__pyx_v_self->__pyx_base.c_triangulation, __pyx_t_9, (&__pyx_v_generator_path), (&__pyx_v_face0_gen), (&__pyx_v_face1_gen), (&__pyx_v_face2_gen), (&__pyx_v_face3_gen), (&__pyx_v_c0), (&__pyx_v_c1), (&__pyx_v_c2), (&__pyx_v_c3), (&__pyx_v_neighbor0_idx), (&__pyx_v_neighbor1_idx), (&__pyx_v_neighbor2_idx), (&__pyx_v_neighbor3_idx), (&__pyx_v_perm0), (&__pyx_v_perm1), (&__pyx_v_perm2), (&__pyx_v_perm3));

    /* "cython/core/manifold.pyx":1708
 *                                         &perm0, &perm1, &perm2, &perm3)
 *             ans.append(
 *                 {'index':i,             # <<<<<<<<<<<<<<
 *                  'generators': (face0_gen, face1_gen, face2_gen, face3_gen),
 *                  'neighbors': (neighbor0_idx, neighbor1_idx,
*/
    __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_index, __pyx_v_i) < 0) __PYX_ERR(2, 1708, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1709
 *             ans.append(
 *                 {'index':i,
 *                  'generators': (face0_gen, face1_gen, face2_gen, face3_gen),             # <<<<<<<<<<<<<<
 *                  'neighbors': (neighbor0_idx, neighbor1_idx,
 *                                neighbor2_idx, neighbor3_idx),
*/
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_face0_gen); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_face1_gen); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_face2_gen); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_face3_gen); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 1709, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 1709, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5) != (0)) __PYX_ERR(2, 1709, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10) != (0)) __PYX_ERR(2, 1709, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_generators, __pyx_t_11) < 0) __PYX_ERR(2, 1708, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cython/core/manifold.pyx":1710
 *                 {'index':i,
 *                  'generators': (face0_gen, face1_gen, face2_gen, face3_gen),
 *                  'neighbors': (neighbor0_idx, neighbor1_idx,             # <<<<<<<<<<<<<<
 *                                neighbor2_idx, neighbor3_idx),
 *                  'gluings': (tuple([ perm0>>(2 * i) & 3 for i in range(4)]),
*/
    __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_neighbor0_idx); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_neighbor1_idx); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "cython/core/manifold.pyx":1711
 *                  'generators': (face0_gen, face1_gen, face2_gen, face3_gen),
 *                  'neighbors': (neighbor0_idx, neighbor1_idx,
 *                                neighbor2_idx, neighbor3_idx),             # <<<<<<<<<<<<<<
 *                  'gluings': (tuple([ perm0>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm1>>(2 * i) & 3 for i in range(4)]),
*/
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_neighbor2_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_neighbor3_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/manifold.pyx":1710
 *                 {'index':i,
 *                  'generators': (face0_gen, face1_gen, face2_gen, face3_gen),
 *                  'neighbors': (neighbor0_idx, neighbor1_idx,             # <<<<<<<<<<<<<<
 *                                neighbor2_idx, neighbor3_idx),
 *                  'gluings': (tuple([ perm0>>(2 * i) & 3 for i in range(4)]),
*/
    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11) != (0)) __PYX_ERR(2, 1710, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10) != (0)) __PYX_ERR(2, 1710, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5) != (0)) __PYX_ERR(2, 1710, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2) != (0)) __PYX_ERR(2, 1710, __pyx_L1_error);
    __pyx_t_11 = 0;
    __pyx_t_10 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_neighbors, __pyx_t_4) < 0) __PYX_ERR(2, 1708, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1712
 *                  'neighbors': (neighbor0_idx, neighbor1_idx,
 *                                neighbor2_idx, neighbor3_idx),
 *                  'gluings': (tuple([ perm0>>(2 * i) & 3 for i in range(4)]),             # <<<<<<<<<<<<<<
 *                              tuple([ perm1>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm2>>(2 * i) & 3 for i in range(4)]),
*/
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1712, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      for (__pyx_t_12 = 0; __pyx_t_12 < 4; __pyx_t_12+=1) {
        __pyx_9genexpr54__pyx_v_i = __pyx_t_12;
        __pyx_t_2 = __Pyx_PyLong_From_long(((__pyx_v_perm0 >> (2 * __pyx_9genexpr54__pyx_v_i)) & 3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 1712, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
    } /* exit inner scope */
    __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1713
 *                                neighbor2_idx, neighbor3_idx),
 *                  'gluings': (tuple([ perm0>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm1>>(2 * i) & 3 for i in range(4)]),             # <<<<<<<<<<<<<<
 *                              tuple([ perm2>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm3>>(2 * i) & 3 for i in range(4)])),
*/
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1713, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      for (__pyx_t_12 = 0; __pyx_t_12 < 4; __pyx_t_12+=1) {
        __pyx_9genexpr55__pyx_v_i = __pyx_t_12;
        __pyx_t_5 = __Pyx_PyLong_From_long(((__pyx_v_perm1 >> (2 * __pyx_9genexpr55__pyx_v_i)) & 3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1713, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 1713, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    } /* exit inner scope */
    __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1714
 *                  'gluings': (tuple([ perm0>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm1>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm2>>(2 * i) & 3 for i in range(4)]),             # <<<<<<<<<<<<<<
 *                              tuple([ perm3>>(2 * i) & 3 for i in range(4)])),
 *                  'corners': (self._number_(Complex2Number(c0)),
*/
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1714, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      for (__pyx_t_12 = 0; __pyx_t_12 < 4; __pyx_t_12+=1) {
        __pyx_9genexpr56__pyx_v_i = __pyx_t_12;
        __pyx_t_10 = __Pyx_PyLong_From_long(((__pyx_v_perm2 >> (2 * __pyx_9genexpr56__pyx_v_i)) & 3)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(2, 1714, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    } /* exit inner scope */
    __pyx_t_10 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1715
 *                              tuple([ perm1>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm2>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm3>>(2 * i) & 3 for i in range(4)])),             # <<<<<<<<<<<<<<
 *                  'corners': (self._number_(Complex2Number(c0)),
 *                              self._number_(Complex2Number(c1)),
*/
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      for (__pyx_t_12 = 0; __pyx_t_12 < 4; __pyx_t_12+=1) {
        __pyx_9genexpr57__pyx_v_i = __pyx_t_12;
        __pyx_t_11 = __Pyx_PyLong_From_long(((__pyx_v_perm3 >> (2 * __pyx_9genexpr57__pyx_v_i)) & 3)); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_11))) __PYX_ERR(2, 1715, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
    } /* exit inner scope */
    __pyx_t_11 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1712
 *                  'neighbors': (neighbor0_idx, neighbor1_idx,
 *                                neighbor2_idx, neighbor3_idx),
 *                  'gluings': (tuple([ perm0>>(2 * i) & 3 for i in range(4)]),             # <<<<<<<<<<<<<<
 *                              tuple([ perm1>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm2>>(2 * i) & 3 for i in range(4)]),
*/
    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2) != (0)) __PYX_ERR(2, 1712, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(2, 1712, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10) != (0)) __PYX_ERR(2, 1712, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_11) != (0)) __PYX_ERR(2, 1712, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_10 = 0;
    __pyx_t_11 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_gluings, __pyx_t_4) < 0) __PYX_ERR(2, 1708, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1716
 *                              tuple([ perm2>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm3>>(2 * i) & 3 for i in range(4)])),
 *                  'corners': (self._number_(Complex2Number(c0)),             # <<<<<<<<<<<<<<
 *                              self._number_(Complex2Number(c1)),
 *                              self._number_(Complex2Number(c2)),
*/
    __pyx_t_11 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_10 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_c0); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }

    /* "cython/core/manifold.pyx":1717
 *                              tuple([ perm3>>(2 * i) & 3 for i in range(4)])),
 *                  'corners': (self._number_(Complex2Number(c0)),
 *                              self._number_(Complex2Number(c1)),             # <<<<<<<<<<<<<<
 *                              self._number_(Complex2Number(c2)),
 *                              self._number_(Complex2Number(c3)) ),
*/
    __pyx_t_11 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_5 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_c1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_5};
      __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }

    /* "cython/core/manifold.pyx":1718
 *                  'corners': (self._number_(Complex2Number(c0)),
 *                              self._number_(Complex2Number(c1)),
 *                              self._number_(Complex2Number(c2)),             # <<<<<<<<<<<<<<
 *                              self._number_(Complex2Number(c3)) ),
 *                  'generator_path': generator_path}
*/
    __pyx_t_11 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_c2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_2};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }

    /* "cython/core/manifold.pyx":1719
 *                              self._number_(Complex2Number(c1)),
 *                              self._number_(Complex2Number(c2)),
 *                              self._number_(Complex2Number(c3)) ),             # <<<<<<<<<<<<<<
 *                  'generator_path': generator_path}
 *                 )
*/
    __pyx_t_11 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_13 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_c3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 1719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_13};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1719, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "cython/core/manifold.pyx":1716
 *                              tuple([ perm2>>(2 * i) & 3 for i in range(4)]),
 *                              tuple([ perm3>>(2 * i) & 3 for i in range(4)])),
 *                  'corners': (self._number_(Complex2Number(c0)),             # <<<<<<<<<<<<<<
 *                              self._number_(Complex2Number(c1)),
 *                              self._number_(Complex2Number(c2)),
*/
    __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 1716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 1716, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10) != (0)) __PYX_ERR(2, 1716, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5) != (0)) __PYX_ERR(2, 1716, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2) != (0)) __PYX_ERR(2, 1716, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_10 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_corners, __pyx_t_13) < 0) __PYX_ERR(2, 1708, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cython/core/manifold.pyx":1720
 *                              self._number_(Complex2Number(c2)),
 *                              self._number_(Complex2Number(c3)) ),
 *                  'generator_path': generator_path}             # <<<<<<<<<<<<<<
 *                 )
 *         return ans
*/
    __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_generator_path); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_generator_path, __pyx_t_13) < 0) __PYX_ERR(2, 1708, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cython/core/manifold.pyx":1707
 *                                         &neighbor2_idx, &neighbor3_idx,
 *                                         &perm0, &perm1, &perm2, &perm3)
 *             ans.append(             # <<<<<<<<<<<<<<
 *                 {'index':i,
 *                  'generators': (face0_gen, face1_gen, face2_gen, face3_gen),
*/
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_ans, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(2, 1707, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":1698
 * 
 *         ans = []
 *         for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *             choose_gen_tetrahedron_info(self.c_triangulation,
 *                                         i, &generator_path,
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1722
 *                  'generator_path': generator_path}
 *                 )
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def splitting_surfaces(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1686
 *                           centroid_at_origin)
 * 
 *     def _choose_generators_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Extracts, from the bowels of SnapPea, the information about the
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPyHP.Manifold._choose_generators_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1724
 *         return ans
 * 
 *     def splitting_surfaces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Searches for connected closed normal surfaces of nonnegative Euler
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_83splitting_surfaces(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_8SnapPyHP_8Manifold_82splitting_surfaces, "\n        Searches for connected closed normal surfaces of nonnegative Euler\n        characteristic.  If spheres or projective planes are found, then\n        tori and Klein bottles aren't reported.  There is no guarantee\n        that all such normal surfaces will be found nor that any given\n        surface is incompressible.  The search is confined to surfaces\n        whose quads are in the tetrahedra that have degenerate shapes.\n\n        You can split the manifold open along one of these surfaces\n        using the method \"split\".\n\n        A connect sum of two trefoils:\n\n        >>> M1 = Manifold('DT: fafBCAEFD')\n        >>> len(M1.splitting_surfaces())\n        2\n\n        First satellite knot in the table.\n\n        >>> M2 = Manifold('K13n4587')\n        >>> M2.splitting_surfaces()\n        [Orientable two-sided with euler = 0]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_83splitting_surfaces = {"splitting_surfaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_83splitting_surfaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_82splitting_surfaces};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_83splitting_surfaces(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("splitting_surfaces (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("splitting_surfaces", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("splitting_surfaces", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_82splitting_surfaces(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_82splitting_surfaces(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  NormalSurfaceList *__pyx_v_surfaces;
  FuncResult __pyx_v_result;
  PyObject *__pyx_v_ans = NULL;
  int __pyx_v_i;
  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;
  size_t __pyx_t_5;
  FuncResult __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Boolean __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("splitting_surfaces", 0);

  /* "cython/core/manifold.pyx":1751
 *         cdef c_FuncResult result
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1752
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1752, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1751
 *         cdef c_FuncResult result
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
*/
  }

  /* "cython/core/manifold.pyx":1753
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)             # <<<<<<<<<<<<<<
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces')
*/
  __pyx_t_6 = find_normal_surfaces(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_surfaces)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1753, __pyx_L1_error)
  __pyx_v_result = __pyx_t_6;

  /* "cython/core/manifold.pyx":1754
 *             raise ValueError('The Triangulation is empty.')
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces')
 * 
*/
  __pyx_t_1 = (__pyx_v_result != func_OK);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1755
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces')             # <<<<<<<<<<<<<<
 * 
 *         ans = []
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_SnapPea_kernel_failed_when_compu};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1755, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1755, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1754
 *             raise ValueError('The Triangulation is empty.')
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces')
 * 
*/
  }

  /* "cython/core/manifold.pyx":1757
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces')
 * 
 *         ans = []             # <<<<<<<<<<<<<<
 *         for i in range(number_of_normal_surfaces_on_list(surfaces)):
 *             ans.append( NormalSurfaceInfo(
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1758
 * 
 *         ans = []
 *         for i in range(number_of_normal_surfaces_on_list(surfaces)):             # <<<<<<<<<<<<<<
 *             ans.append( NormalSurfaceInfo(
 *                 orientable=B2B(normal_surface_is_orientable(surfaces, i)),
*/
  __pyx_t_7 = number_of_normal_surfaces_on_list(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1758, __pyx_L1_error)
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "cython/core/manifold.pyx":1759
 *         ans = []
 *         for i in range(number_of_normal_surfaces_on_list(surfaces)):
 *             ans.append( NormalSurfaceInfo(             # <<<<<<<<<<<<<<
 *                 orientable=B2B(normal_surface_is_orientable(surfaces, i)),
 *                 two_sided=B2B(normal_surface_is_two_sided(surfaces, i)),
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NormalSurfaceInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/manifold.pyx":1760
 *         for i in range(number_of_normal_surfaces_on_list(surfaces)):
 *             ans.append( NormalSurfaceInfo(
 *                 orientable=B2B(normal_surface_is_orientable(surfaces, i)),             # <<<<<<<<<<<<<<
 *                 two_sided=B2B(normal_surface_is_two_sided(surfaces, i)),
 *                 euler=normal_surface_Euler_characteristic(surfaces, i),
*/
    __pyx_t_10 = normal_surface_is_orientable(__pyx_v_surfaces, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1760, __pyx_L1_error)
    __pyx_t_11 = __pyx_f_8SnapPyHP_B2B(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "cython/core/manifold.pyx":1761
 *             ans.append( NormalSurfaceInfo(
 *                 orientable=B2B(normal_surface_is_orientable(surfaces, i)),
 *                 two_sided=B2B(normal_surface_is_two_sided(surfaces, i)),             # <<<<<<<<<<<<<<
 *                 euler=normal_surface_Euler_characteristic(surfaces, i),
 *                 index=i))
*/
    __pyx_t_10 = normal_surface_is_two_sided(__pyx_v_surfaces, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1761, __pyx_L1_error)
    __pyx_t_12 = __pyx_f_8SnapPyHP_B2B(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);

    /* "cython/core/manifold.pyx":1762
 *                 orientable=B2B(normal_surface_is_orientable(surfaces, i)),
 *                 two_sided=B2B(normal_surface_is_two_sided(surfaces, i)),
 *                 euler=normal_surface_Euler_characteristic(surfaces, i),             # <<<<<<<<<<<<<<
 *                 index=i))
 * 
*/
    __pyx_t_13 = normal_surface_Euler_characteristic(__pyx_v_surfaces, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1762, __pyx_L1_error)
    __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);

    /* "cython/core/manifold.pyx":1763
 *                 two_sided=B2B(normal_surface_is_two_sided(surfaces, i)),
 *                 euler=normal_surface_Euler_characteristic(surfaces, i),
 *                 index=i))             # <<<<<<<<<<<<<<
 * 
 *         free_normal_surfaces(surfaces)
*/
    __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_3, NULL};
      __pyx_t_16 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_orientable, __pyx_t_11, __pyx_t_16, __pyx_callargs+1, 0) < 0) __PYX_ERR(2, 1759, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_two_sided, __pyx_t_12, __pyx_t_16, __pyx_callargs+1, 1) < 0) __PYX_ERR(2, 1759, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_euler, __pyx_t_14, __pyx_t_16, __pyx_callargs+1, 2) < 0) __PYX_ERR(2, 1759, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_index, __pyx_t_15, __pyx_t_16, __pyx_callargs+1, 3) < 0) __PYX_ERR(2, 1759, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_16);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "cython/core/manifold.pyx":1759
 *         ans = []
 *         for i in range(number_of_normal_surfaces_on_list(surfaces)):
 *             ans.append( NormalSurfaceInfo(             # <<<<<<<<<<<<<<
 *                 orientable=B2B(normal_surface_is_orientable(surfaces, i)),
 *                 two_sided=B2B(normal_surface_is_two_sided(surfaces, i)),
*/
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_ans, __pyx_t_2); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(2, 1759, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/manifold.pyx":1765
 *                 index=i))
 * 
 *         free_normal_surfaces(surfaces)             # <<<<<<<<<<<<<<
 *         return ListOnePerLine(ans)
 * 
*/
  free_normal_surfaces(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1765, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1766
 * 
 *         free_normal_surfaces(surfaces)
 *         return ListOnePerLine(ans)             # <<<<<<<<<<<<<<
 * 
 *     def split(self, which_surface):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ListOnePerLine); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_ans};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1724
 *         return ans
 * 
 *     def splitting_surfaces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Searches for connected closed normal surfaces of nonnegative Euler
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("SnapPyHP.Manifold.splitting_surfaces", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1768
 *         return ListOnePerLine(ans)
 * 
 *     def split(self, which_surface):             # <<<<<<<<<<<<<<
 *         """
 *         Split the manifold open along a surface of positive characteristic found
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_85split(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_8SnapPyHP_8Manifold_84split, "\n        Split the manifold open along a surface of positive characteristic found\n        by the method \"splitting_surfaces\".  Returns a list of the pieces, with any\n        sphere boundary components filled in.\n\n        Here's an example of a Whitehead double on the trefoil.\n\n        >>> M = Manifold('K14n26039')\n        >>> S = M.splitting_surfaces()[0]\n        >>> S\n        Orientable two-sided with euler = 0\n\n        >>> pieces = M.split(S); pieces\n        [K14n26039.a(0,0)(0,0), K14n26039.b(0,0)]\n        >>> pieces[0].volume() # doctest: +NUMERIC6\n        3.66386238\n        >>> pieces[1].fundamental_group().relators()\n        ['aabbb']\n\n        You can also specify a surface by its index.\n\n        >>> M = Manifold('L10n111')\n        >>> max( P.volume() for P in M.split(0) ) # doctest: +NUMERIC6\n        5.33348957\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_85split = {"split", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_85split, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_84split};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_85split(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_which_surface = 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("split (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_surface,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1768, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "split", 0) < 0) __PYX_ERR(2, 1768, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("split", 1, 1, 1, i); __PYX_ERR(2, 1768, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1768, __pyx_L3_error)
    }
    __pyx_v_which_surface = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("split", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 1768, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold.split", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_84split(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_which_surface);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_84split(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_which_surface) {
  NormalSurfaceList *__pyx_v_surfaces;
  FuncResult __pyx_v_result;
  int __pyx_v_num_surfaces;
  Triangulation *__pyx_v_pieces[2];
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M0 = 0;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M1 = 0;
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  FuncResult __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[5];
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("split", 0);
  __Pyx_INCREF(__pyx_v_which_surface);

  /* "cython/core/manifold.pyx":1800
 *         cdef Manifold M0, M1
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1801
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1801, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1801, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1800
 *         cdef Manifold M0, M1
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":1803
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)             # <<<<<<<<<<<<<<
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces.')
*/
  __pyx_t_6 = find_normal_surfaces(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_surfaces)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1803, __pyx_L1_error)
  __pyx_v_result = __pyx_t_6;

  /* "cython/core/manifold.pyx":1804
 * 
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces.')
 * 
*/
  __pyx_t_1 = (__pyx_v_result != func_OK);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1805
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces.')             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(which_surface, NormalSurfaceInfo):
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_SnapPea_kernel_failed_when_compu_2};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1805, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1804
 * 
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":1807
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces.')
 * 
 *         if isinstance(which_surface, NormalSurfaceInfo):             # <<<<<<<<<<<<<<
 *             which_surface = which_surface.index
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NormalSurfaceInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_which_surface, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1808
 * 
 *         if isinstance(which_surface, NormalSurfaceInfo):
 *             which_surface = which_surface.index             # <<<<<<<<<<<<<<
 * 
 *         num_surfaces = number_of_normal_surfaces_on_list(surfaces)
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_which_surface, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_which_surface, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1807
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces.')
 * 
 *         if isinstance(which_surface, NormalSurfaceInfo):             # <<<<<<<<<<<<<<
 *             which_surface = which_surface.index
 * 
*/
  }

  /* "cython/core/manifold.pyx":1810
 *             which_surface = which_surface.index
 * 
 *         num_surfaces = number_of_normal_surfaces_on_list(surfaces)             # <<<<<<<<<<<<<<
 *         if not (0 <= which_surface < num_surfaces):
 *             raise ValueError('SnapPea only found %d surfaces, but you asked for surface number %s.' % (num_surfaces, which_surface))
*/
  __pyx_t_7 = number_of_normal_surfaces_on_list(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1810, __pyx_L1_error)
  __pyx_v_num_surfaces = __pyx_t_7;

  /* "cython/core/manifold.pyx":1811
 * 
 *         num_surfaces = number_of_normal_surfaces_on_list(surfaces)
 *         if not (0 <= which_surface < num_surfaces):             # <<<<<<<<<<<<<<
 *             raise ValueError('SnapPea only found %d surfaces, but you asked for surface number %s.' % (num_surfaces, which_surface))
 * 
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_which_surface, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1811, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_num_surfaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_which_surface, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1811, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = (!__pyx_t_1);
  if (unlikely(__pyx_t_8)) {

    /* "cython/core/manifold.pyx":1812
 *         num_surfaces = number_of_normal_surfaces_on_list(surfaces)
 *         if not (0 <= which_surface < num_surfaces):
 *             raise ValueError('SnapPea only found %d surfaces, but you asked for surface number %s.' % (num_surfaces, which_surface))             # <<<<<<<<<<<<<<
 * 
 *         result = split_along_normal_surface(surfaces, which_surface, pieces)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_9 = __Pyx_PyUnicode_From_int(__pyx_v_num_surfaces, 0, ' ', 'd'); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_which_surface), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_SnapPea_only_found;
    __pyx_t_11[1] = __pyx_t_9;
    __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_surfaces_but_you_asked_for_surf;
    __pyx_t_11[3] = __pyx_t_10;
    __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__30;
    __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 44 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
    if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_12};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1812, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1812, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1811
 * 
 *         num_surfaces = number_of_normal_surfaces_on_list(surfaces)
 *         if not (0 <= which_surface < num_surfaces):             # <<<<<<<<<<<<<<
 *             raise ValueError('SnapPea only found %d surfaces, but you asked for surface number %s.' % (num_surfaces, which_surface))
 * 
*/
  }

  /* "cython/core/manifold.pyx":1814
 *             raise ValueError('SnapPea only found %d surfaces, but you asked for surface number %s.' % (num_surfaces, which_surface))
 * 
 *         result = split_along_normal_surface(surfaces, which_surface, pieces)             # <<<<<<<<<<<<<<
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when splitting open along the given surface.')
*/
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_which_surface); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1814, __pyx_L1_error)
  __pyx_t_6 = split_along_normal_surface(__pyx_v_surfaces, __pyx_t_7, __pyx_v_pieces); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1814, __pyx_L1_error)
  __pyx_v_result = __pyx_t_6;

  /* "cython/core/manifold.pyx":1815
 * 
 *         result = split_along_normal_surface(surfaces, which_surface, pieces)
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea kernel failed when splitting open along the given surface.')
 * 
*/
  __pyx_t_8 = (__pyx_v_result != func_OK);
  if (unlikely(__pyx_t_8)) {

    /* "cython/core/manifold.pyx":1816
 *         result = split_along_normal_surface(surfaces, which_surface, pieces)
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when splitting open along the given surface.')             # <<<<<<<<<<<<<<
 * 
 *         ans = []
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_12 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_SnapPea_kernel_failed_when_split};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1816, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1815
 * 
 *         result = split_along_normal_surface(surfaces, which_surface, pieces)
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea kernel failed when splitting open along the given surface.')
 * 
*/
  }

  /* "cython/core/manifold.pyx":1818
 *             raise RuntimeError('SnapPea kernel failed when splitting open along the given surface.')
 * 
 *         ans = []             # <<<<<<<<<<<<<<
 *         if pieces[0] != NULL:
 *             M0 = self.__class__('empty')
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1819
 * 
 *         ans = []
 *         if pieces[0] != NULL:             # <<<<<<<<<<<<<<
 *             M0 = self.__class__('empty')
 *             M0.set_c_triangulation(pieces[0])
*/
  __pyx_t_8 = ((__pyx_v_pieces[0]) != NULL);
  if (__pyx_t_8) {

    /* "cython/core/manifold.pyx":1820
 *         ans = []
 *         if pieces[0] != NULL:
 *             M0 = self.__class__('empty')             # <<<<<<<<<<<<<<
 *             M0.set_c_triangulation(pieces[0])
 *             M0.set_name(self.name() + '.a')
*/
    __pyx_t_12 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(2, 1820, __pyx_L1_error)
    __pyx_v_M0 = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1821
 *         if pieces[0] != NULL:
 *             M0 = self.__class__('empty')
 *             M0.set_c_triangulation(pieces[0])             # <<<<<<<<<<<<<<
 *             M0.set_name(self.name() + '.a')
 *             ans.append(M0)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_M0->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_M0), (__pyx_v_pieces[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1822
 *             M0 = self.__class__('empty')
 *             M0.set_c_triangulation(pieces[0])
 *             M0.set_name(self.name() + '.a')             # <<<<<<<<<<<<<<
 *             ans.append(M0)
 *         if pieces[1] != NULL:
*/
    __pyx_t_12 = ((PyObject *)__pyx_v_M0);
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1823
 *             M0.set_c_triangulation(pieces[0])
 *             M0.set_name(self.name() + '.a')
 *             ans.append(M0)             # <<<<<<<<<<<<<<
 *         if pieces[1] != NULL:
 *             M1 = self.__class__('empty')
*/
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ans, ((PyObject *)__pyx_v_M0)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 1823, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1819
 * 
 *         ans = []
 *         if pieces[0] != NULL:             # <<<<<<<<<<<<<<
 *             M0 = self.__class__('empty')
 *             M0.set_c_triangulation(pieces[0])
*/
  }

  /* "cython/core/manifold.pyx":1824
 *             M0.set_name(self.name() + '.a')
 *             ans.append(M0)
 *         if pieces[1] != NULL:             # <<<<<<<<<<<<<<
 *             M1 = self.__class__('empty')
 *             M1.set_c_triangulation(pieces[1])
*/
  __pyx_t_8 = ((__pyx_v_pieces[1]) != NULL);
  if (__pyx_t_8) {

    /* "cython/core/manifold.pyx":1825
 *             ans.append(M0)
 *         if pieces[1] != NULL:
 *             M1 = self.__class__('empty')             # <<<<<<<<<<<<<<
 *             M1.set_c_triangulation(pieces[1])
 *             M1.set_name(self.name() + '.b')
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(2, 1825, __pyx_L1_error)
    __pyx_v_M1 = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1826
 *         if pieces[1] != NULL:
 *             M1 = self.__class__('empty')
 *             M1.set_c_triangulation(pieces[1])             # <<<<<<<<<<<<<<
 *             M1.set_name(self.name() + '.b')
 *             ans.append(M1)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_M1->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_M1), (__pyx_v_pieces[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1827
 *             M1 = self.__class__('empty')
 *             M1.set_c_triangulation(pieces[1])
 *             M1.set_name(self.name() + '.b')             # <<<<<<<<<<<<<<
 *             ans.append(M1)
 * 
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_M1);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_4 = PyNumber_Add(__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1828
 *             M1.set_c_triangulation(pieces[1])
 *             M1.set_name(self.name() + '.b')
 *             ans.append(M1)             # <<<<<<<<<<<<<<
 * 
 *         free_normal_surfaces(surfaces)
*/
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ans, ((PyObject *)__pyx_v_M1)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 1828, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1824
 *             M0.set_name(self.name() + '.a')
 *             ans.append(M0)
 *         if pieces[1] != NULL:             # <<<<<<<<<<<<<<
 *             M1 = self.__class__('empty')
 *             M1.set_c_triangulation(pieces[1])
*/
  }

  /* "cython/core/manifold.pyx":1830
 *             ans.append(M1)
 * 
 *         free_normal_surfaces(surfaces)             # <<<<<<<<<<<<<<
 *         return ans
 * 
*/
  free_normal_surfaces(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1830, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1831
 * 
 *         free_normal_surfaces(surfaces)
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def _identify(self, extends_to_link=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1768
 *         return ListOnePerLine(ans)
 * 
 *     def split(self, which_surface):             # <<<<<<<<<<<<<<
 *         """
 *         Split the manifold open along a surface of positive characteristic found
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.Manifold.split", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_M0);
  __Pyx_XDECREF((PyObject *)__pyx_v_M1);
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XDECREF(__pyx_v_which_surface);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1833
 *         return ans
 * 
 *     def _identify(self, extends_to_link=False):             # <<<<<<<<<<<<<<
 *         ans = []
 *         for table in database.__all_tables__.values():
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_87_identify(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_87_identify = {"_identify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_87_identify, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_87_identify(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_extends_to_link = 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("_identify (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_extends_to_link,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 1833, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1833, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_identify", 0) < 0) __PYX_ERR(2, 1833, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1833, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_extends_to_link = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_identify", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 1833, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Manifold._identify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_86_identify(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self), __pyx_v_extends_to_link);

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_86_identify(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self, PyObject *__pyx_v_extends_to_link) {
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_match = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_identify", 0);

  /* "cython/core/manifold.pyx":1834
 * 
 *     def _identify(self, extends_to_link=False):
 *         ans = []             # <<<<<<<<<<<<<<
 *         for table in database.__all_tables__.values():
 *             match = table.identify(self, extends_to_link)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ans = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1835
 *     def _identify(self, extends_to_link=False):
 *         ans = []
 *         for table in database.__all_tables__.values():             # <<<<<<<<<<<<<<
 *             match = table.identify(self, extends_to_link)
 *             if match:
*/
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_all_tables); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_6 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(2, 1835, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __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, NULL, &__pyx_t_5, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(2, 1835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_table, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":1836
 *         ans = []
 *         for table in database.__all_tables__.values():
 *             match = table.identify(self, extends_to_link)             # <<<<<<<<<<<<<<
 *             if match:
 *                 ans.append(match)
*/
    __pyx_t_6 = __pyx_v_table;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_v_extends_to_link};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_identify, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":1837
 *         for table in database.__all_tables__.values():
 *             match = table.identify(self, extends_to_link)
 *             if match:             # <<<<<<<<<<<<<<
 *                 ans.append(match)
 *         return ans
*/
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(2, 1837, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "cython/core/manifold.pyx":1838
 *             match = table.identify(self, extends_to_link)
 *             if match:
 *                 ans.append(match)             # <<<<<<<<<<<<<<
 *         return ans
 * 
*/
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ans, __pyx_v_match); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 1838, __pyx_L1_error)

      /* "cython/core/manifold.pyx":1837
 *         for table in database.__all_tables__.values():
 *             match = table.identify(self, extends_to_link)
 *             if match:             # <<<<<<<<<<<<<<
 *                 ans.append(match)
 *         return ans
*/
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1839
 *             if match:
 *                 ans.append(match)
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def _cusp_cross_section_info(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1833
 *         return ans
 * 
 *     def _identify(self, extends_to_link=False):             # <<<<<<<<<<<<<<
 *         ans = []
 *         for table in database.__all_tables__.values():
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Manifold._identify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1841
 *         return ans
 * 
 *     def _cusp_cross_section_info(self):             # <<<<<<<<<<<<<<
 *         cdef c_Tetrahedron *tet
 *         allocate_cross_sections(self.c_triangulation)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_89_cusp_cross_section_info(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_89_cusp_cross_section_info = {"_cusp_cross_section_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_89_cusp_cross_section_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_89_cusp_cross_section_info(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("_cusp_cross_section_info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_cusp_cross_section_info", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_cusp_cross_section_info", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_88_cusp_cross_section_info(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_88_cusp_cross_section_info(struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  Tetrahedron *__pyx_v_tet;
  PyObject *__pyx_v_tilts = NULL;
  PyObject *__pyx_v_side_lengths = NULL;
  PyObject *__pyx_v_one_tet_tilts = NULL;
  PyObject *__pyx_v_one_tet_lengths = NULL;
  long __pyx_v_v;
  PyObject *__pyx_v_one_vertex_lengths = NULL;
  long __pyx_v_f;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Tetrahedron *__pyx_t_3;
  int __pyx_t_4;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  long __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_cusp_cross_section_info", 0);

  /* "cython/core/manifold.pyx":1843
 *     def _cusp_cross_section_info(self):
 *         cdef c_Tetrahedron *tet
 *         allocate_cross_sections(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         compute_cross_sections(self.c_triangulation)
 *         compute_tilts(self.c_triangulation)
*/
  allocate_cross_sections(__pyx_v_self->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":1844
 *         cdef c_Tetrahedron *tet
 *         allocate_cross_sections(self.c_triangulation)
 *         compute_cross_sections(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         compute_tilts(self.c_triangulation)
 *         tilts, side_lengths = [], []
*/
  compute_cross_sections(__pyx_v_self->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":1845
 *         allocate_cross_sections(self.c_triangulation)
 *         compute_cross_sections(self.c_triangulation)
 *         compute_tilts(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         tilts, side_lengths = [], []
 *         tet = self.c_triangulation.tet_list_begin.next
*/
  compute_tilts(__pyx_v_self->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":1846
 *         compute_cross_sections(self.c_triangulation)
 *         compute_tilts(self.c_triangulation)
 *         tilts, side_lengths = [], []             # <<<<<<<<<<<<<<
 *         tet = self.c_triangulation.tet_list_begin.next
 *         while tet != &self.c_triangulation.tet_list_end:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_tilts = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_side_lengths = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1847
 *         compute_tilts(self.c_triangulation)
 *         tilts, side_lengths = [], []
 *         tet = self.c_triangulation.tet_list_begin.next             # <<<<<<<<<<<<<<
 *         while tet != &self.c_triangulation.tet_list_end:
 *             one_tet_tilts, one_tet_lengths = [], []
*/
  __pyx_t_3 = __pyx_v_self->__pyx_base.c_triangulation->tet_list_begin.next;
  __pyx_v_tet = __pyx_t_3;

  /* "cython/core/manifold.pyx":1848
 *         tilts, side_lengths = [], []
 *         tet = self.c_triangulation.tet_list_begin.next
 *         while tet != &self.c_triangulation.tet_list_end:             # <<<<<<<<<<<<<<
 *             one_tet_tilts, one_tet_lengths = [], []
 *             for v in range(4):
*/
  while (1) {
    __pyx_t_4 = (__pyx_v_tet != (&__pyx_v_self->__pyx_base.c_triangulation->tet_list_end));
    if (!__pyx_t_4) break;

    /* "cython/core/manifold.pyx":1849
 *         tet = self.c_triangulation.tet_list_begin.next
 *         while tet != &self.c_triangulation.tet_list_end:
 *             one_tet_tilts, one_tet_lengths = [], []             # <<<<<<<<<<<<<<
 *             for v in range(4):
 *                 one_tet_tilts.append(self._number_(Real2Number(<Real>tet.tilt[v])))
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_one_tet_tilts, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_one_tet_lengths, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":1850
 *         while tet != &self.c_triangulation.tet_list_end:
 *             one_tet_tilts, one_tet_lengths = [], []
 *             for v in range(4):             # <<<<<<<<<<<<<<
 *                 one_tet_tilts.append(self._number_(Real2Number(<Real>tet.tilt[v])))
 *                 one_vertex_lengths = []
*/
    for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
      __pyx_v_v = __pyx_t_5;

      /* "cython/core/manifold.pyx":1851
 *             one_tet_tilts, one_tet_lengths = [], []
 *             for v in range(4):
 *                 one_tet_tilts.append(self._number_(Real2Number(<Real>tet.tilt[v])))             # <<<<<<<<<<<<<<
 *                 one_vertex_lengths = []
 *                 for f in range(4):
*/
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_6 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_tet->tilt[__pyx_v_v]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1851, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_one_tet_tilts, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/manifold.pyx":1852
 *             for v in range(4):
 *                 one_tet_tilts.append(self._number_(Real2Number(<Real>tet.tilt[v])))
 *                 one_vertex_lengths = []             # <<<<<<<<<<<<<<
 *                 for f in range(4):
 *                     if v != f:
*/
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1852, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_one_vertex_lengths, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cython/core/manifold.pyx":1853
 *                 one_tet_tilts.append(self._number_(Real2Number(<Real>tet.tilt[v])))
 *                 one_vertex_lengths = []
 *                 for f in range(4):             # <<<<<<<<<<<<<<
 *                     if v != f:
 *                         one_vertex_lengths.append(self._number_(
*/
      for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) {
        __pyx_v_f = __pyx_t_9;

        /* "cython/core/manifold.pyx":1854
 *                 one_vertex_lengths = []
 *                 for f in range(4):
 *                     if v != f:             # <<<<<<<<<<<<<<
 *                         one_vertex_lengths.append(self._number_(
 *                             Real2Number(<Real>tet.cross_section.edge_length[v][f])))
*/
        __pyx_t_4 = (__pyx_v_v != __pyx_v_f);
        if (__pyx_t_4) {

          /* "cython/core/manifold.pyx":1855
 *                 for f in range(4):
 *                     if v != f:
 *                         one_vertex_lengths.append(self._number_(             # <<<<<<<<<<<<<<
 *                             Real2Number(<Real>tet.cross_section.edge_length[v][f])))
 *                     else:
*/
          __pyx_t_6 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_6);

          /* "cython/core/manifold.pyx":1856
 *                     if v != f:
 *                         one_vertex_lengths.append(self._number_(
 *                             Real2Number(<Real>tet.cross_section.edge_length[v][f])))             # <<<<<<<<<<<<<<
 *                     else:
 *                         one_vertex_lengths.append(None)
*/
          __pyx_t_2 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)((__pyx_v_tet->cross_section->edge_length[__pyx_v_v])[__pyx_v_f]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1856, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1855, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }

          /* "cython/core/manifold.pyx":1855
 *                 for f in range(4):
 *                     if v != f:
 *                         one_vertex_lengths.append(self._number_(             # <<<<<<<<<<<<<<
 *                             Real2Number(<Real>tet.cross_section.edge_length[v][f])))
 *                     else:
*/
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_one_vertex_lengths, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1855, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "cython/core/manifold.pyx":1854
 *                 one_vertex_lengths = []
 *                 for f in range(4):
 *                     if v != f:             # <<<<<<<<<<<<<<
 *                         one_vertex_lengths.append(self._number_(
 *                             Real2Number(<Real>tet.cross_section.edge_length[v][f])))
*/
          goto __pyx_L9;
        }

        /* "cython/core/manifold.pyx":1858
 *                             Real2Number(<Real>tet.cross_section.edge_length[v][f])))
 *                     else:
 *                         one_vertex_lengths.append(None)             # <<<<<<<<<<<<<<
 *                 one_tet_lengths.append(one_vertex_lengths)
 *             tilts.append(one_tet_tilts)
*/
        /*else*/ {
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_one_vertex_lengths, Py_None); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1858, __pyx_L1_error)
        }
        __pyx_L9:;
      }

      /* "cython/core/manifold.pyx":1859
 *                     else:
 *                         one_vertex_lengths.append(None)
 *                 one_tet_lengths.append(one_vertex_lengths)             # <<<<<<<<<<<<<<
 *             tilts.append(one_tet_tilts)
 *             side_lengths.append(one_tet_lengths)
*/
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_one_tet_lengths, __pyx_v_one_vertex_lengths); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1859, __pyx_L1_error)
    }

    /* "cython/core/manifold.pyx":1860
 *                         one_vertex_lengths.append(None)
 *                 one_tet_lengths.append(one_vertex_lengths)
 *             tilts.append(one_tet_tilts)             # <<<<<<<<<<<<<<
 *             side_lengths.append(one_tet_lengths)
 *             tet = tet.next
*/
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_tilts, __pyx_v_one_tet_tilts); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1860, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1861
 *                 one_tet_lengths.append(one_vertex_lengths)
 *             tilts.append(one_tet_tilts)
 *             side_lengths.append(one_tet_lengths)             # <<<<<<<<<<<<<<
 *             tet = tet.next
 * 
*/
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_side_lengths, __pyx_v_one_tet_lengths); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1861, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1862
 *             tilts.append(one_tet_tilts)
 *             side_lengths.append(one_tet_lengths)
 *             tet = tet.next             # <<<<<<<<<<<<<<
 * 
 *         free_cross_sections(self.c_triangulation)
*/
    __pyx_t_3 = __pyx_v_tet->next;
    __pyx_v_tet = __pyx_t_3;
  }

  /* "cython/core/manifold.pyx":1864
 *             tet = tet.next
 * 
 *         free_cross_sections(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         return tilts, side_lengths
 * 
*/
  free_cross_sections(__pyx_v_self->__pyx_base.c_triangulation);

  /* "cython/core/manifold.pyx":1865
 * 
 *         free_cross_sections(self.c_triangulation)
 *         return tilts, side_lengths             # <<<<<<<<<<<<<<
 * 
 *     def _precision(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_tilts);
  __Pyx_GIVEREF(__pyx_v_tilts);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tilts) != (0)) __PYX_ERR(2, 1865, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_side_lengths);
  __Pyx_GIVEREF(__pyx_v_side_lengths);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_side_lengths) != (0)) __PYX_ERR(2, 1865, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1841
 *         return ans
 * 
 *     def _cusp_cross_section_info(self):             # <<<<<<<<<<<<<<
 *         cdef c_Tetrahedron *tet
 *         allocate_cross_sections(self.c_triangulation)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Manifold._cusp_cross_section_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tilts);
  __Pyx_XDECREF(__pyx_v_side_lengths);
  __Pyx_XDECREF(__pyx_v_one_tet_tilts);
  __Pyx_XDECREF(__pyx_v_one_tet_lengths);
  __Pyx_XDECREF(__pyx_v_one_vertex_lengths);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1867
 *         return tilts, side_lengths
 * 
 *     def _precision(self):             # <<<<<<<<<<<<<<
 *         return Number._default_precision
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_91_precision(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_8Manifold_91_precision = {"_precision", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_91_precision, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_8Manifold_91_precision(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("_precision (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_precision", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_precision", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_8Manifold_90_precision(((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_8Manifold_90_precision(CYTHON_UNUSED struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_precision", 0);

  /* "cython/core/manifold.pyx":1868
 * 
 *     def _precision(self):
 *         return Number._default_precision             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_default_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1868, __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;

  /* "cython/core/manifold.pyx":1867
 *         return tilts, side_lengths
 * 
 *     def _precision(self):             # <<<<<<<<<<<<<<
 *         return Number._default_precision
*/

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

/* "cython/core/abelian_group.pyx":41
 *     cdef public coefficients
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):             # <<<<<<<<<<<<<<
 *         if presentation is not None:
 *             self.divisors = smith_form(presentation)
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_12AbelianGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_12AbelianGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_presentation = 0;
  PyObject *__pyx_v_elementary_divisors = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_presentation,&__pyx_mstate_global->__pyx_n_u_elementary_divisors,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 41, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(5, 41, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__31);
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__31);
    }
    __pyx_v_presentation = values[0];
    __pyx_v_elementary_divisors = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(5, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.AbelianGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup___init__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self), __pyx_v_presentation, __pyx_v_elementary_divisors);

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

static int __pyx_pf_8SnapPyHP_12AbelianGroup___init__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_presentation, PyObject *__pyx_v_elementary_divisors) {
  PyObject *__pyx_v_int_types = NULL;
  PyObject *__pyx_v_Integer = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_9genexpr58__pyx_v_n = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/abelian_group.pyx":42
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):
 *         if presentation is not None:             # <<<<<<<<<<<<<<
 *             self.divisors = smith_form(presentation)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_presentation != Py_None);
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":43
 *     def __init__(self, presentation=None, elementary_divisors=[]):
 *         if presentation is not None:
 *             self.divisors = smith_form(presentation)             # <<<<<<<<<<<<<<
 *         else:
 *             try:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_smith_form); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_presentation};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 43, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->divisors);
    __Pyx_DECREF(__pyx_v_self->divisors);
    __pyx_v_self->divisors = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":42
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):
 *         if presentation is not None:             # <<<<<<<<<<<<<<
 *             self.divisors = smith_form(presentation)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "cython/core/abelian_group.pyx":45
 *             self.divisors = smith_form(presentation)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.divisors = list(elementary_divisors)
 *             except:
*/
  /*else*/ {
    {
      __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:*/ {

        /* "cython/core/abelian_group.pyx":46
 *         else:
 *             try:
 *                 self.divisors = list(elementary_divisors)             # <<<<<<<<<<<<<<
 *             except:
 *                 raise ValueError('Elementary divisors must be given '
*/
        __pyx_t_2 = PySequence_List(__pyx_v_elementary_divisors); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 46, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_v_self->divisors);
        __Pyx_DECREF(__pyx_v_self->divisors);
        __pyx_v_self->divisors = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":45
 *             self.divisors = smith_form(presentation)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.divisors = list(elementary_divisors)
 *             except:
*/
      }
      __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_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/abelian_group.pyx":47
 *             try:
 *                 self.divisors = list(elementary_divisors)
 *             except:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Elementary divisors must be given '
 *                                  'as a sequence.')
*/
      /*except:*/ {
        __Pyx_AddTraceback("SnapPyHP.AbelianGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(5, 47, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_3);

        /* "cython/core/abelian_group.pyx":48
 *                 self.divisors = list(elementary_divisors)
 *             except:
 *                 raise ValueError('Elementary divisors must be given '             # <<<<<<<<<<<<<<
 *                                  'as a sequence.')
 *         int_types = [int]
*/
        __pyx_t_10 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_11 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_Elementary_divisors_must_be_give};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 48, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_Raise(__pyx_t_9, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(5, 48, __pyx_L6_except_error)
      }

      /* "cython/core/abelian_group.pyx":45
 *             self.divisors = smith_form(presentation)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.divisors = list(elementary_divisors)
 *             except:
*/
      __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:;
    }
  }
  __pyx_L3:;

  /* "cython/core/abelian_group.pyx":50
 *                 raise ValueError('Elementary divisors must be given '
 *                                  'as a sequence.')
 *         int_types = [int]             # <<<<<<<<<<<<<<
 *         if _within_sage:
 *             from sage.rings.integer import Integer
*/
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)(&PyLong_Type));
  __Pyx_GIVEREF((PyObject *)(&PyLong_Type));
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyLong_Type))) != (0)) __PYX_ERR(5, 50, __pyx_L1_error);
  __pyx_v_int_types = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/abelian_group.pyx":51
 *                                  'as a sequence.')
 *         int_types = [int]
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             from sage.rings.integer import Integer
 *             int_types += [Integer]
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":52
 *         int_types = [int]
 *         if _within_sage:
 *             from sage.rings.integer import Integer             # <<<<<<<<<<<<<<
 *             int_types += [Integer]
 *         for c in self.divisors:
*/
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Integer);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_Integer);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_n_u_Integer) != (0)) __PYX_ERR(5, 52, __pyx_L1_error);
    __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_rings_integer, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Integer); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_Integer = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/abelian_group.pyx":53
 *         if _within_sage:
 *             from sage.rings.integer import Integer
 *             int_types += [Integer]             # <<<<<<<<<<<<<<
 *         for c in self.divisors:
 *             assert type(c) in int_types and c >= 0,\
*/
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_Integer);
    __Pyx_GIVEREF(__pyx_v_Integer);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_Integer) != (0)) __PYX_ERR(5, 53, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_int_types, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_int_types, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cython/core/abelian_group.pyx":51
 *                                  'as a sequence.')
 *         int_types = [int]
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             from sage.rings.integer import Integer
 *             int_types += [Integer]
*/
  }

  /* "cython/core/abelian_group.pyx":54
 *             from sage.rings.integer import Integer
 *             int_types += [Integer]
 *         for c in self.divisors:             # <<<<<<<<<<<<<<
 *             assert type(c) in int_types and c >= 0,\
 *                    'Elementary divisors must be non-negative integers.\n'
*/
  if (likely(PyList_CheckExact(__pyx_v_self->divisors)) || PyTuple_CheckExact(__pyx_v_self->divisors)) {
    __pyx_t_3 = __pyx_v_self->divisors; __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_self->divisors); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 54, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 54, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12);
        ++__pyx_t_12;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 54, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12);
        #endif
        ++__pyx_t_12;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 54, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_13(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 54, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/abelian_group.pyx":55
 *             int_types += [Integer]
 *         for c in self.divisors:
 *             assert type(c) in int_types and c >= 0,\             # <<<<<<<<<<<<<<
 *                    'Elementary divisors must be non-negative integers.\n'
 *         for i in range(len(elementary_divisors) - 1):
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_14 = (__Pyx_PySequence_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_c)), __pyx_v_int_types, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(5, 55, __pyx_L1_error)
      if (__pyx_t_14) {
      } else {
        __pyx_t_1 = __pyx_t_14;
        goto __pyx_L15_bool_binop_done;
      }
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_c, __pyx_mstate_global->__pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 55, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(5, 55, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_1 = __pyx_t_14;
      __pyx_L15_bool_binop_done:;
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Elementary_divisors_must_be_non, 0, 0);
        __PYX_ERR(5, 55, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(5, 55, __pyx_L1_error)
    #endif

    /* "cython/core/abelian_group.pyx":54
 *             from sage.rings.integer import Integer
 *             int_types += [Integer]
 *         for c in self.divisors:             # <<<<<<<<<<<<<<
 *             assert type(c) in int_types and c >= 0,\
 *                    'Elementary divisors must be non-negative integers.\n'
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/abelian_group.pyx":57
 *             assert type(c) in int_types and c >= 0,\
 *                    'Elementary divisors must be non-negative integers.\n'
 *         for i in range(len(elementary_divisors) - 1):             # <<<<<<<<<<<<<<
 *             n = elementary_divisors[i]
 *             m = elementary_divisors[i + 1]
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_2 = __pyx_builtin_range; 
  __pyx_t_12 = PyObject_Length(__pyx_v_elementary_divisors); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(5, 57, __pyx_L1_error)
  __pyx_t_9 = PyLong_FromSsize_t((__pyx_t_12 - 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 57, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 57, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_12);
        ++__pyx_t_12;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 57, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_12);
        #endif
        ++__pyx_t_12;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 57, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_13(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 57, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/abelian_group.pyx":58
 *                    'Elementary divisors must be non-negative integers.\n'
 *         for i in range(len(elementary_divisors) - 1):
 *             n = elementary_divisors[i]             # <<<<<<<<<<<<<<
 *             m = elementary_divisors[i + 1]
 *             assert (n == m == 0) or (m % n == 0),\
*/
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_elementary_divisors, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/abelian_group.pyx":59
 *         for i in range(len(elementary_divisors) - 1):
 *             n = elementary_divisors[i]
 *             m = elementary_divisors[i + 1]             # <<<<<<<<<<<<<<
 *             assert (n == m == 0) or (m % n == 0),\
 *                    'The elementary divisors must form a divisibility chain\n'
*/
    __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_elementary_divisors, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "cython/core/abelian_group.pyx":60
 *             n = elementary_divisors[i]
 *             m = elementary_divisors[i + 1]
 *             assert (n == m == 0) or (m % n == 0),\             # <<<<<<<<<<<<<<
 *                    'The elementary divisors must form a divisibility chain\n'
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_n, __pyx_v_m, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 60, __pyx_L1_error)
      if (__Pyx_PyObject_IsTrue(__pyx_t_9)) {
        __Pyx_DECREF(__pyx_t_9);
        __pyx_t_9 = PyObject_RichCompare(__pyx_v_m, __pyx_mstate_global->__pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 60, __pyx_L1_error)
      }
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(5, 60, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (!__pyx_t_14) {
      } else {
        __pyx_t_1 = __pyx_t_14;
        goto __pyx_L20_bool_binop_done;
      }
      __pyx_t_9 = PyNumber_Remainder(__pyx_v_m, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 60, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_14 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_9, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(5, 60, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_1 = __pyx_t_14;
      __pyx_L20_bool_binop_done:;
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_The_elementary_divisors_must_for, 0, 0);
        __PYX_ERR(5, 60, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(5, 60, __pyx_L1_error)
    #endif

    /* "cython/core/abelian_group.pyx":57
 *             assert type(c) in int_types and c >= 0,\
 *                    'Elementary divisors must be non-negative integers.\n'
 *         for i in range(len(elementary_divisors) - 1):             # <<<<<<<<<<<<<<
 *             n = elementary_divisors[i]
 *             m = elementary_divisors[i + 1]
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":65
 *         # So that the group is determined entirely by self.divisors
 *         # we don't allow '1' as a divisor.
 *         self.divisors = [n for n in self.divisors if n != 1]             # <<<<<<<<<<<<<<
 *         # Backwards compatibility hack, part 2.
 *         self.coefficients = self.divisors
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 65, __pyx_L25_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_self->divisors)) || PyTuple_CheckExact(__pyx_v_self->divisors)) {
      __pyx_t_9 = __pyx_v_self->divisors; __Pyx_INCREF(__pyx_t_9);
      __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_self->divisors); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 65, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 65, __pyx_L25_error)
    }
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 65, __pyx_L25_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_12);
          ++__pyx_t_12;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 65, __pyx_L25_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_12);
          #endif
          ++__pyx_t_12;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 65, __pyx_L25_error)
      } else {
        __pyx_t_3 = __pyx_t_13(__pyx_t_9);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 65, __pyx_L25_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_9genexpr58__pyx_v_n, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = (__Pyx_PyLong_BoolNeObjC(__pyx_9genexpr58__pyx_v_n, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 65, __pyx_L25_error)
      if (__pyx_t_1) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr58__pyx_v_n))) __PYX_ERR(5, 65, __pyx_L25_error)
      }
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_n); __pyx_9genexpr58__pyx_v_n = 0;
    goto __pyx_L30_exit_scope;
    __pyx_L25_error:;
    __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_n); __pyx_9genexpr58__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L30_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->divisors);
  __Pyx_DECREF(__pyx_v_self->divisors);
  __pyx_v_self->divisors = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":67
 *         self.divisors = [n for n in self.divisors if n != 1]
 *         # Backwards compatibility hack, part 2.
 *         self.coefficients = self.divisors             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_2 = __pyx_v_self->divisors;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->coefficients);
  __Pyx_DECREF(__pyx_v_self->coefficients);
  __pyx_v_self->coefficients = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":41
 *     cdef public coefficients
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):             # <<<<<<<<<<<<<<
 *         if presentation is not None:
 *             self.divisors = smith_form(presentation)
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.AbelianGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_int_types);
  __Pyx_XDECREF(__pyx_v_Integer);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_n);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":69
 *         self.coefficients = self.divisors
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if len(self.divisors) == 0:
 *             return '0'
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_3__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_8SnapPyHP_12AbelianGroup_2__repr__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_2__repr__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_v_factors = NULL;
  PyObject *__pyx_9genexpr59__pyx_v_n = NULL;
  PyObject *__pyx_9genexpr60__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/abelian_group.pyx":70
 * 
 *     def __repr__(self):
 *         if len(self.divisors) == 0:             # <<<<<<<<<<<<<<
 *             return '0'
 *         factors = (['Z/%d' % n for n in self.divisors if n] +
*/
  __pyx_t_1 = __pyx_v_self->divisors;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 == 0);
  if (__pyx_t_3) {

    /* "cython/core/abelian_group.pyx":71
 *     def __repr__(self):
 *         if len(self.divisors) == 0:
 *             return '0'             # <<<<<<<<<<<<<<
 *         factors = (['Z/%d' % n for n in self.divisors if n] +
 *                    ['Z' for n in self.divisors if not n])
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_0);
    __pyx_r = __pyx_mstate_global->__pyx_kp_u_0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":70
 * 
 *     def __repr__(self):
 *         if len(self.divisors) == 0:             # <<<<<<<<<<<<<<
 *             return '0'
 *         factors = (['Z/%d' % n for n in self.divisors if n] +
*/
  }

  /* "cython/core/abelian_group.pyx":72
 *         if len(self.divisors) == 0:
 *             return '0'
 *         factors = (['Z/%d' % n for n in self.divisors if n] +             # <<<<<<<<<<<<<<
 *                    ['Z' for n in self.divisors if not n])
 *         return ' + '.join(factors)
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 72, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_self->divisors)) || PyTuple_CheckExact(__pyx_v_self->divisors)) {
      __pyx_t_4 = __pyx_v_self->divisors; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_2 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->divisors); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 72, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 72, __pyx_L6_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 72, __pyx_L6_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2);
          ++__pyx_t_2;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 72, __pyx_L6_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2);
          #endif
          ++__pyx_t_2;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 72, __pyx_L6_error)
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_4);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 72, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_9genexpr59__pyx_v_n, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_9genexpr59__pyx_v_n); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(5, 72, __pyx_L6_error)
      if (__pyx_t_3) {
        __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Z_d, __pyx_9genexpr59__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 72, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(5, 72, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_n); __pyx_9genexpr59__pyx_v_n = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_n); __pyx_9genexpr59__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  { /* enter inner scope */

    /* "cython/core/abelian_group.pyx":73
 *             return '0'
 *         factors = (['Z/%d' % n for n in self.divisors if n] +
 *                    ['Z' for n in self.divisors if not n])             # <<<<<<<<<<<<<<
 *         return ' + '.join(factors)
 * 
*/
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 73, __pyx_L14_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_self->divisors)) || PyTuple_CheckExact(__pyx_v_self->divisors)) {
      __pyx_t_6 = __pyx_v_self->divisors; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_2 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_self->divisors); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 73, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 73, __pyx_L14_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 73, __pyx_L14_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2);
          ++__pyx_t_2;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 73, __pyx_L14_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2));
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2);
          #endif
          ++__pyx_t_2;
        }
        if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 73, __pyx_L14_error)
      } else {
        __pyx_t_7 = __pyx_t_5(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 73, __pyx_L14_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_9genexpr60__pyx_v_n, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_9genexpr60__pyx_v_n); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(5, 73, __pyx_L14_error)
      __pyx_t_8 = (!__pyx_t_3);
      if (__pyx_t_8) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_n_u_Z))) __PYX_ERR(5, 73, __pyx_L14_error)
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_n); __pyx_9genexpr60__pyx_v_n = 0;
    goto __pyx_L19_exit_scope;
    __pyx_L14_error:;
    __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_n); __pyx_9genexpr60__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L19_exit_scope:;
  } /* exit inner scope */

  /* "cython/core/abelian_group.pyx":72
 *         if len(self.divisors) == 0:
 *             return '0'
 *         factors = (['Z/%d' % n for n in self.divisors if n] +             # <<<<<<<<<<<<<<
 *                    ['Z' for n in self.divisors if not n])
 *         return ' + '.join(factors)
*/
  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_factors = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/abelian_group.pyx":74
 *         factors = (['Z/%d' % n for n in self.divisors if n] +
 *                    ['Z' for n in self.divisors if not n])
 *         return ' + '.join(factors)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__12, __pyx_v_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":69
 *         self.coefficients = self.divisors
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if len(self.divisors) == 0:
 *             return '0'
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.AbelianGroup.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_factors);
  __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_n);
  __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":76
 *         return ' + '.join(factors)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.divisors)
 * 
*/

/* Python wrapper */
static Py_ssize_t __pyx_pw_8SnapPyHP_12AbelianGroup_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_8SnapPyHP_12AbelianGroup_5__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_8SnapPyHP_12AbelianGroup_4__len__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_8SnapPyHP_12AbelianGroup_4__len__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "cython/core/abelian_group.pyx":77
 * 
 *     def __len__(self):
 *         return len(self.divisors)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
*/
  __pyx_t_1 = __pyx_v_self->divisors;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":76
 *         return ' + '.join(factors)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.divisors)
 * 
*/

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

/* "cython/core/abelian_group.pyx":79
 *         return len(self.divisors)
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.divisors[i]
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  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_8SnapPyHP_12AbelianGroup_6__getitem__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_6__getitem__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_i) {
  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("__getitem__", 0);

  /* "cython/core/abelian_group.pyx":80
 * 
 *     def __getitem__(self, i):
 *         return self.divisors[i]             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->divisors, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":79
 *         return len(self.divisors)
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.divisors[i]
 * 
*/

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

/* "cython/core/abelian_group.pyx":82
 *         return self.divisors[i]
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by the pickle module to pickle an Abelian Group.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_9__reduce__(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_8SnapPyHP_12AbelianGroup_8__reduce__, "\n        Used by the pickle module to pickle an Abelian Group.\n        >>> from pickle import loads, dumps\n        >>> A = AbelianGroup([[n**2 + 3 for n in range(n+3,n+10)] for n in range(7)])\n        >>> A\n        Z/8 + Z + Z + Z + Z\n        >>> A == loads(dumps(A))\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_12AbelianGroup_9__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_9__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_8__reduce__};
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_9__reduce__(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__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup_8__reduce__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_8__reduce__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cython/core/abelian_group.pyx":92
 *         True
 *         """
 *         return (AbelianGroup, (None, self.elementary_divisors()))             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 92, __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) != (0)) __PYX_ERR(5, 92, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(5, 92, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup)) != (0)) __PYX_ERR(5, 92, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(5, 92, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":82
 *         return self.divisors[i]
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by the pickle module to pickle an Abelian Group.
*/

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

/* "cython/core/abelian_group.pyx":94
 *         return (AbelianGroup, (None, self.elementary_divisors()))
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):             # <<<<<<<<<<<<<<
 *         if op == 0:
 *             return self.divisors < other.elementary_divisors()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op) {
  PyObject *__pyx_v_op = 0;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_v_op = __Pyx_PyLong_From_int(__pyx_arg_op); if (unlikely(!__pyx_v_op)) __PYX_ERR(5, 94, __pyx_L3_error)
  __Pyx_GOTREF(__pyx_v_op);
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPyHP.AbelianGroup.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup, 1, "other", 0))) __PYX_ERR(5, 94, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup_10__richcmp__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self), ((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_other), ((PyObject *)__pyx_v_op));

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

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

  /* "cython/core/abelian_group.pyx":95
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_op, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 95, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":96
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):
 *         if op == 0:
 *             return self.divisors < other.elementary_divisors()             # <<<<<<<<<<<<<<
 *         elif op == 2:
 *             return self.divisors == other.elementary_divisors()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_other);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 96, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":95
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:
*/
  }

  /* "cython/core/abelian_group.pyx":97
 *         if op == 0:
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:             # <<<<<<<<<<<<<<
 *             return self.divisors == other.elementary_divisors()
 *         elif op == 4:
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_op, __pyx_mstate_global->__pyx_int_2, 2, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 97, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":98
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:
 *             return self.divisors == other.elementary_divisors()             # <<<<<<<<<<<<<<
 *         elif op == 4:
 *             return self.divisors > other.elementary_divisors()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_v_other);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 98, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 98, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":97
 *         if op == 0:
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:             # <<<<<<<<<<<<<<
 *             return self.divisors == other.elementary_divisors()
 *         elif op == 4:
*/
  }

  /* "cython/core/abelian_group.pyx":99
 *         elif op == 2:
 *             return self.divisors == other.elementary_divisors()
 *         elif op == 4:             # <<<<<<<<<<<<<<
 *             return self.divisors > other.elementary_divisors()
 *         elif op == 1:
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_op, __pyx_mstate_global->__pyx_int_4, 4, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 99, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":100
 *             return self.divisors == other.elementary_divisors()
 *         elif op == 4:
 *             return self.divisors > other.elementary_divisors()             # <<<<<<<<<<<<<<
 *         elif op == 1:
 *             return self.divisors <= other.elementary_divisors()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_other);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":99
 *         elif op == 2:
 *             return self.divisors == other.elementary_divisors()
 *         elif op == 4:             # <<<<<<<<<<<<<<
 *             return self.divisors > other.elementary_divisors()
 *         elif op == 1:
*/
  }

  /* "cython/core/abelian_group.pyx":101
 *         elif op == 4:
 *             return self.divisors > other.elementary_divisors()
 *         elif op == 1:             # <<<<<<<<<<<<<<
 *             return self.divisors <= other.elementary_divisors()
 *         elif op == 3:
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_op, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 101, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":102
 *             return self.divisors > other.elementary_divisors()
 *         elif op == 1:
 *             return self.divisors <= other.elementary_divisors()             # <<<<<<<<<<<<<<
 *         elif op == 3:
 *             return self.divisors != other.elementary_divisors()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_v_other);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 102, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":101
 *         elif op == 4:
 *             return self.divisors > other.elementary_divisors()
 *         elif op == 1:             # <<<<<<<<<<<<<<
 *             return self.divisors <= other.elementary_divisors()
 *         elif op == 3:
*/
  }

  /* "cython/core/abelian_group.pyx":103
 *         elif op == 1:
 *             return self.divisors <= other.elementary_divisors()
 *         elif op == 3:             # <<<<<<<<<<<<<<
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_op, __pyx_mstate_global->__pyx_int_3, 3, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 103, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":104
 *             return self.divisors <= other.elementary_divisors()
 *         elif op == 3:
 *             return self.divisors != other.elementary_divisors()             # <<<<<<<<<<<<<<
 *         elif op == 5:
 *             return self.divisors >= other.elementary_divisors()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_other);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":103
 *         elif op == 1:
 *             return self.divisors <= other.elementary_divisors()
 *         elif op == 3:             # <<<<<<<<<<<<<<
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:
*/
  }

  /* "cython/core/abelian_group.pyx":105
 *         elif op == 3:
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:             # <<<<<<<<<<<<<<
 *             return self.divisors >= other.elementary_divisors()
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_op, __pyx_mstate_global->__pyx_int_5, 5, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 105, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/abelian_group.pyx":106
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:
 *             return self.divisors >= other.elementary_divisors()             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_v_other);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":105
 *         elif op == 3:
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:             # <<<<<<<<<<<<<<
 *             return self.divisors >= other.elementary_divisors()
 *         else:
*/
  }

  /* "cython/core/abelian_group.pyx":108
 *             return self.divisors >= other.elementary_divisors()
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "cython/core/abelian_group.pyx":94
 *         return (AbelianGroup, (None, self.elementary_divisors()))
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):             # <<<<<<<<<<<<<<
 *         if op == 0:
 *             return self.divisors < other.elementary_divisors()
*/

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

/* "cython/core/abelian_group.pyx":110
 *             return NotImplemented
 * 
 *     def __call__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_13__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_13__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__call__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup_12__call__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_12__call__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "cython/core/abelian_group.pyx":111
 * 
 *     def __call__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def elementary_divisors(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":110
 *             return NotImplemented
 * 
 *     def __call__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

/* "cython/core/abelian_group.pyx":113
 *         return self
 * 
 *     def elementary_divisors(self):             # <<<<<<<<<<<<<<
 *         """
 *         The elementary divisors of this finitely generated abelian group.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_15elementary_divisors(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_8SnapPyHP_12AbelianGroup_14elementary_divisors, "\n        The elementary divisors of this finitely generated abelian group.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_12AbelianGroup_15elementary_divisors = {"elementary_divisors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_15elementary_divisors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_14elementary_divisors};
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_15elementary_divisors(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("elementary_divisors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("elementary_divisors", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("elementary_divisors", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup_14elementary_divisors(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_14elementary_divisors(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("elementary_divisors", 0);

  /* "cython/core/abelian_group.pyx":117
 *         The elementary divisors of this finitely generated abelian group.
 *         """
 *         return self.divisors             # <<<<<<<<<<<<<<
 * 
 *     def rank(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->divisors);
  __pyx_r = __pyx_v_self->divisors;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":113
 *         return self
 * 
 *     def elementary_divisors(self):             # <<<<<<<<<<<<<<
 *         """
 *         The elementary divisors of this finitely generated abelian group.
*/

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

/* "cython/core/abelian_group.pyx":119
 *         return self.divisors
 * 
 *     def rank(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the group.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_17rank(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_8SnapPyHP_12AbelianGroup_16rank, "\n        The rank of the group.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_12AbelianGroup_17rank = {"rank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_17rank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_16rank};
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_17rank(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("rank (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("rank", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("rank", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup_16rank(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_16rank(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rank", 0);

  /* "cython/core/abelian_group.pyx":123
 *         The rank of the group.
 *         """
 *         return len(self.divisors)             # <<<<<<<<<<<<<<
 * 
 *     def betti_number(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->divisors;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":119
 *         return self.divisors
 * 
 *     def rank(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the group.
*/

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

/* "cython/core/abelian_group.pyx":125
 *         return len(self.divisors)
 * 
 *     def betti_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the maximal free abelian subgroup.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_19betti_number(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_8SnapPyHP_12AbelianGroup_18betti_number, "\n        The rank of the maximal free abelian subgroup.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_12AbelianGroup_19betti_number = {"betti_number", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_19betti_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_18betti_number};
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_19betti_number(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("betti_number (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("betti_number", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("betti_number", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup_18betti_number(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_18betti_number(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_9genexpr61__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("betti_number", 0);

  /* "cython/core/abelian_group.pyx":129
 *         The rank of the maximal free abelian subgroup.
 *         """
 *         return len([1 for n in self.divisors if n == 0])             # <<<<<<<<<<<<<<
 * 
 *     def order(self):
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 129, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_self->divisors)) || PyTuple_CheckExact(__pyx_v_self->divisors)) {
      __pyx_t_2 = __pyx_v_self->divisors; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->divisors); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 129, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 129, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 129, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 129, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 129, __pyx_L5_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 129, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_9genexpr61__pyx_v_n, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_9genexpr61__pyx_v_n, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 129, __pyx_L5_error)
      if (__pyx_t_6) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_mstate_global->__pyx_int_1))) __PYX_ERR(5, 129, __pyx_L5_error)
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_n); __pyx_9genexpr61__pyx_v_n = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_n); __pyx_9genexpr61__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":125
 *         return len(self.divisors)
 * 
 *     def betti_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the maximal free abelian subgroup.
*/

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

/* "cython/core/abelian_group.pyx":131
 *         return len([1 for n in self.divisors if n == 0])
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         """
 *         The order of the group.  Returns the string 'infinite' if the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_21order(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_8SnapPyHP_12AbelianGroup_20order, "\n        The order of the group.  Returns the string 'infinite' if the\n        group is infinite.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_12AbelianGroup_21order = {"order", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_21order, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_20order};
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_21order(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("order (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("order", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("order", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_12AbelianGroup_20order(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_20order(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_v_det = NULL;
  PyObject *__pyx_v_c = 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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("order", 0);

  /* "cython/core/abelian_group.pyx":136
 *         group is infinite.
 *         """
 *         det = 1             # <<<<<<<<<<<<<<
 *         for c in self.divisors:
 *             det = det * c
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __pyx_v_det = __pyx_mstate_global->__pyx_int_1;

  /* "cython/core/abelian_group.pyx":137
 *         """
 *         det = 1
 *         for c in self.divisors:             # <<<<<<<<<<<<<<
 *             det = det * c
 *         return 'infinite' if det == 0 else det
*/
  if (likely(PyList_CheckExact(__pyx_v_self->divisors)) || PyTuple_CheckExact(__pyx_v_self->divisors)) {
    __pyx_t_1 = __pyx_v_self->divisors; __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_self->divisors); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 137, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 137, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 137, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 137, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 137, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/abelian_group.pyx":138
 *         det = 1
 *         for c in self.divisors:
 *             det = det * c             # <<<<<<<<<<<<<<
 *         return 'infinite' if det == 0 else det
 * 
*/
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_det, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_det, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/abelian_group.pyx":137
 *         """
 *         det = 1
 *         for c in self.divisors:             # <<<<<<<<<<<<<<
 *             det = det * c
 *         return 'infinite' if det == 0 else det
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":139
 *         for c in self.divisors:
 *             det = det * c
 *         return 'infinite' if det == 0 else det             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_det, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(5, 139, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_infinite);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_infinite;
  } else {
    __Pyx_INCREF(__pyx_v_det);
    __pyx_t_1 = __pyx_v_det;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":131
 *         return len([1 for n in self.divisors if n == 0])
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         """
 *         The order of the group.  Returns the string 'infinite' if the
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.AbelianGroup.order", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_det);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":39
 *     cdef divisors
 *     # Backwards compatibility hack, part 1.
 *     cdef public coefficients             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_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_8SnapPyHP_12AbelianGroup_12coefficients___get__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_12AbelianGroup_12coefficients___get__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->coefficients);
  __pyx_r = __pyx_v_self->coefficients;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_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_8SnapPyHP_12AbelianGroup_12coefficients_2__set__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_8SnapPyHP_12AbelianGroup_12coefficients_2__set__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->coefficients);
  __Pyx_DECREF(__pyx_v_self->coefficients);
  __pyx_v_self->coefficients = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_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_8SnapPyHP_12AbelianGroup_12coefficients_4__del__(((struct __pyx_obj_8SnapPyHP_AbelianGroup *)__pyx_v_self));

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

static int __pyx_pf_8SnapPyHP_12AbelianGroup_12coefficients_4__del__(struct __pyx_obj_8SnapPyHP_AbelianGroup *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->coefficients);
  __Pyx_DECREF(__pyx_v_self->coefficients);
  __pyx_v_self->coefficients = Py_None;

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

/* "cython/core/abelian_group.pyx":150
 *     cdef set _units, dead_columns
 * 
 *     def __init__(self, rows, cols):             # <<<<<<<<<<<<<<
 *         self.rows = rows
 *         self.cols = cols
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_18PresentationMatrix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_18PresentationMatrix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_rows = 0;
  PyObject *__pyx_v_cols = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 150, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(5, 150, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(5, 150, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 150, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 150, __pyx_L3_error)
    }
    __pyx_v_rows = values[0];
    __pyx_v_cols = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 150, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix___init__(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols);

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

static int __pyx_pf_8SnapPyHP_18PresentationMatrix___init__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols) {
  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("__init__", 0);

  /* "cython/core/abelian_group.pyx":151
 * 
 *     def __init__(self, rows, cols):
 *         self.rows = rows             # <<<<<<<<<<<<<<
 *         self.cols = cols
 *         self._row_support = {}
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_rows); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 151, __pyx_L1_error)
  __pyx_v_self->rows = __pyx_t_1;

  /* "cython/core/abelian_group.pyx":152
 *     def __init__(self, rows, cols):
 *         self.rows = rows
 *         self.cols = cols             # <<<<<<<<<<<<<<
 *         self._row_support = {}
 *         self._col_support = {}
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_cols); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 152, __pyx_L1_error)
  __pyx_v_self->cols = __pyx_t_1;

  /* "cython/core/abelian_group.pyx":153
 *         self.rows = rows
 *         self.cols = cols
 *         self._row_support = {}             # <<<<<<<<<<<<<<
 *         self._col_support = {}
 *         self._entries = {}
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_row_support);
  __Pyx_DECREF(__pyx_v_self->_row_support);
  __pyx_v_self->_row_support = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":154
 *         self.cols = cols
 *         self._row_support = {}
 *         self._col_support = {}             # <<<<<<<<<<<<<<
 *         self._entries = {}
 *         self._units = set()
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_col_support);
  __Pyx_DECREF(__pyx_v_self->_col_support);
  __pyx_v_self->_col_support = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":155
 *         self._row_support = {}
 *         self._col_support = {}
 *         self._entries = {}             # <<<<<<<<<<<<<<
 *         self._units = set()
 *         self.dead_columns = set()
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_entries);
  __Pyx_DECREF(__pyx_v_self->_entries);
  __pyx_v_self->_entries = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":156
 *         self._col_support = {}
 *         self._entries = {}
 *         self._units = set()             # <<<<<<<<<<<<<<
 *         self.dead_columns = set()
 * 
*/
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_units);
  __Pyx_DECREF(__pyx_v_self->_units);
  __pyx_v_self->_units = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":157
 *         self._entries = {}
 *         self._units = set()
 *         self.dead_columns = set()             # <<<<<<<<<<<<<<
 * 
 *     def get_data(self):
*/
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->dead_columns);
  __Pyx_DECREF(__pyx_v_self->dead_columns);
  __pyx_v_self->dead_columns = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":150
 *     cdef set _units, dead_columns
 * 
 *     def __init__(self, rows, cols):             # <<<<<<<<<<<<<<
 *         self.rows = rows
 *         self.cols = cols
*/

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

/* "cython/core/abelian_group.pyx":159
 *         self.dead_columns = set()
 * 
 *     def get_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a triple (number of rows, number of columns, entries)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_3get_data(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_8SnapPyHP_18PresentationMatrix_2get_data, "\n        Returns a triple (number of rows, number of columns, entries)\n        where entries is a dictionary for the non-zero entries of the\n        presentation matrix: the key is a pair (i,j) indicating the row and\n        column, the value is the value of the corresponding matrix entry.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_3get_data = {"get_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_3get_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_2get_data};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_3get_data(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_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_data", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_data", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_2get_data(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_2get_data(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__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("get_data", 0);

  /* "cython/core/abelian_group.pyx":166
 *         column, the value is the value of the corresponding matrix entry.
 *         """
 *         return self.rows, self.cols, self._entries             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, ij, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(5, 166, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(5, 166, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_entries);
  __Pyx_GIVEREF(__pyx_v_self->_entries);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->_entries) != (0)) __PYX_ERR(5, 166, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":159
 *         self.dead_columns = set()
 * 
 *     def get_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a triple (number of rows, number of columns, entries)
*/

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

/* "cython/core/abelian_group.pyx":168
 *         return self.rows, self.cols, self._entries
 * 
 *     def __setitem__(self, ij, value):             # <<<<<<<<<<<<<<
 *         i, j = ij
 *         # check bounds
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_18PresentationMatrix_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8SnapPyHP_18PresentationMatrix_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_4__setitem__(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_ij), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_8SnapPyHP_18PresentationMatrix_4__setitem__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "cython/core/abelian_group.pyx":169
 * 
 *     def __setitem__(self, ij, value):
 *         i, j = ij             # <<<<<<<<<<<<<<
 *         # check bounds
 *         if not 0 <= i < self.rows or not 0 <= j < self.cols:
*/
  if ((likely(PyTuple_CheckExact(__pyx_v_ij))) || (PyList_CheckExact(__pyx_v_ij))) {
    PyObject* sequence = __pyx_v_ij;
    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(5, 169, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 169, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 169, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(5, 169, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(5, 169, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_i = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_j = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":171
 *         i, j = ij
 *         # check bounds
 *         if not 0 <= i < self.rows or not 0 <= j < self.cols:             # <<<<<<<<<<<<<<
 *             raise IndexError
 *         self._set(ij, value)
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 171, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 171, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (!__pyx_t_6);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 171, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_j, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 171, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_7);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L6_bool_binop_done:;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/abelian_group.pyx":172
 *         # check bounds
 *         if not 0 <= i < self.rows or not 0 <= j < self.cols:
 *             raise IndexError             # <<<<<<<<<<<<<<
 *         self._set(ij, value)
 * 
*/
    __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
    __PYX_ERR(5, 172, __pyx_L1_error)

    /* "cython/core/abelian_group.pyx":171
 *         i, j = ij
 *         # check bounds
 *         if not 0 <= i < self.rows or not 0 <= j < self.cols:             # <<<<<<<<<<<<<<
 *             raise IndexError
 *         self._set(ij, value)
*/
  }

  /* "cython/core/abelian_group.pyx":173
 *         if not 0 <= i < self.rows or not 0 <= j < self.cols:
 *             raise IndexError
 *         self._set(ij, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef _set(self, ij, value):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_PresentationMatrix *)__pyx_v_self->__pyx_vtab)->_set(__pyx_v_self, __pyx_v_ij, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":168
 *         return self.rows, self.cols, self._entries
 * 
 *     def __setitem__(self, ij, value):             # <<<<<<<<<<<<<<
 *         i, j = ij
 *         # check bounds
*/

  /* 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("SnapPyHP.PresentationMatrix.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":175
 *         self._set(ij, value)
 * 
 *     cdef _set(self, ij, value):             # <<<<<<<<<<<<<<
 *         # cdef'ed to allow for faster calling
 *         i, j = ij
*/

static PyObject *__pyx_f_8SnapPyHP_18PresentationMatrix__set(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = 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)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  size_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set", 0);

  /* "cython/core/abelian_group.pyx":177
 *     cdef _set(self, ij, value):
 *         # cdef'ed to allow for faster calling
 *         i, j = ij             # <<<<<<<<<<<<<<
 *         # keep track of units
 *         if value == 1 or value == -1:
*/
  if ((likely(PyTuple_CheckExact(__pyx_v_ij))) || (PyList_CheckExact(__pyx_v_ij))) {
    PyObject* sequence = __pyx_v_ij;
    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(5, 177, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 177, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 177, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(5, 177, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(5, 177, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_i = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_j = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":179
 *         i, j = ij
 *         # keep track of units
 *         if value == 1 or value == -1:             # <<<<<<<<<<<<<<
 *             self._units.add(ij)
 *         else:
*/
  __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 179, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 179, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cython/core/abelian_group.pyx":180
 *         # keep track of units
 *         if value == 1 or value == -1:
 *             self._units.add(ij)             # <<<<<<<<<<<<<<
 *         else:
 *             try:
*/
    if (unlikely(__pyx_v_self->_units == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
      __PYX_ERR(5, 180, __pyx_L1_error)
    }
    __pyx_t_7 = PySet_Add(__pyx_v_self->_units, __pyx_v_ij); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 180, __pyx_L1_error)

    /* "cython/core/abelian_group.pyx":179
 *         i, j = ij
 *         # keep track of units
 *         if value == 1 or value == -1:             # <<<<<<<<<<<<<<
 *             self._units.add(ij)
 *         else:
*/
    goto __pyx_L5;
  }

  /* "cython/core/abelian_group.pyx":182
 *             self._units.add(ij)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._units.remove(ij)
 *             except KeyError:
*/
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "cython/core/abelian_group.pyx":183
 *         else:
 *             try:
 *                 self._units.remove(ij)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 pass
*/
        if (unlikely(__pyx_v_self->_units == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "remove");
          __PYX_ERR(5, 183, __pyx_L8_error)
        }
        __pyx_t_7 = __Pyx_PySet_Remove(__pyx_v_self->_units, __pyx_v_ij); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 183, __pyx_L8_error)

        /* "cython/core/abelian_group.pyx":182
 *             self._units.add(ij)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._units.remove(ij)
 *             except KeyError:
*/
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/abelian_group.pyx":184
 *             try:
 *                 self._units.remove(ij)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 pass
 *         # don't store any zeros
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_11) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L9_exception_handled;
      }
      goto __pyx_L10_except_error;

      /* "cython/core/abelian_group.pyx":182
 *             self._units.add(ij)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._units.remove(ij)
 *             except KeyError:
*/
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L9_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __pyx_L13_try_end:;
    }
  }
  __pyx_L5:;

  /* "cython/core/abelian_group.pyx":187
 *                 pass
 *         # don't store any zeros
 *         if value == 0:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._entries.pop(ij)
*/
  __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(5, 187, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "cython/core/abelian_group.pyx":188
 *         # don't store any zeros
 *         if value == 0:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "cython/core/abelian_group.pyx":189
 *         if value == 0:
 *             try:
 *                 self._entries.pop(ij)             # <<<<<<<<<<<<<<
 *                 self._row_support[i].remove(j)
 *                 self._col_support[j].remove(i)
*/
        if (unlikely(__pyx_v_self->_entries == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(5, 189, __pyx_L17_error)
        }
        __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->_entries, __pyx_v_ij, ((PyObject *)NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 189, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":190
 *             try:
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)             # <<<<<<<<<<<<<<
 *                 self._col_support[j].remove(i)
 *             except KeyError:
*/
        if (unlikely(__pyx_v_self->_row_support == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(5, 190, __pyx_L17_error)
        }
        __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->_row_support, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 190, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __pyx_t_3;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_12 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_j};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 190, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":191
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)
 *                 self._col_support[j].remove(i)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 pass
*/
        if (unlikely(__pyx_v_self->_col_support == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(5, 191, __pyx_L17_error)
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_col_support, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 191, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1;
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_12 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_i};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 191, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":188
 *         # don't store any zeros
 *         if value == 0:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)
*/
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L22_try_end;
      __pyx_L17_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/abelian_group.pyx":192
 *                 self._row_support[i].remove(j)
 *                 self._col_support[j].remove(i)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 pass
 *             return
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_11) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L18_exception_handled;
      }
      goto __pyx_L19_except_error;

      /* "cython/core/abelian_group.pyx":188
 *         # don't store any zeros
 *         if value == 0:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)
*/
      __pyx_L19_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L18_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      __pyx_L22_try_end:;
    }

    /* "cython/core/abelian_group.pyx":194
 *             except KeyError:
 *                 pass
 *             return             # <<<<<<<<<<<<<<
 *         # keep track of row and column supports
 *         try:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":187
 *                 pass
 *         # don't store any zeros
 *         if value == 0:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._entries.pop(ij)
*/
  }

  /* "cython/core/abelian_group.pyx":196
 *             return
 *         # keep track of row and column supports
 *         try:             # <<<<<<<<<<<<<<
 *             self._row_support[i].add(j)
 *         except KeyError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "cython/core/abelian_group.pyx":197
 *         # keep track of row and column supports
 *         try:
 *             self._row_support[i].add(j)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             self._row_support[i] = set([j])
*/
      if (unlikely(__pyx_v_self->_row_support == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 197, __pyx_L25_error)
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->_row_support, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 197, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_12 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_j};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 197, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/abelian_group.pyx":196
 *             return
 *         # keep track of row and column supports
 *         try:             # <<<<<<<<<<<<<<
 *             self._row_support[i].add(j)
 *         except KeyError:
*/
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L30_try_end;
    __pyx_L25_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/abelian_group.pyx":198
 *         try:
 *             self._row_support[i].add(j)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             self._row_support[i] = set([j])
 *         try:
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("SnapPyHP.PresentationMatrix._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(5, 198, __pyx_L27_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_1);

      /* "cython/core/abelian_group.pyx":199
 *             self._row_support[i].add(j)
 *         except KeyError:
 *             self._row_support[i] = set([j])             # <<<<<<<<<<<<<<
 *         try:
 *             self._col_support[j].add(i)
*/
      __pyx_t_13 = PySet_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 199, __pyx_L27_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (PySet_Add(__pyx_t_13, __pyx_v_j) < 0) __PYX_ERR(5, 199, __pyx_L27_except_error)
      if (unlikely(__pyx_v_self->_row_support == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 199, __pyx_L27_except_error)
      }
      if (unlikely((PyDict_SetItem(__pyx_v_self->_row_support, __pyx_v_i, __pyx_t_13) < 0))) __PYX_ERR(5, 199, __pyx_L27_except_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L26_exception_handled;
    }
    goto __pyx_L27_except_error;

    /* "cython/core/abelian_group.pyx":196
 *             return
 *         # keep track of row and column supports
 *         try:             # <<<<<<<<<<<<<<
 *             self._row_support[i].add(j)
 *         except KeyError:
*/
    __pyx_L27_except_error:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L26_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L30_try_end:;
  }

  /* "cython/core/abelian_group.pyx":200
 *         except KeyError:
 *             self._row_support[i] = set([j])
 *         try:             # <<<<<<<<<<<<<<
 *             self._col_support[j].add(i)
 *         except KeyError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "cython/core/abelian_group.pyx":201
 *             self._row_support[i] = set([j])
 *         try:
 *             self._col_support[j].add(i)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             self._col_support[j] = set([i])
*/
      if (unlikely(__pyx_v_self->_col_support == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 201, __pyx_L33_error)
      }
      __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_col_support, __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 201, __pyx_L33_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_12 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_i};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 201, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/abelian_group.pyx":200
 *         except KeyError:
 *             self._row_support[i] = set([j])
 *         try:             # <<<<<<<<<<<<<<
 *             self._col_support[j].add(i)
 *         except KeyError:
*/
    }
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L38_try_end;
    __pyx_L33_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/abelian_group.pyx":202
 *         try:
 *             self._col_support[j].add(i)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             self._col_support[j] = set([i])
 *         # set the value
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("SnapPyHP.PresentationMatrix._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(5, 202, __pyx_L35_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);

      /* "cython/core/abelian_group.pyx":203
 *             self._col_support[j].add(i)
 *         except KeyError:
 *             self._col_support[j] = set([i])             # <<<<<<<<<<<<<<
 *         # set the value
 *         self._entries[ij] = value
*/
      __pyx_t_13 = PySet_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 203, __pyx_L35_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (PySet_Add(__pyx_t_13, __pyx_v_i) < 0) __PYX_ERR(5, 203, __pyx_L35_except_error)
      if (unlikely(__pyx_v_self->_col_support == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 203, __pyx_L35_except_error)
      }
      if (unlikely((PyDict_SetItem(__pyx_v_self->_col_support, __pyx_v_j, __pyx_t_13) < 0))) __PYX_ERR(5, 203, __pyx_L35_except_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L34_exception_handled;
    }
    goto __pyx_L35_except_error;

    /* "cython/core/abelian_group.pyx":200
 *         except KeyError:
 *             self._row_support[i] = set([j])
 *         try:             # <<<<<<<<<<<<<<
 *             self._col_support[j].add(i)
 *         except KeyError:
*/
    __pyx_L35_except_error:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L34_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
    __pyx_L38_try_end:;
  }

  /* "cython/core/abelian_group.pyx":205
 *             self._col_support[j] = set([i])
 *         # set the value
 *         self._entries[ij] = value             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, ij):
*/
  if (unlikely(__pyx_v_self->_entries == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(5, 205, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_self->_entries, __pyx_v_ij, __pyx_v_value) < 0))) __PYX_ERR(5, 205, __pyx_L1_error)

  /* "cython/core/abelian_group.pyx":175
 *         self._set(ij, value)
 * 
 *     cdef _set(self, ij, value):             # <<<<<<<<<<<<<<
 *         # cdef'ed to allow for faster calling
 *         i, j = ij
*/

  /* 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_13);
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":207
 *         self._entries[ij] = value
 * 
 *     def __getitem__(self, ij):             # <<<<<<<<<<<<<<
 *         return self._entries.get(ij, 0)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij) {
  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_8SnapPyHP_18PresentationMatrix_6__getitem__(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_ij));

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_6__getitem__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij) {
  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("__getitem__", 0);

  /* "cython/core/abelian_group.pyx":208
 * 
 *     def __getitem__(self, ij):
 *         return self._entries.get(ij, 0)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->_entries == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(5, 208, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_entries, __pyx_v_ij, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":207
 *         self._entries[ij] = value
 * 
 *     def __getitem__(self, ij):             # <<<<<<<<<<<<<<
 *         return self._entries.get(ij, 0)
 * 
*/

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

/* "cython/core/abelian_group.pyx":210
 *         return self._entries.get(ij, 0)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.explode())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_9__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_8SnapPyHP_18PresentationMatrix_8__repr__(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_8__repr__(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/abelian_group.pyx":211
 * 
 *     def __repr__(self):
 *         return repr(self.explode())             # <<<<<<<<<<<<<<
 * 
 *     def add_rows(self, n):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_explode, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 211, __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;

  /* "cython/core/abelian_group.pyx":210
 *         return self._entries.get(ij, 0)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.explode())
 * 
*/

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

/* "cython/core/abelian_group.pyx":213
 *         return repr(self.explode())
 * 
 *     def add_rows(self, n):             # <<<<<<<<<<<<<<
 *         self.rows += n
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_11add_rows(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_11add_rows = {"add_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_11add_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_11add_rows(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_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("add_rows (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 213, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 213, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_rows", 0) < 0) __PYX_ERR(5, 213, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_rows", 1, 1, 1, i); __PYX_ERR(5, 213, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 213, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_rows", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 213, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.add_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_10add_rows(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self), __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_10add_rows(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_n) {
  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("add_rows", 0);

  /* "cython/core/abelian_group.pyx":214
 * 
 *     def add_rows(self, n):
 *         self.rows += n             # <<<<<<<<<<<<<<
 * 
 *     def row_op(self, i, j, m):
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->rows = __pyx_t_3;

  /* "cython/core/abelian_group.pyx":213
 *         return repr(self.explode())
 * 
 *     def add_rows(self, n):             # <<<<<<<<<<<<<<
 *         self.rows += n
 * 
*/

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

/* "cython/core/abelian_group.pyx":216
 *         self.rows += n
 * 
 *     def row_op(self, i, j, m):             # <<<<<<<<<<<<<<
 *         """
 *         Subtract m * row_i from row_j
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_13row_op(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_8SnapPyHP_18PresentationMatrix_12row_op, "\n        Subtract m * row_i from row_j\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_13row_op = {"row_op", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_13row_op, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_12row_op};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_13row_op(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_i = 0;
  PyObject *__pyx_v_j = 0;
  PyObject *__pyx_v_m = 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("row_op (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i,&__pyx_mstate_global->__pyx_n_u_j,&__pyx_mstate_global->__pyx_n_u_m,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 216, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "row_op", 0) < 0) __PYX_ERR(5, 216, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("row_op", 1, 3, 3, i); __PYX_ERR(5, 216, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 216, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 216, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 216, __pyx_L3_error)
    }
    __pyx_v_i = values[0];
    __pyx_v_j = values[1];
    __pyx_v_m = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("row_op", 1, 3, 3, __pyx_nargs); __PYX_ERR(5, 216, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.row_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_12row_op(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self), __pyx_v_i, __pyx_v_j, __pyx_v_m);

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_12row_op(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j, PyObject *__pyx_v_m) {
  PyObject *__pyx_v_k = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("row_op", 0);

  /* "cython/core/abelian_group.pyx":220
 *         Subtract m * row_i from row_j
 *         """
 *         for k in list(self._row_support[i]):             # <<<<<<<<<<<<<<
 *             self[j,k] -= m*self[i,k]
 * 
*/
  if (unlikely(__pyx_v_self->_row_support == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(5, 220, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_row_support, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 220, __pyx_L1_error)
      #endif
      if (__pyx_t_3 >= __pyx_temp) break;
    }
    __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3);
    ++__pyx_t_3;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":221
 *         """
 *         for k in list(self._row_support[i]):
 *             self[j,k] -= m*self[i,k]             # <<<<<<<<<<<<<<
 * 
 *     def explode(self):
*/
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_j);
    __Pyx_GIVEREF(__pyx_v_j);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_j) != (0)) __PYX_ERR(5, 221, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_k);
    __Pyx_GIVEREF(__pyx_v_k);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_k) != (0)) __PYX_ERR(5, 221, __pyx_L1_error);
    __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_i) != (0)) __PYX_ERR(5, 221, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_k);
    __Pyx_GIVEREF(__pyx_v_k);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_k) != (0)) __PYX_ERR(5, 221, __pyx_L1_error);
    __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Multiply(__pyx_v_m, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 221, __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((PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_2, __pyx_t_6) < 0))) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":220
 *         Subtract m * row_i from row_j
 *         """
 *         for k in list(self._row_support[i]):             # <<<<<<<<<<<<<<
 *             self[j,k] -= m*self[i,k]
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":216
 *         self.rows += n
 * 
 *     def row_op(self, i, j, m):             # <<<<<<<<<<<<<<
 *         """
 *         Subtract m * row_i from row_j
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.row_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":223
 *             self[j,k] -= m*self[i,k]
 * 
 *     def explode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the full matrix, including dead columns, as a list of lists.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_15explode(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_8SnapPyHP_18PresentationMatrix_14explode, "\n        Return the full matrix, including dead columns, as a list of lists.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_15explode = {"explode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_15explode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_14explode};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_15explode(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("explode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("explode", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("explode", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_14explode(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_14explode(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self) {
  PyObject *__pyx_9genexpr62__pyx_v_i = NULL;
  int __pyx_9genexpr63__pyx_v_j;
  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;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("explode", 0);

  /* "cython/core/abelian_group.pyx":227
 *         Return the full matrix, including dead columns, as a list of lists.
 *         """
 *         return [[self._entries.get((i, j), 0) for j in range(self.cols)]             # <<<<<<<<<<<<<<
 *                 for i in range(self.rows)]
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 227, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/abelian_group.pyx":228
 *         """
 *         return [[self._entries.get((i, j), 0) for j in range(self.cols)]
 *                 for i in range(self.rows)]             # <<<<<<<<<<<<<<
 * 
 *     def simplify(self):
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_4 = __pyx_builtin_range; 
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->rows); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 228, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 228, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 228, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 228, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 228, __pyx_L5_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 228, __pyx_L5_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 228, __pyx_L5_error)
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 228, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_9genexpr62__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;
      { /* enter inner scope */

        /* "cython/core/abelian_group.pyx":227
 *         Return the full matrix, including dead columns, as a list of lists.
 *         """
 *         return [[self._entries.get((i, j), 0) for j in range(self.cols)]             # <<<<<<<<<<<<<<
 *                 for i in range(self.rows)]
 * 
*/
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 227, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __pyx_v_self->cols;
        __pyx_t_10 = __pyx_t_9;
        for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
          __pyx_9genexpr63__pyx_v_j = __pyx_t_11;
          if (unlikely(__pyx_v_self->_entries == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
            __PYX_ERR(5, 227, __pyx_L5_error)
          }
          __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_9genexpr63__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 227, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 227, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_9genexpr62__pyx_v_i);
          __Pyx_GIVEREF(__pyx_9genexpr62__pyx_v_i);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr62__pyx_v_i) != (0)) __PYX_ERR(5, 227, __pyx_L5_error);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(5, 227, __pyx_L5_error);
          __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_entries, __pyx_t_3, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 227, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 227, __pyx_L5_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(5, 227, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/abelian_group.pyx":228
 *         """
 *         return [[self._entries.get((i, j), 0) for j in range(self.cols)]
 *                 for i in range(self.rows)]             # <<<<<<<<<<<<<<
 * 
 *     def simplify(self):
*/
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i); __pyx_9genexpr62__pyx_v_i = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i); __pyx_9genexpr62__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":223
 *             self[j,k] -= m*self[i,k]
 * 
 *     def explode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the full matrix, including dead columns, as a list of lists.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.explode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":230
 *                 for i in range(self.rows)]
 * 
 *     def simplify(self):             # <<<<<<<<<<<<<<
 *         """
 *         If any entry is a unit, eliminate the corresponding generator.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_17simplify(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_8SnapPyHP_18PresentationMatrix_16simplify, "\n        If any entry is a unit, eliminate the corresponding generator.\n        Continue until no units remain.  When a generator is removed,\n        remember its column index.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_17simplify = {"simplify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_17simplify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_16simplify};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_17simplify(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("simplify (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("simplify", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("simplify", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_16simplify(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_16simplify(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  int __pyx_v_l;
  PyObject *__pyx_v_col_support = NULL;
  PyObject *__pyx_v_row_entries = NULL;
  PyObject *__pyx_v_unit = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_a_il = NULL;
  PyObject *__pyx_v_kl = NULL;
  PyObject *__pyx_v_temp = NULL;
  int __pyx_9genexpr64__pyx_v_k;
  int __pyx_9genexpr65__pyx_v_l;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simplify", 0);

  /* "cython/core/abelian_group.pyx":236
 *         remember its column index.
 *         """
 *         cdef int i = 0, j = 0, k, l             # <<<<<<<<<<<<<<
 *         while len(self._units) > 0:
 *             for i, j in self._units:
*/
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "cython/core/abelian_group.pyx":237
 *         """
 *         cdef int i = 0, j = 0, k, l
 *         while len(self._units) > 0:             # <<<<<<<<<<<<<<
 *             for i, j in self._units:
 *                 break
*/
  while (1) {
    __pyx_t_1 = __pyx_v_self->_units;
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_t_1 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(5, 237, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 237, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_2 > 0);
    if (!__pyx_t_3) break;

    /* "cython/core/abelian_group.pyx":238
 *         cdef int i = 0, j = 0, k, l
 *         while len(self._units) > 0:
 *             for i, j in self._units:             # <<<<<<<<<<<<<<
 *                 break
 *             col_support = [k for k in self._col_support[j] if k != i] + [i]
*/
    __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_set_iterator(__pyx_v_self->_units, 1, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_6;
    __pyx_t_6 = 0;
    while (1) {
      __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_2, &__pyx_t_6, __pyx_t_5);
      if (unlikely(__pyx_t_7 == 0)) break;
      if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        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(5, 238, __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_INCREF(__pyx_t_8);
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_9);
        } else {
          __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 238, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 238, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_9);
        }
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(5, 238, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(5, 238, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_i = __pyx_t_7;
      __pyx_v_j = __pyx_t_12;

      /* "cython/core/abelian_group.pyx":239
 *         while len(self._units) > 0:
 *             for i, j in self._units:
 *                 break             # <<<<<<<<<<<<<<
 *             col_support = [k for k in self._col_support[j] if k != i] + [i]
 *             row_entries = [(l, self._entries.get((i,l), 0))
*/
      goto __pyx_L6_break;
    }
    __pyx_L6_break:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/abelian_group.pyx":240
 *             for i, j in self._units:
 *                 break
 *             col_support = [k for k in self._col_support[j] if k != i] + [i]             # <<<<<<<<<<<<<<
 *             row_entries = [(l, self._entries.get((i,l), 0))
 *                            for l in self._row_support[i]]
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_self->_col_support == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 240, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->_col_support, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
        __pyx_t_6 = __pyx_t_9; __Pyx_INCREF(__pyx_t_6);
        __pyx_t_4 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 240, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 240, __pyx_L1_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_4);
            ++__pyx_t_4;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 240, __pyx_L1_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4));
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4);
            #endif
            ++__pyx_t_4;
          }
          if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 240, __pyx_L1_error)
        } else {
          __pyx_t_9 = __pyx_t_13(__pyx_t_6);
          if (unlikely(!__pyx_t_9)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 240, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_9); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 240, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_9genexpr64__pyx_v_k = __pyx_t_5;
        __pyx_t_3 = (__pyx_9genexpr64__pyx_v_k != __pyx_v_i);
        if (__pyx_t_3) {
          __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_9genexpr64__pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 240, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(5, 240, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } /* exit inner scope */
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(5, 240, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_col_support, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "cython/core/abelian_group.pyx":241
 *                 break
 *             col_support = [k for k in self._col_support[j] if k != i] + [i]
 *             row_entries = [(l, self._entries.get((i,l), 0))             # <<<<<<<<<<<<<<
 *                            for l in self._row_support[i]]
 *             unit = self[i,j]
*/
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 241, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/abelian_group.pyx":242
 *             col_support = [k for k in self._col_support[j] if k != i] + [i]
 *             row_entries = [(l, self._entries.get((i,l), 0))
 *                            for l in self._row_support[i]]             # <<<<<<<<<<<<<<
 *             unit = self[i,j]
 *             for k in col_support:
*/
      if (unlikely(__pyx_v_self->_row_support == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 242, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_row_support, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
        __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9);
        __pyx_t_4 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_4 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 242, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 242, __pyx_L1_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4);
            ++__pyx_t_4;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 242, __pyx_L1_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_4));
            #else
            __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_4);
            #endif
            ++__pyx_t_4;
          }
          if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 242, __pyx_L1_error)
        } else {
          __pyx_t_1 = __pyx_t_13(__pyx_t_9);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 242, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 242, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_9genexpr65__pyx_v_l = __pyx_t_5;

        /* "cython/core/abelian_group.pyx":241
 *                 break
 *             col_support = [k for k in self._col_support[j] if k != i] + [i]
 *             row_entries = [(l, self._entries.get((i,l), 0))             # <<<<<<<<<<<<<<
 *                            for l in self._row_support[i]]
 *             unit = self[i,j]
*/
        __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_9genexpr65__pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__pyx_v_self->_entries == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
          __PYX_ERR(5, 241, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_9genexpr65__pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_8);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8) != (0)) __PYX_ERR(5, 241, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_10);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_10) != (0)) __PYX_ERR(5, 241, __pyx_L1_error);
        __pyx_t_8 = 0;
        __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_entries, __pyx_t_14, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_1);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1) != (0)) __PYX_ERR(5, 241, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_10);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_10) != (0)) __PYX_ERR(5, 241, __pyx_L1_error);
        __pyx_t_1 = 0;
        __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_14))) __PYX_ERR(5, 241, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "cython/core/abelian_group.pyx":242
 *             col_support = [k for k in self._col_support[j] if k != i] + [i]
 *             row_entries = [(l, self._entries.get((i,l), 0))
 *                            for l in self._row_support[i]]             # <<<<<<<<<<<<<<
 *             unit = self[i,j]
 *             for k in col_support:
*/
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } /* exit inner scope */
    __Pyx_XDECREF_SET(__pyx_v_row_entries, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "cython/core/abelian_group.pyx":243
 *             row_entries = [(l, self._entries.get((i,l), 0))
 *                            for l in self._row_support[i]]
 *             unit = self[i,j]             # <<<<<<<<<<<<<<
 *             for k in col_support:
 *                 m = unit*self[k,j]
*/
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6) != (0)) __PYX_ERR(5, 243, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9) != (0)) __PYX_ERR(5, 243, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_unit, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "cython/core/abelian_group.pyx":244
 *                            for l in self._row_support[i]]
 *             unit = self[i,j]
 *             for k in col_support:             # <<<<<<<<<<<<<<
 *                 m = unit*self[k,j]
 *                 # this is an "inlined" call to self.row_op(k,i,m)
*/
    __pyx_t_9 = __pyx_v_col_support; __Pyx_INCREF(__pyx_t_9);
    __pyx_t_4 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 244, __pyx_L1_error)
        #endif
        if (__pyx_t_4 >= __pyx_temp) break;
      }
      __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4);
      ++__pyx_t_4;
      if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_14); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 244, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_v_k = __pyx_t_5;

      /* "cython/core/abelian_group.pyx":245
 *             unit = self[i,j]
 *             for k in col_support:
 *                 m = unit*self[k,j]             # <<<<<<<<<<<<<<
 *                 # this is an "inlined" call to self.row_op(k,i,m)
 *                 # (avoids calling python functions in the loop)
*/
      __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_14) != (0)) __PYX_ERR(5, 245, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6) != (0)) __PYX_ERR(5, 245, __pyx_L1_error);
      __pyx_t_14 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_Multiply(__pyx_v_unit, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "cython/core/abelian_group.pyx":248
 *                 # this is an "inlined" call to self.row_op(k,i,m)
 *                 # (avoids calling python functions in the loop)
 *                 for l, a_il in row_entries:             # <<<<<<<<<<<<<<
 *                     kl = (k,l)
 *                     temp = self._entries.get(kl, 0)
*/
      __pyx_t_10 = __pyx_v_row_entries; __Pyx_INCREF(__pyx_t_10);
      __pyx_t_2 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 248, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_2);
        ++__pyx_t_2;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
          PyObject* sequence = __pyx_t_6;
          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(5, 248, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_14);
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_1);
          } else {
            __pyx_t_14 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 248, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_14);
            __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 248, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_1);
          }
          #else
          __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
          index = 0; __pyx_t_14 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_14)) goto __pyx_L20_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_14);
          index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L20_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_1);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L21_unpacking_done;
          __pyx_L20_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(5, 248, __pyx_L1_error)
          __pyx_L21_unpacking_done:;
        }
        __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_14); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 248, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_v_l = __pyx_t_5;
        __Pyx_XDECREF_SET(__pyx_v_a_il, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "cython/core/abelian_group.pyx":249
 *                 # (avoids calling python functions in the loop)
 *                 for l, a_il in row_entries:
 *                     kl = (k,l)             # <<<<<<<<<<<<<<
 *                     temp = self._entries.get(kl, 0)
 *                     self._set(kl, temp - m*a_il )
*/
        __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_6);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6) != (0)) __PYX_ERR(5, 249, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_1);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1) != (0)) __PYX_ERR(5, 249, __pyx_L1_error);
        __pyx_t_6 = 0;
        __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_kl, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "cython/core/abelian_group.pyx":250
 *                 for l, a_il in row_entries:
 *                     kl = (k,l)
 *                     temp = self._entries.get(kl, 0)             # <<<<<<<<<<<<<<
 *                     self._set(kl, temp - m*a_il )
 *             self.dead_columns.add(j)
*/
        if (unlikely(__pyx_v_self->_entries == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
          __PYX_ERR(5, 250, __pyx_L1_error)
        }
        __pyx_t_14 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_entries, __pyx_v_kl, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 250, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_XDECREF_SET(__pyx_v_temp, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "cython/core/abelian_group.pyx":251
 *                     kl = (k,l)
 *                     temp = self._entries.get(kl, 0)
 *                     self._set(kl, temp - m*a_il )             # <<<<<<<<<<<<<<
 *             self.dead_columns.add(j)
 * 
*/
        __pyx_t_14 = PyNumber_Multiply(__pyx_v_m, __pyx_v_a_il); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = PyNumber_Subtract(__pyx_v_temp, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = ((struct __pyx_vtabstruct_8SnapPyHP_PresentationMatrix *)__pyx_v_self->__pyx_vtab)->_set(__pyx_v_self, __pyx_v_kl, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "cython/core/abelian_group.pyx":248
 *                 # this is an "inlined" call to self.row_op(k,i,m)
 *                 # (avoids calling python functions in the loop)
 *                 for l, a_il in row_entries:             # <<<<<<<<<<<<<<
 *                     kl = (k,l)
 *                     temp = self._entries.get(kl, 0)
*/
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cython/core/abelian_group.pyx":244
 *                            for l in self._row_support[i]]
 *             unit = self[i,j]
 *             for k in col_support:             # <<<<<<<<<<<<<<
 *                 m = unit*self[k,j]
 *                 # this is an "inlined" call to self.row_op(k,i,m)
*/
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/abelian_group.pyx":252
 *                     temp = self._entries.get(kl, 0)
 *                     self._set(kl, temp - m*a_il )
 *             self.dead_columns.add(j)             # <<<<<<<<<<<<<<
 * 
 *     def simplified_matrix(self):
*/
    if (unlikely(__pyx_v_self->dead_columns == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
      __PYX_ERR(5, 252, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_15 = PySet_Add(__pyx_v_self->dead_columns, __pyx_t_9); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(5, 252, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }

  /* "cython/core/abelian_group.pyx":230
 *                 for i in range(self.rows)]
 * 
 *     def simplify(self):             # <<<<<<<<<<<<<<
 *         """
 *         If any entry is a unit, eliminate the corresponding generator.
*/

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.simplify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_col_support);
  __Pyx_XDECREF(__pyx_v_row_entries);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_a_il);
  __Pyx_XDECREF(__pyx_v_kl);
  __Pyx_XDECREF(__pyx_v_temp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":254
 *             self.dead_columns.add(j)
 * 
 *     def simplified_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the simplified presentation as a matrix.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_19simplified_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_8SnapPyHP_18PresentationMatrix_18simplified_matrix, "\n        Return the simplified presentation as a matrix.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_19simplified_matrix = {"simplified_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_19simplified_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_18simplified_matrix};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_19simplified_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("simplified_matrix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("simplified_matrix", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("simplified_matrix", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_18simplified_matrix(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_18PresentationMatrix_18simplified_matrix(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v_self) {
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_presentation = NULL;
  int __pyx_9genexpr66__pyx_v_j;
  PyObject *__pyx_9genexpr67__pyx_v_i = NULL;
  CYTHON_UNUSED PyObject *__pyx_9genexpr68__pyx_v_j = NULL;
  PyObject *__pyx_9genexpr69__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr70__pyx_v_j = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simplified_matrix", 0);

  /* "cython/core/abelian_group.pyx":258
 *         Return the simplified presentation as a matrix.
 *         """
 *         self.simplify()             # <<<<<<<<<<<<<<
 *         columns = [j for j in range(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in range(self.rows) if self._row_support.get(i, None)]
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_simplify, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":259
 *         """
 *         self.simplify()
 *         columns = [j for j in range(self.cols) if j not in self.dead_columns]             # <<<<<<<<<<<<<<
 *         rows = [i for i in range(self.rows) if self._row_support.get(i, None)]
 *         if not rows:
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_v_self->cols;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_9genexpr66__pyx_v_j = __pyx_t_6;
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_9genexpr66__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__pyx_v_self->dead_columns == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(5, 259, __pyx_L1_error)
      }
      __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_self->dead_columns, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 259, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_7) {
        __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_9genexpr66__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(5, 259, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
    }
  } /* exit inner scope */
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":260
 *         self.simplify()
 *         columns = [j for j in range(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in range(self.rows) if self._row_support.get(i, None)]             # <<<<<<<<<<<<<<
 *         if not rows:
 *             presentation = [[0 for j in columns]]
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 260, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_9 = __pyx_builtin_range; 
    __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_self->rows); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 260, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 260, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_9 = __pyx_t_2; __Pyx_INCREF(__pyx_t_9);
      __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 260, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 260, __pyx_L8_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 260, __pyx_L8_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_11);
          ++__pyx_t_11;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 260, __pyx_L8_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_11);
          #endif
          ++__pyx_t_11;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 260, __pyx_L8_error)
      } else {
        __pyx_t_2 = __pyx_t_12(__pyx_t_9);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 260, __pyx_L8_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_9genexpr67__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;
      if (unlikely(__pyx_v_self->_row_support == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(5, 260, __pyx_L8_error)
      }
      __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_row_support, __pyx_9genexpr67__pyx_v_i, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 260, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 260, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_7) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr67__pyx_v_i))) __PYX_ERR(5, 260, __pyx_L8_error)
      }
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_i); __pyx_9genexpr67__pyx_v_i = 0;
    goto __pyx_L13_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_i); __pyx_9genexpr67__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L13_exit_scope:;
  } /* exit inner scope */
  __pyx_v_rows = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":261
 *         columns = [j for j in range(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in range(self.rows) if self._row_support.get(i, None)]
 *         if not rows:             # <<<<<<<<<<<<<<
 *             presentation = [[0 for j in columns]]
 *         else:
*/
  __pyx_t_7 = (__Pyx_PyList_GET_SIZE(__pyx_v_rows) != 0);
  if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_7 < 0))) __PYX_ERR(5, 261, __pyx_L1_error)
  __pyx_t_13 = (!__pyx_t_7);
  if (__pyx_t_13) {

    /* "cython/core/abelian_group.pyx":262
 *         rows = [i for i in range(self.rows) if self._row_support.get(i, None)]
 *         if not rows:
 *             presentation = [[0 for j in columns]]             # <<<<<<<<<<<<<<
 *         else:
 *             presentation = [[self._entries.get((i, j), 0) for j in columns]
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 262, __pyx_L17_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_9);
      __pyx_t_11 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 262, __pyx_L17_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_11);
        ++__pyx_t_11;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_9genexpr68__pyx_v_j, __pyx_t_2);
        __pyx_t_2 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_mstate_global->__pyx_int_0))) __PYX_ERR(5, 262, __pyx_L17_error)
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_j); __pyx_9genexpr68__pyx_v_j = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L17_error:;
      __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_j); __pyx_9genexpr68__pyx_v_j = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(5, 262, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_v_presentation = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "cython/core/abelian_group.pyx":261
 *         columns = [j for j in range(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in range(self.rows) if self._row_support.get(i, None)]
 *         if not rows:             # <<<<<<<<<<<<<<
 *             presentation = [[0 for j in columns]]
 *         else:
*/
    goto __pyx_L14;
  }

  /* "cython/core/abelian_group.pyx":264
 *             presentation = [[0 for j in columns]]
 *         else:
 *             presentation = [[self._entries.get((i, j), 0) for j in columns]             # <<<<<<<<<<<<<<
 *                             for i in rows ]
 *         return matrix(presentation)
*/
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 264, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_9);

      /* "cython/core/abelian_group.pyx":265
 *         else:
 *             presentation = [[self._entries.get((i, j), 0) for j in columns]
 *                             for i in rows ]             # <<<<<<<<<<<<<<
 *         return matrix(presentation)
*/
      __pyx_t_1 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_11 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 265, __pyx_L24_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_11);
        ++__pyx_t_11;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 265, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_9genexpr69__pyx_v_i, __pyx_t_2);
        __pyx_t_2 = 0;
        { /* enter inner scope */

          /* "cython/core/abelian_group.pyx":264
 *             presentation = [[0 for j in columns]]
 *         else:
 *             presentation = [[self._entries.get((i, j), 0) for j in columns]             # <<<<<<<<<<<<<<
 *                             for i in rows ]
 *         return matrix(presentation)
*/
          __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 264, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_10);
          __pyx_t_14 = 0;
          for (;;) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 264, __pyx_L29_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_14);
            ++__pyx_t_14;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 264, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_XDECREF_SET(__pyx_9genexpr70__pyx_v_j, __pyx_t_8);
            __pyx_t_8 = 0;
            if (unlikely(__pyx_v_self->_entries == Py_None)) {
              PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
              __PYX_ERR(5, 264, __pyx_L29_error)
            }
            __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 264, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_INCREF(__pyx_9genexpr69__pyx_v_i);
            __Pyx_GIVEREF(__pyx_9genexpr69__pyx_v_i);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr69__pyx_v_i) != (0)) __PYX_ERR(5, 264, __pyx_L29_error);
            __Pyx_INCREF(__pyx_9genexpr70__pyx_v_j);
            __Pyx_GIVEREF(__pyx_9genexpr70__pyx_v_j);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_9genexpr70__pyx_v_j) != (0)) __PYX_ERR(5, 264, __pyx_L29_error);
            __pyx_t_15 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_entries, __pyx_t_8, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 264, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_15))) __PYX_ERR(5, 264, __pyx_L29_error)
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_j); __pyx_9genexpr70__pyx_v_j = 0;
          goto __pyx_L33_exit_scope;
          __pyx_L29_error:;
          __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_j); __pyx_9genexpr70__pyx_v_j = 0;
          goto __pyx_L24_error;
          __pyx_L33_exit_scope:;
        } /* exit inner scope */
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_2))) __PYX_ERR(5, 264, __pyx_L24_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":265
 *         else:
 *             presentation = [[self._entries.get((i, j), 0) for j in columns]
 *                             for i in rows ]             # <<<<<<<<<<<<<<
 *         return matrix(presentation)
*/
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_i); __pyx_9genexpr69__pyx_v_i = 0;
      goto __pyx_L35_exit_scope;
      __pyx_L24_error:;
      __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_i); __pyx_9genexpr69__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L35_exit_scope:;
    } /* exit inner scope */
    __pyx_v_presentation = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;
  }
  __pyx_L14:;

  /* "cython/core/abelian_group.pyx":266
 *             presentation = [[self._entries.get((i, j), 0) for j in columns]
 *                             for i in rows ]
 *         return matrix(presentation)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_presentation};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":254
 *             self.dead_columns.add(j)
 * 
 *     def simplified_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the simplified presentation as a matrix.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.simplified_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_presentation);
  __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_j);
  __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_21__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_21__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_20__reduce_cython__(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self));

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

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

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._col_support, self._entries, self._row_support, self._units, self.cols, self.dead_columns, self.rows)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->_col_support);
  __Pyx_GIVEREF(__pyx_v_self->_col_support);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_col_support) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_entries);
  __Pyx_GIVEREF(__pyx_v_self->_entries);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->_entries) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_row_support);
  __Pyx_GIVEREF(__pyx_v_self->_row_support);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->_row_support) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_units);
  __Pyx_GIVEREF(__pyx_v_self->_units);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->_units) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->dead_columns);
  __Pyx_GIVEREF(__pyx_v_self->dead_columns);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_self->dead_columns) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_2) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._col_support, self._entries, self._row_support, self._units, self.cols, self.dead_columns, self.rows)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
*/
  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v__dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":7
 *     state = (self._col_support, self._entries, self._row_support, self._units, self.cols, self.dead_columns, self.rows)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_4 = (__pyx_v__dict != Py_None);
  if (__pyx_t_4) {

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

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._col_support is not None or self._entries is not None or self._row_support is not None or self._units is not None or self.dead_columns is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._col_support, self._entries, self._row_support, self._units, self.cols, self.dead_columns, self.rows)
 *     _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._col_support is not None or self._entries is not None or self._row_support is not None or self._units is not None or self.dead_columns is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, None), state
*/
  /*else*/ {
    __pyx_t_5 = (__pyx_v_self->_col_support != ((PyObject*)Py_None));
    if (!__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_entries != ((PyObject*)Py_None));
    if (!__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_row_support != ((PyObject*)Py_None));
    if (!__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_units != ((PyObject*)Py_None));
    if (!__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->dead_columns != ((PyObject*)Py_None));
    __pyx_t_4 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_4;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._col_support is not None or self._entries is not None or self._row_support is not None or self._units is not None or self.dead_columns is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._col_support is not None or self._entries is not None or self._row_support is not None or self._units is not None or self.dead_columns is not None
 *     if use_setstate:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_PresentationMatri); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_94173347);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_94173347);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_94173347) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._col_support is not None or self._entries is not None or self._row_support is not None or self._units is not None or self.dead_columns is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, None), state
 *     else:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_PresentationMatrix__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_PresentationMatri); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_94173347);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_94173347);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_94173347) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.__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_PresentationMatrix, (type(self), 0x59cf8a3, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_PresentationMatrix__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_23__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_18PresentationMatrix_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_18PresentationMatrix_23__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(7, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(7, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.PresentationMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_18PresentationMatrix_22__setstate_cython__(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_PresentationMatrix__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(7, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8SnapPyHP___pyx_unpickle_PresentationMatrix__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 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_PresentationMatrix, (type(self), 0x59cf8a3, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_PresentationMatrix__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("SnapPyHP.PresentationMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":9
 * 
 * 
 * def inverse_list_word(word):             # <<<<<<<<<<<<<<
 *     return [ -x for x in word[::-1] ]
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_35inverse_list_word(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_8SnapPyHP_35inverse_list_word = {"inverse_list_word", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_35inverse_list_word, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_35inverse_list_word(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_word = 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("inverse_list_word (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 9, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "inverse_list_word", 0) < 0) __PYX_ERR(8, 9, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("inverse_list_word", 1, 1, 1, i); __PYX_ERR(8, 9, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 9, __pyx_L3_error)
    }
    __pyx_v_word = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inverse_list_word", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 9, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.inverse_list_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_34inverse_list_word(__pyx_self, __pyx_v_word);

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

static PyObject *__pyx_pf_8SnapPyHP_34inverse_list_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_9genexpr71__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inverse_list_word", 0);

  /* "cython/core/fundamental_group.pyx":10
 * 
 * def inverse_list_word(word):
 *     return [ -x for x in word[::-1] ]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 10, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_word, __pyx_mstate_global->__pyx_slice[4]); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 10, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 10, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 10, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 10, __pyx_L5_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_4);
          ++__pyx_t_4;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 10, __pyx_L5_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4);
          #endif
          ++__pyx_t_4;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 10, __pyx_L5_error)
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 10, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_9genexpr71__pyx_v_x, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Negative(__pyx_9genexpr71__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 10, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(8, 10, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr71__pyx_v_x); __pyx_9genexpr71__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr71__pyx_v_x); __pyx_9genexpr71__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":9
 * 
 * 
 * def inverse_list_word(word):             # <<<<<<<<<<<<<<
 *     return [ -x for x in word[::-1] ]
 * 
*/

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

/* "cython/core/fundamental_group.pyx":13
 * 
 * 
 * def reduce_list_word(word):             # <<<<<<<<<<<<<<
 *     """
 *     Cancels inverse generators.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_37reduce_list_word(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_8SnapPyHP_36reduce_list_word, "\n    Cancels inverse generators.\n    ");
static PyMethodDef __pyx_mdef_8SnapPyHP_37reduce_list_word = {"reduce_list_word", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_37reduce_list_word, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_36reduce_list_word};
static PyObject *__pyx_pw_8SnapPyHP_37reduce_list_word(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_word = 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("reduce_list_word (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 13, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reduce_list_word", 0) < 0) __PYX_ERR(8, 13, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reduce_list_word", 1, 1, 1, i); __PYX_ERR(8, 13, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 13, __pyx_L3_error)
    }
    __pyx_v_word = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reduce_list_word", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 13, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.reduce_list_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_36reduce_list_word(__pyx_self, __pyx_v_word);

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

static PyObject *__pyx_pf_8SnapPyHP_36reduce_list_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_letter = 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;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reduce_list_word", 0);

  /* "cython/core/fundamental_group.pyx":17
 *     Cancels inverse generators.
 *     """
 *     result = []             # <<<<<<<<<<<<<<
 *     for letter in word:
 *         if result and result[-1] == -letter:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":18
 *     """
 *     result = []
 *     for letter in word:             # <<<<<<<<<<<<<<
 *         if result and result[-1] == -letter:
 *             result.pop()
*/
  if (likely(PyList_CheckExact(__pyx_v_word)) || PyTuple_CheckExact(__pyx_v_word)) {
    __pyx_t_1 = __pyx_v_word; __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_word); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 18, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 18, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 18, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 18, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 18, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_letter, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/fundamental_group.pyx":19
 *     result = []
 *     for letter in word:
 *         if result and result[-1] == -letter:             # <<<<<<<<<<<<<<
 *             result.pop()
 *         else:
*/
    __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_result) != 0);
    if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(8, 19, __pyx_L1_error)
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_result, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyNumber_Negative(__pyx_v_letter); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 19, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(8, 19, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = __pyx_t_6;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_5) {

      /* "cython/core/fundamental_group.pyx":20
 *     for letter in word:
 *         if result and result[-1] == -letter:
 *             result.pop()             # <<<<<<<<<<<<<<
 *         else:
 *             result.append(letter)
*/
      __pyx_t_8 = __Pyx_PyList_Pop(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 20, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/fundamental_group.pyx":19
 *     result = []
 *     for letter in word:
 *         if result and result[-1] == -letter:             # <<<<<<<<<<<<<<
 *             result.pop()
 *         else:
*/
      goto __pyx_L5;
    }

    /* "cython/core/fundamental_group.pyx":22
 *             result.pop()
 *         else:
 *             result.append(letter)             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
    /*else*/ {
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_letter); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(8, 22, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "cython/core/fundamental_group.pyx":18
 *     """
 *     result = []
 *     for letter in word:             # <<<<<<<<<<<<<<
 *         if result and result[-1] == -letter:
 *             result.pop()
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":23
 *         else:
 *             result.append(letter)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":13
 * 
 * 
 * def reduce_list_word(word):             # <<<<<<<<<<<<<<
 *     """
 *     Cancels inverse generators.
*/

  /* 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_AddTraceback("SnapPyHP.reduce_list_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_letter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":26
 * 
 * 
 * cdef c_word_as_int_list(int *word):             # <<<<<<<<<<<<<<
 *     cdef int n = 0
 *     word_list = []
*/

static PyObject *__pyx_f_8SnapPyHP_c_word_as_int_list(int *__pyx_v_word) {
  int __pyx_v_n;
  PyObject *__pyx_v_word_list = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_word_as_int_list", 0);

  /* "cython/core/fundamental_group.pyx":27
 * 
 * cdef c_word_as_int_list(int *word):
 *     cdef int n = 0             # <<<<<<<<<<<<<<
 *     word_list = []
 *     while word[n] != 0:
*/
  __pyx_v_n = 0;

  /* "cython/core/fundamental_group.pyx":28
 * cdef c_word_as_int_list(int *word):
 *     cdef int n = 0
 *     word_list = []             # <<<<<<<<<<<<<<
 *     while word[n] != 0:
 *         word_list.append(word[n])
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_word_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":29
 *     cdef int n = 0
 *     word_list = []
 *     while word[n] != 0:             # <<<<<<<<<<<<<<
 *         word_list.append(word[n])
 *         n += 1
*/
  while (1) {
    __pyx_t_2 = ((__pyx_v_word[__pyx_v_n]) != 0);
    if (!__pyx_t_2) break;

    /* "cython/core/fundamental_group.pyx":30
 *     word_list = []
 *     while word[n] != 0:
 *         word_list.append(word[n])             # <<<<<<<<<<<<<<
 *         n += 1
 *     return word_list
*/
    __pyx_t_1 = __Pyx_PyLong_From_int((__pyx_v_word[__pyx_v_n])); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 30, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":31
 *     while word[n] != 0:
 *         word_list.append(word[n])
 *         n += 1             # <<<<<<<<<<<<<<
 *     return word_list
 * 
*/
    __pyx_v_n = (__pyx_v_n + 1);
  }

  /* "cython/core/fundamental_group.pyx":32
 *         word_list.append(word[n])
 *         n += 1
 *     return word_list             # <<<<<<<<<<<<<<
 * 
 * cdef int *c_word_from_list(word_list):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_word_list);
  __pyx_r = __pyx_v_word_list;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":26
 * 
 * 
 * cdef c_word_as_int_list(int *word):             # <<<<<<<<<<<<<<
 *     cdef int n = 0
 *     word_list = []
*/

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

/* "cython/core/fundamental_group.pyx":34
 *     return word_list
 * 
 * cdef int *c_word_from_list(word_list):             # <<<<<<<<<<<<<<
 *     cdef int *c_word
 *     cdef int length, size, n
*/

static int *__pyx_f_8SnapPyHP_c_word_from_list(PyObject *__pyx_v_word_list) {
  int *__pyx_v_c_word;
  int __pyx_v_length;
  int __pyx_v_size;
  int __pyx_v_n;
  int *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_word_from_list", 0);

  /* "cython/core/fundamental_group.pyx":37
 *     cdef int *c_word
 *     cdef int length, size, n
 *     length = <int>len(word_list)             # <<<<<<<<<<<<<<
 *     size = sizeof(int)*(1+length)
 *     c_word = <int *>malloc(size)
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_word_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(8, 37, __pyx_L1_error)
  __pyx_v_length = ((int)__pyx_t_1);

  /* "cython/core/fundamental_group.pyx":38
 *     cdef int length, size, n
 *     length = <int>len(word_list)
 *     size = sizeof(int)*(1+length)             # <<<<<<<<<<<<<<
 *     c_word = <int *>malloc(size)
 *     for n from 0 <= n < length:
*/
  __pyx_v_size = ((sizeof(int)) * (1 + __pyx_v_length));

  /* "cython/core/fundamental_group.pyx":39
 *     length = <int>len(word_list)
 *     size = sizeof(int)*(1+length)
 *     c_word = <int *>malloc(size)             # <<<<<<<<<<<<<<
 *     for n from 0 <= n < length:
 *         c_word[n] = word_list[n]
*/
  __pyx_v_c_word = ((int *)malloc(__pyx_v_size));

  /* "cython/core/fundamental_group.pyx":40
 *     size = sizeof(int)*(1+length)
 *     c_word = <int *>malloc(size)
 *     for n from 0 <= n < length:             # <<<<<<<<<<<<<<
 *         c_word[n] = word_list[n]
 *     c_word[length] = 0
*/
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) {

    /* "cython/core/fundamental_group.pyx":41
 *     c_word = <int *>malloc(size)
 *     for n from 0 <= n < length:
 *         c_word[n] = word_list[n]             # <<<<<<<<<<<<<<
 *     c_word[length] = 0
 *     return c_word
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_word_list, __pyx_v_n, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 41, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_c_word[__pyx_v_n]) = __pyx_t_4;
  }

  /* "cython/core/fundamental_group.pyx":42
 *     for n from 0 <= n < length:
 *         c_word[n] = word_list[n]
 *     c_word[length] = 0             # <<<<<<<<<<<<<<
 *     return c_word
 * 
*/
  (__pyx_v_c_word[__pyx_v_length]) = 0;

  /* "cython/core/fundamental_group.pyx":43
 *         c_word[n] = word_list[n]
 *     c_word[length] = 0
 *     return c_word             # <<<<<<<<<<<<<<
 * 
 * cdef int_to_gen_string(int g, int num_generators, verbose_form):
*/
  __pyx_r = __pyx_v_c_word;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":34
 *     return word_list
 * 
 * cdef int *c_word_from_list(word_list):             # <<<<<<<<<<<<<<
 *     cdef int *c_word
 *     cdef int length, size, n
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.c_word_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":45
 *     return c_word
 * 
 * cdef int_to_gen_string(int g, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     if num_generators <=26:
 *         if verbose_form and g < 0:
*/

static PyObject *__pyx_f_8SnapPyHP_int_to_gen_string(int __pyx_v_g, int __pyx_v_num_generators, PyObject *__pyx_v_verbose_form) {
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("int_to_gen_string", 0);

  /* "cython/core/fundamental_group.pyx":46
 * 
 * cdef int_to_gen_string(int g, int num_generators, verbose_form):
 *     if num_generators <=26:             # <<<<<<<<<<<<<<
 *         if verbose_form and g < 0:
 *             return Alphabet[-g] + '^-1'
*/
  __pyx_t_1 = (__pyx_v_num_generators <= 26);
  if (__pyx_t_1) {

    /* "cython/core/fundamental_group.pyx":47
 * cdef int_to_gen_string(int g, int num_generators, verbose_form):
 *     if num_generators <=26:
 *         if verbose_form and g < 0:             # <<<<<<<<<<<<<<
 *             return Alphabet[-g] + '^-1'
 *         else:
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_verbose_form); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 47, __pyx_L1_error)
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_g < 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/fundamental_group.pyx":48
 *     if num_generators <=26:
 *         if verbose_form and g < 0:
 *             return Alphabet[-g] + '^-1'             # <<<<<<<<<<<<<<
 *         else:
 *             return Alphabet[g]
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Alphabet); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = (-__pyx_v_g);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cython/core/fundamental_group.pyx":47
 * cdef int_to_gen_string(int g, int num_generators, verbose_form):
 *     if num_generators <=26:
 *         if verbose_form and g < 0:             # <<<<<<<<<<<<<<
 *             return Alphabet[-g] + '^-1'
 *         else:
*/
    }

    /* "cython/core/fundamental_group.pyx":50
 *             return Alphabet[-g] + '^-1'
 *         else:
 *             return Alphabet[g]             # <<<<<<<<<<<<<<
 *     else:
 *         if verbose_form and g < 0:
*/
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Alphabet); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_g, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "cython/core/fundamental_group.pyx":46
 * 
 * cdef int_to_gen_string(int g, int num_generators, verbose_form):
 *     if num_generators <=26:             # <<<<<<<<<<<<<<
 *         if verbose_form and g < 0:
 *             return Alphabet[-g] + '^-1'
*/
  }

  /* "cython/core/fundamental_group.pyx":52
 *             return Alphabet[g]
 *     else:
 *         if verbose_form and g < 0:             # <<<<<<<<<<<<<<
 *             return 'x%d^-1' % -g
 *         else:
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_verbose_form); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 52, __pyx_L1_error)
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_g < 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/fundamental_group.pyx":53
 *     else:
 *         if verbose_form and g < 0:
 *             return 'x%d^-1' % -g             # <<<<<<<<<<<<<<
 *         else:
 *             ans = 'x' if g > 0 else 'X'
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyLong_From_int((-__pyx_v_g)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_x_d_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cython/core/fundamental_group.pyx":52
 *             return Alphabet[g]
 *     else:
 *         if verbose_form and g < 0:             # <<<<<<<<<<<<<<
 *             return 'x%d^-1' % -g
 *         else:
*/
    }

    /* "cython/core/fundamental_group.pyx":55
 *             return 'x%d^-1' % -g
 *         else:
 *             ans = 'x' if g > 0 else 'X'             # <<<<<<<<<<<<<<
 *             return ans + '%d' % abs(g)
 * 
*/
    /*else*/ {
      __pyx_t_1 = (__pyx_v_g > 0);
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_x);
        __pyx_t_3 = __pyx_mstate_global->__pyx_n_u_x;
      } else {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_X);
        __pyx_t_3 = __pyx_mstate_global->__pyx_n_u_X;
      }
      __pyx_v_ans = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/fundamental_group.pyx":56
 *         else:
 *             ans = 'x' if g > 0 else 'X'
 *             return ans + '%d' % abs(g)             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = abs(__pyx_v_g); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 56, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_d, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_ans, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }
  }

  /* "cython/core/fundamental_group.pyx":45
 *     return c_word
 * 
 * cdef int_to_gen_string(int g, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     if num_generators <=26:
 *         if verbose_form and g < 0:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.int_to_gen_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":59
 * 
 * 
 * def _letter_seperator(verbose_form):             # <<<<<<<<<<<<<<
 *     return '*' if verbose_form else ''
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_39_letter_seperator(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_8SnapPyHP_39_letter_seperator = {"_letter_seperator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_39_letter_seperator, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_39_letter_seperator(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_verbose_form = 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("_letter_seperator (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_verbose_form,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 59, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 59, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_letter_seperator", 0) < 0) __PYX_ERR(8, 59, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_letter_seperator", 1, 1, 1, i); __PYX_ERR(8, 59, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 59, __pyx_L3_error)
    }
    __pyx_v_verbose_form = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_letter_seperator", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 59, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP._letter_seperator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_38_letter_seperator(__pyx_self, __pyx_v_verbose_form);

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

static PyObject *__pyx_pf_8SnapPyHP_38_letter_seperator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_verbose_form) {
  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("_letter_seperator", 0);

  /* "cython/core/fundamental_group.pyx":60
 * 
 * def _letter_seperator(verbose_form):
 *     return '*' if verbose_form else ''             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_verbose_form); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 60, __pyx_L1_error)
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__32);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__32;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__10;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":59
 * 
 * 
 * def _letter_seperator(verbose_form):             # <<<<<<<<<<<<<<
 *     return '*' if verbose_form else ''
 * 
*/

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

/* "cython/core/fundamental_group.pyx":63
 * 
 * 
 * cdef c_word_as_string(int *word, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     cdef int n = 0
 *     word_list = []
*/

static PyObject *__pyx_f_8SnapPyHP_c_word_as_string(int *__pyx_v_word, int __pyx_v_num_generators, PyObject *__pyx_v_verbose_form) {
  int __pyx_v_n;
  PyObject *__pyx_v_word_list = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_word_as_string", 0);

  /* "cython/core/fundamental_group.pyx":64
 * 
 * cdef c_word_as_string(int *word, int num_generators, verbose_form):
 *     cdef int n = 0             # <<<<<<<<<<<<<<
 *     word_list = []
 *     while word[n] != 0:
*/
  __pyx_v_n = 0;

  /* "cython/core/fundamental_group.pyx":65
 * cdef c_word_as_string(int *word, int num_generators, verbose_form):
 *     cdef int n = 0
 *     word_list = []             # <<<<<<<<<<<<<<
 *     while word[n] != 0:
 *         word_list.append(
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_word_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":66
 *     cdef int n = 0
 *     word_list = []
 *     while word[n] != 0:             # <<<<<<<<<<<<<<
 *         word_list.append(
 *             int_to_gen_string(word[n], num_generators, verbose_form))
*/
  while (1) {
    __pyx_t_2 = ((__pyx_v_word[__pyx_v_n]) != 0);
    if (!__pyx_t_2) break;

    /* "cython/core/fundamental_group.pyx":68
 *     while word[n] != 0:
 *         word_list.append(
 *             int_to_gen_string(word[n], num_generators, verbose_form))             # <<<<<<<<<<<<<<
 *         n += 1
 *     return _letter_seperator(verbose_form).join(word_list)
*/
    __pyx_t_1 = __pyx_f_8SnapPyHP_int_to_gen_string((__pyx_v_word[__pyx_v_n]), __pyx_v_num_generators, __pyx_v_verbose_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/fundamental_group.pyx":67
 *     word_list = []
 *     while word[n] != 0:
 *         word_list.append(             # <<<<<<<<<<<<<<
 *             int_to_gen_string(word[n], num_generators, verbose_form))
 *         n += 1
*/
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 67, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":69
 *         word_list.append(
 *             int_to_gen_string(word[n], num_generators, verbose_form))
 *         n += 1             # <<<<<<<<<<<<<<
 *     return _letter_seperator(verbose_form).join(word_list)
 * 
*/
    __pyx_v_n = (__pyx_v_n + 1);
  }

  /* "cython/core/fundamental_group.pyx":70
 *             int_to_gen_string(word[n], num_generators, verbose_form))
 *         n += 1
 *     return _letter_seperator(verbose_form).join(word_list)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_letter_seperator); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_verbose_form};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_word_list};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":63
 * 
 * 
 * cdef c_word_as_string(int *word, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     cdef int n = 0
 *     word_list = []
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.c_word_as_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_word_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":73
 * 
 * 
 * def word_as_list(word, int num_generators):             # <<<<<<<<<<<<<<
 *     if not isinstance(word, str):
 *         raise TypeError('Words must be represented as Python strings.')
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_41word_as_list(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_8SnapPyHP_41word_as_list = {"word_as_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_41word_as_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_41word_as_list(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_word = 0;
  int __pyx_v_num_generators;
  #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("word_as_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word,&__pyx_mstate_global->__pyx_n_u_num_generators,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 73, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 73, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 73, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "word_as_list", 0) < 0) __PYX_ERR(8, 73, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("word_as_list", 1, 2, 2, i); __PYX_ERR(8, 73, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 73, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 73, __pyx_L3_error)
    }
    __pyx_v_word = values[0];
    __pyx_v_num_generators = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_num_generators == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 73, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("word_as_list", 1, 2, 2, __pyx_nargs); __PYX_ERR(8, 73, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.word_as_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_40word_as_list(__pyx_self, __pyx_v_word, __pyx_v_num_generators);

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

static PyObject *__pyx_pf_8SnapPyHP_40word_as_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word, int __pyx_v_num_generators) {
  PyObject *__pyx_v_word_list = NULL;
  PyObject *__pyx_v_prefix = NULL;
  PyObject *__pyx_v_number = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_v_letter = 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;
  size_t __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;
  long __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("word_as_list", 0);

  /* "cython/core/fundamental_group.pyx":74
 * 
 * def word_as_list(word, int num_generators):
 *     if not isinstance(word, str):             # <<<<<<<<<<<<<<
 *         raise TypeError('Words must be represented as Python strings.')
 *     word_list = []
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_word); 
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/fundamental_group.pyx":75
 * def word_as_list(word, int num_generators):
 *     if not isinstance(word, str):
 *         raise TypeError('Words must be represented as Python strings.')             # <<<<<<<<<<<<<<
 *     word_list = []
 *     if num_generators > 26:
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_TypeError);
    __pyx_t_5 = __pyx_builtin_TypeError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Words_must_be_represented_as_Pyt};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(8, 75, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":74
 * 
 * def word_as_list(word, int num_generators):
 *     if not isinstance(word, str):             # <<<<<<<<<<<<<<
 *         raise TypeError('Words must be represented as Python strings.')
 *     word_list = []
*/
  }

  /* "cython/core/fundamental_group.pyx":76
 *     if not isinstance(word, str):
 *         raise TypeError('Words must be represented as Python strings.')
 *     word_list = []             # <<<<<<<<<<<<<<
 *     if num_generators > 26:
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_word_list = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/fundamental_group.pyx":77
 *         raise TypeError('Words must be represented as Python strings.')
 *     word_list = []
 *     if num_generators > 26:             # <<<<<<<<<<<<<<
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):
 *             g = int(number)
*/
  __pyx_t_2 = (__pyx_v_num_generators > 26);
  if (__pyx_t_2) {

    /* "cython/core/fundamental_group.pyx":78
 *     word_list = []
 *     if num_generators > 26:
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):             # <<<<<<<<<<<<<<
 *             g = int(number)
 *             if not (0 < g and g <= num_generators):
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_xX_d, __pyx_v_word};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 78, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 78, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 78, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 78, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 78, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 78, __pyx_L1_error)
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 78, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(8, 78, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_5);
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_4);
        } else {
          __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 78, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 78, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
        }
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 78, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 78, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 78, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
        index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(8, 78, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(8, 78, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/fundamental_group.pyx":79
 *     if num_generators > 26:
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):
 *             g = int(number)             # <<<<<<<<<<<<<<
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')
*/
      __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_g, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cython/core/fundamental_group.pyx":80
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):
 *             g = int(number)
 *             if not (0 < g and g <= num_generators):             # <<<<<<<<<<<<<<
 *                 raise ValueError('The word contains a non-generator.')
 *             if prefix.islower():
*/
      __pyx_t_3 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_g, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 80, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 80, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_num_generators); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 80, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_g, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 80, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 80, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_L10_bool_binop_done:;
      __pyx_t_1 = (!__pyx_t_2);
      if (unlikely(__pyx_t_1)) {

        /* "cython/core/fundamental_group.pyx":81
 *             g = int(number)
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')             # <<<<<<<<<<<<<<
 *             if prefix.islower():
 *                 word_list.append( g)
*/
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_5 = __pyx_builtin_ValueError; 
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_word_contains_a_non_generato};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 81, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(8, 81, __pyx_L1_error)

        /* "cython/core/fundamental_group.pyx":80
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):
 *             g = int(number)
 *             if not (0 < g and g <= num_generators):             # <<<<<<<<<<<<<<
 *                 raise ValueError('The word contains a non-generator.')
 *             if prefix.islower():
*/
      }

      /* "cython/core/fundamental_group.pyx":82
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')
 *             if prefix.islower():             # <<<<<<<<<<<<<<
 *                 word_list.append( g)
 *             else:
*/
      __pyx_t_5 = __pyx_v_prefix;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_islower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 82, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "cython/core/fundamental_group.pyx":83
 *                 raise ValueError('The word contains a non-generator.')
 *             if prefix.islower():
 *                 word_list.append( g)             # <<<<<<<<<<<<<<
 *             else:
 *                 word_list.append(-g)
*/
        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_v_g); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(8, 83, __pyx_L1_error)

        /* "cython/core/fundamental_group.pyx":82
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')
 *             if prefix.islower():             # <<<<<<<<<<<<<<
 *                 word_list.append( g)
 *             else:
*/
        goto __pyx_L12;
      }

      /* "cython/core/fundamental_group.pyx":85
 *                 word_list.append( g)
 *             else:
 *                 word_list.append(-g)             # <<<<<<<<<<<<<<
 *     else:
 *         for letter in word:
*/
      /*else*/ {
        __pyx_t_4 = PyNumber_Negative(__pyx_v_g); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 85, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(8, 85, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L12:;

      /* "cython/core/fundamental_group.pyx":78
 *     word_list = []
 *     if num_generators > 26:
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):             # <<<<<<<<<<<<<<
 *             g = int(number)
 *             if not (0 < g and g <= num_generators):
*/
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/fundamental_group.pyx":77
 *         raise TypeError('Words must be represented as Python strings.')
 *     word_list = []
 *     if num_generators > 26:             # <<<<<<<<<<<<<<
 *         for prefix, number in re.findall(r'([xX])(\d+)', word):
 *             g = int(number)
*/
    goto __pyx_L4;
  }

  /* "cython/core/fundamental_group.pyx":87
 *                 word_list.append(-g)
 *     else:
 *         for letter in word:             # <<<<<<<<<<<<<<
 *             g = ord(letter.lower()) - ord("a") + 1
 *             if not (0 < g and g <= num_generators):
*/
  /*else*/ {
    if (likely(PyList_CheckExact(__pyx_v_word)) || PyTuple_CheckExact(__pyx_v_word)) {
      __pyx_t_7 = __pyx_v_word; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_word); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 87, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 87, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 87, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 87, __pyx_L1_error)
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 87, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_letter, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/fundamental_group.pyx":88
 *     else:
 *         for letter in word:
 *             g = ord(letter.lower()) - ord("a") + 1             # <<<<<<<<<<<<<<
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')
*/
      __pyx_t_5 = __pyx_v_letter;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 88, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_t_4); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(8, 88, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyLong_From_long(((__pyx_t_13 - 97) + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(PyLong_CheckExact(__pyx_t_4)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(8, 88, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_g, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cython/core/fundamental_group.pyx":89
 *         for letter in word:
 *             g = ord(letter.lower()) - ord("a") + 1
 *             if not (0 < g and g <= num_generators):             # <<<<<<<<<<<<<<
 *                 raise ValueError('The word contains a non-generator.')
 *             if letter.islower():
*/
      __pyx_t_4 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_g, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 89, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 89, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L17_bool_binop_done;
      }
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_num_generators); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_g, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 89, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 89, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_1 = __pyx_t_2;
      __pyx_L17_bool_binop_done:;
      __pyx_t_2 = (!__pyx_t_1);
      if (unlikely(__pyx_t_2)) {

        /* "cython/core/fundamental_group.pyx":90
 *             g = ord(letter.lower()) - ord("a") + 1
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')             # <<<<<<<<<<<<<<
 *             if letter.islower():
 *                 word_list.append( g)
*/
        __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_3 = __pyx_builtin_ValueError; 
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_word_contains_a_non_generato};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 90, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(8, 90, __pyx_L1_error)

        /* "cython/core/fundamental_group.pyx":89
 *         for letter in word:
 *             g = ord(letter.lower()) - ord("a") + 1
 *             if not (0 < g and g <= num_generators):             # <<<<<<<<<<<<<<
 *                 raise ValueError('The word contains a non-generator.')
 *             if letter.islower():
*/
      }

      /* "cython/core/fundamental_group.pyx":91
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')
 *             if letter.islower():             # <<<<<<<<<<<<<<
 *                 word_list.append( g)
 *             else:
*/
      __pyx_t_3 = __pyx_v_letter;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_islower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 91, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 91, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_2) {

        /* "cython/core/fundamental_group.pyx":92
 *                 raise ValueError('The word contains a non-generator.')
 *             if letter.islower():
 *                 word_list.append( g)             # <<<<<<<<<<<<<<
 *             else:
 *                 word_list.append(-g)
*/
        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_v_g); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(8, 92, __pyx_L1_error)

        /* "cython/core/fundamental_group.pyx":91
 *             if not (0 < g and g <= num_generators):
 *                 raise ValueError('The word contains a non-generator.')
 *             if letter.islower():             # <<<<<<<<<<<<<<
 *                 word_list.append( g)
 *             else:
*/
        goto __pyx_L19;
      }

      /* "cython/core/fundamental_group.pyx":94
 *                 word_list.append( g)
 *             else:
 *                 word_list.append(-g)             # <<<<<<<<<<<<<<
 * 
 *     return word_list
*/
      /*else*/ {
        __pyx_t_5 = PyNumber_Negative(__pyx_v_g); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 94, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(8, 94, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_L19:;

      /* "cython/core/fundamental_group.pyx":87
 *                 word_list.append(-g)
 *     else:
 *         for letter in word:             # <<<<<<<<<<<<<<
 *             g = ord(letter.lower()) - ord("a") + 1
 *             if not (0 < g and g <= num_generators):
*/
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_L4:;

  /* "cython/core/fundamental_group.pyx":96
 *                 word_list.append(-g)
 * 
 *     return word_list             # <<<<<<<<<<<<<<
 * 
 * def list_as_word(int_list, int num_generators, verbose_form):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_word_list);
  __pyx_r = __pyx_v_word_list;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":73
 * 
 * 
 * def word_as_list(word, int num_generators):             # <<<<<<<<<<<<<<
 *     if not isinstance(word, str):
 *         raise TypeError('Words must be represented as Python strings.')
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.word_as_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_word_list);
  __Pyx_XDECREF(__pyx_v_prefix);
  __Pyx_XDECREF(__pyx_v_number);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XDECREF(__pyx_v_letter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":98
 *     return word_list
 * 
 * def list_as_word(int_list, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_43list_as_word(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_8SnapPyHP_43list_as_word = {"list_as_word", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_43list_as_word, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_43list_as_word(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_int_list = 0;
  int __pyx_v_num_generators;
  PyObject *__pyx_v_verbose_form = 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("list_as_word (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_int_list,&__pyx_mstate_global->__pyx_n_u_num_generators,&__pyx_mstate_global->__pyx_n_u_verbose_form,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 98, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 98, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 98, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 98, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "list_as_word", 0) < 0) __PYX_ERR(8, 98, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("list_as_word", 1, 3, 3, i); __PYX_ERR(8, 98, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 98, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 98, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 98, __pyx_L3_error)
    }
    __pyx_v_int_list = values[0];
    __pyx_v_num_generators = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_num_generators == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 98, __pyx_L3_error)
    __pyx_v_verbose_form = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("list_as_word", 1, 3, 3, __pyx_nargs); __PYX_ERR(8, 98, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.list_as_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_42list_as_word(__pyx_self, __pyx_v_int_list, __pyx_v_num_generators, __pyx_v_verbose_form);

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

/* "cython/core/fundamental_group.pyx":100
 * def list_as_word(int_list, int num_generators, verbose_form):
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)             # <<<<<<<<<<<<<<
 *         for g in int_list)
 * 
*/

static PyObject *__pyx_pf_8SnapPyHP_12list_as_word_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 100, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *) __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_8SnapPyHP_12list_as_word_2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_list_as_word_locals_genexpr, __pyx_mstate_global->__pyx_n_u_SnapPyHP); if (unlikely(!gen)) __PYX_ERR(8, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPyHP.list_as_word.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_8SnapPyHP_12list_as_word_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  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("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 != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(8, 100, __pyx_L1_error)
  }

  /* "cython/core/fundamental_group.pyx":101
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)
 *         for g in int_list)             # <<<<<<<<<<<<<<
 * 
 * cdef class CFundamentalGroup():
*/
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(8, 101, __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(8, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 101, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 101, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 101, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 101, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 101, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_g);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_g, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/fundamental_group.pyx":100
 * def list_as_word(int_list, int num_generators, verbose_form):
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)             # <<<<<<<<<<<<<<
 *         for g in int_list)
 * 
*/
    __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_cur_scope->__pyx_v_g); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 100, __pyx_L1_error)
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_verbose_form)) { __Pyx_RaiseClosureNameError("verbose_form"); __PYX_ERR(8, 100, __pyx_L1_error) }
    __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_verbose_form;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = __pyx_f_8SnapPyHP_int_to_gen_string(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_num_generators, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_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(8, 100, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":101
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)
 *         for g in int_list)             # <<<<<<<<<<<<<<
 * 
 * cdef class CFundamentalGroup():
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "cython/core/fundamental_group.pyx":100
 * def list_as_word(int_list, int num_generators, verbose_form):
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)             # <<<<<<<<<<<<<<
 *         for g in int_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_4);
  __Pyx_XDECREF(__pyx_t_6);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __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;
}

/* "cython/core/fundamental_group.pyx":98
 *     return word_list
 * 
 * def list_as_word(int_list, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)
*/

static PyObject *__pyx_pf_8SnapPyHP_42list_as_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_int_list, int __pyx_v_num_generators, PyObject *__pyx_v_verbose_form) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *__pyx_cur_scope;
  PyObject *__pyx_gb_8SnapPyHP_12list_as_word_2generator3 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_as_word", 0);
  __pyx_cur_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_4_list_as_word(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 98, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_num_generators = __pyx_v_num_generators;
  __pyx_cur_scope->__pyx_v_verbose_form = __pyx_v_verbose_form;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_verbose_form);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_verbose_form);

  /* "cython/core/fundamental_group.pyx":99
 * 
 * def list_as_word(int_list, int num_generators, verbose_form):
 *     return _letter_seperator(verbose_form).join(             # <<<<<<<<<<<<<<
 *         int_to_gen_string(g, num_generators, verbose_form)
 *         for g in int_list)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_letter_seperator); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_verbose_form};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);

  /* "cython/core/fundamental_group.pyx":100
 * def list_as_word(int_list, int num_generators, verbose_form):
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)             # <<<<<<<<<<<<<<
 *         for g in int_list)
 * 
*/
  __pyx_t_5 = __pyx_pf_8SnapPyHP_12list_as_word_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_int_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":98
 *     return word_list
 * 
 * def list_as_word(int_list, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.list_as_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_8SnapPyHP_12list_as_word_2generator3);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":108
 *     cdef readonly num_cusps
 * 
 *     def __cinit__(self, Triangulation triangulation,             # <<<<<<<<<<<<<<
 *                   simplify_presentation=True,
 *                   fillings_may_affect_generators=True,
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_17CFundamentalGroup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_17CFundamentalGroup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_triangulation = 0;
  PyObject *__pyx_v_simplify_presentation = 0;
  PyObject *__pyx_v_fillings_may_affect_generators = 0;
  PyObject *__pyx_v_minimize_number_of_generators = 0;
  PyObject *__pyx_v_try_hard_to_shorten_relators = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_triangulation,&__pyx_mstate_global->__pyx_n_u_simplify_presentation,&__pyx_mstate_global->__pyx_n_u_fillings_may_affect_generators,&__pyx_mstate_global->__pyx_n_u_minimize_number_of_generators,&__pyx_mstate_global->__pyx_n_u_try_hard_to_shorten_relators,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 108, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(8, 108, __pyx_L3_error)

      /* "cython/core/fundamental_group.pyx":109
 * 
 *     def __cinit__(self, Triangulation triangulation,
 *                   simplify_presentation=True,             # <<<<<<<<<<<<<<
 *                   fillings_may_affect_generators=True,
 *                   minimize_number_of_generators=True,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/fundamental_group.pyx":110
 *     def __cinit__(self, Triangulation triangulation,
 *                   simplify_presentation=True,
 *                   fillings_may_affect_generators=True,             # <<<<<<<<<<<<<<
 *                   minimize_number_of_generators=True,
 *                   try_hard_to_shorten_relators=True):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/fundamental_group.pyx":111
 *                   simplify_presentation=True,
 *                   fillings_may_affect_generators=True,
 *                   minimize_number_of_generators=True,             # <<<<<<<<<<<<<<
 *                   try_hard_to_shorten_relators=True):
 *         if triangulation.c_triangulation is NULL:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/fundamental_group.pyx":112
 *                   fillings_may_affect_generators=True,
 *                   minimize_number_of_generators=True,
 *                   try_hard_to_shorten_relators=True):             # <<<<<<<<<<<<<<
 *         if triangulation.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, i); __PYX_ERR(8, 108, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 108, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/fundamental_group.pyx":109
 * 
 *     def __cinit__(self, Triangulation triangulation,
 *                   simplify_presentation=True,             # <<<<<<<<<<<<<<
 *                   fillings_may_affect_generators=True,
 *                   minimize_number_of_generators=True,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/fundamental_group.pyx":110
 *     def __cinit__(self, Triangulation triangulation,
 *                   simplify_presentation=True,
 *                   fillings_may_affect_generators=True,             # <<<<<<<<<<<<<<
 *                   minimize_number_of_generators=True,
 *                   try_hard_to_shorten_relators=True):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/fundamental_group.pyx":111
 *                   simplify_presentation=True,
 *                   fillings_may_affect_generators=True,
 *                   minimize_number_of_generators=True,             # <<<<<<<<<<<<<<
 *                   try_hard_to_shorten_relators=True):
 *         if triangulation.c_triangulation is NULL:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/fundamental_group.pyx":112
 *                   fillings_may_affect_generators=True,
 *                   minimize_number_of_generators=True,
 *                   try_hard_to_shorten_relators=True):             # <<<<<<<<<<<<<<
 *         if triangulation.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_triangulation = ((struct __pyx_obj_8SnapPyHP_Triangulation *)values[0]);
    __pyx_v_simplify_presentation = values[1];
    __pyx_v_fillings_may_affect_generators = values[2];
    __pyx_v_minimize_number_of_generators = values[3];
    __pyx_v_try_hard_to_shorten_relators = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, __pyx_nargs); __PYX_ERR(8, 108, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_triangulation), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, 1, "triangulation", 0))) __PYX_ERR(8, 108, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup___cinit__(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_triangulation, __pyx_v_simplify_presentation, __pyx_v_fillings_may_affect_generators, __pyx_v_minimize_number_of_generators, __pyx_v_try_hard_to_shorten_relators);

  /* "cython/core/fundamental_group.pyx":108
 *     cdef readonly num_cusps
 * 
 *     def __cinit__(self, Triangulation triangulation,             # <<<<<<<<<<<<<<
 *                   simplify_presentation=True,
 *                   fillings_may_affect_generators=True,
*/

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

static int __pyx_pf_8SnapPyHP_17CFundamentalGroup___cinit__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_triangulation, PyObject *__pyx_v_simplify_presentation, PyObject *__pyx_v_fillings_may_affect_generators, PyObject *__pyx_v_minimize_number_of_generators, PyObject *__pyx_v_try_hard_to_shorten_relators) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Boolean __pyx_t_6;
  Boolean __pyx_t_7;
  Boolean __pyx_t_8;
  Boolean __pyx_t_9;
  GroupPresentation *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cython/core/fundamental_group.pyx":113
 *                   minimize_number_of_generators=True,
 *                   try_hard_to_shorten_relators=True):
 *         if triangulation.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         copy_triangulation(triangulation.c_triangulation,
*/
  __pyx_t_1 = (__pyx_v_triangulation->c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/fundamental_group.pyx":114
 *                   try_hard_to_shorten_relators=True):
 *         if triangulation.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         copy_triangulation(triangulation.c_triangulation,
 *                            &self.c_triangulation)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 114, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(8, 114, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":113
 *                   minimize_number_of_generators=True,
 *                   try_hard_to_shorten_relators=True):
 *         if triangulation.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         copy_triangulation(triangulation.c_triangulation,
*/
  }

  /* "cython/core/fundamental_group.pyx":115
 *         if triangulation.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         copy_triangulation(triangulation.c_triangulation,             # <<<<<<<<<<<<<<
 *                            &self.c_triangulation)
 *         self.c_group_presentation = fundamental_group(
*/
  copy_triangulation(__pyx_v_triangulation->c_triangulation, (&__pyx_v_self->c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 115, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":119
 *         self.c_group_presentation = fundamental_group(
 *             self.c_triangulation,
 *             simplify_presentation,             # <<<<<<<<<<<<<<
 *             fillings_may_affect_generators,
 *             minimize_number_of_generators,
*/
  __pyx_t_6 = __Pyx_PyLong_As_Boolean(__pyx_v_simplify_presentation); if (unlikely((__pyx_t_6 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(8, 119, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":120
 *             self.c_triangulation,
 *             simplify_presentation,
 *             fillings_may_affect_generators,             # <<<<<<<<<<<<<<
 *             minimize_number_of_generators,
 *             try_hard_to_shorten_relators)
*/
  __pyx_t_7 = __Pyx_PyLong_As_Boolean(__pyx_v_fillings_may_affect_generators); if (unlikely((__pyx_t_7 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(8, 120, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":121
 *             simplify_presentation,
 *             fillings_may_affect_generators,
 *             minimize_number_of_generators,             # <<<<<<<<<<<<<<
 *             try_hard_to_shorten_relators)
 *         self.num_cusps = triangulation.num_cusps()
*/
  __pyx_t_8 = __Pyx_PyLong_As_Boolean(__pyx_v_minimize_number_of_generators); if (unlikely((__pyx_t_8 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(8, 121, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":122
 *             fillings_may_affect_generators,
 *             minimize_number_of_generators,
 *             try_hard_to_shorten_relators)             # <<<<<<<<<<<<<<
 *         self.num_cusps = triangulation.num_cusps()
 * 
*/
  __pyx_t_9 = __Pyx_PyLong_As_Boolean(__pyx_v_try_hard_to_shorten_relators); if (unlikely((__pyx_t_9 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(8, 122, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":117
 *         copy_triangulation(triangulation.c_triangulation,
 *                            &self.c_triangulation)
 *         self.c_group_presentation = fundamental_group(             # <<<<<<<<<<<<<<
 *             self.c_triangulation,
 *             simplify_presentation,
*/
  __pyx_t_10 = fundamental_group(__pyx_v_self->c_triangulation, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 117, __pyx_L1_error)
  __pyx_v_self->c_group_presentation = __pyx_t_10;

  /* "cython/core/fundamental_group.pyx":123
 *             minimize_number_of_generators,
 *             try_hard_to_shorten_relators)
 *         self.num_cusps = triangulation.num_cusps()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_triangulation);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->num_cusps);
  __Pyx_DECREF(__pyx_v_self->num_cusps);
  __pyx_v_self->num_cusps = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":108
 *     cdef readonly num_cusps
 * 
 *     def __cinit__(self, Triangulation triangulation,             # <<<<<<<<<<<<<<
 *                   simplify_presentation=True,
 *                   fillings_may_affect_generators=True,
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":125
 *         self.num_cusps = triangulation.num_cusps()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free_triangulation(self.c_triangulation)
 *         free_group_presentation(self.c_group_presentation)
*/

/* Python wrapper */
static void __pyx_pw_8SnapPyHP_17CFundamentalGroup_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8SnapPyHP_17CFundamentalGroup_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_8SnapPyHP_17CFundamentalGroup_2__dealloc__(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static void __pyx_pf_8SnapPyHP_17CFundamentalGroup_2__dealloc__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cython/core/fundamental_group.pyx":126
 * 
 *     def __dealloc__(self):
 *         free_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         free_group_presentation(self.c_group_presentation)
 * 
*/
  free_triangulation(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 126, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":127
 *     def __dealloc__(self):
 *         free_triangulation(self.c_triangulation)
 *         free_group_presentation(self.c_group_presentation)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  free_group_presentation(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 127, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":125
 *         self.num_cusps = triangulation.num_cusps()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free_triangulation(self.c_triangulation)
 *         free_group_presentation(self.c_group_presentation)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("SnapPyHP.CFundamentalGroup.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
}

/* "cython/core/fundamental_group.pyx":129
 *         free_group_presentation(self.c_group_presentation)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'Generators:\n   %s\nRelators:\n   %s' % (
 *             ','.join(self.generators()),
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_5__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_8SnapPyHP_17CFundamentalGroup_4__repr__(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_4__repr__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[4];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/fundamental_group.pyx":130
 * 
 *     def __repr__(self):
 *         return 'Generators:\n   %s\nRelators:\n   %s' % (             # <<<<<<<<<<<<<<
 *             ','.join(self.generators()),
 *             '\n   '.join(self.relators()))
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/fundamental_group.pyx":131
 *     def __repr__(self):
 *         return 'Generators:\n   %s\nRelators:\n   %s' % (
 *             ','.join(self.generators()),             # <<<<<<<<<<<<<<
 *             '\n   '.join(self.relators()))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_generators); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__28, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":132
 *         return 'Generators:\n   %s\nRelators:\n   %s' % (
 *             ','.join(self.generators()),
 *             '\n   '.join(self.relators()))             # <<<<<<<<<<<<<<
 * 
 *     def num_generators(self):
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_relators); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__33, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Generators;
  __pyx_t_4[1] = __pyx_t_1;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_Relators;
  __pyx_t_4[3] = __pyx_t_2;

  /* "cython/core/fundamental_group.pyx":130
 * 
 *     def __repr__(self):
 *         return 'Generators:\n   %s\nRelators:\n   %s' % (             # <<<<<<<<<<<<<<
 *             ','.join(self.generators()),
 *             '\n   '.join(self.relators()))
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 130, __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;

  /* "cython/core/fundamental_group.pyx":129
 *         free_group_presentation(self.c_group_presentation)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'Generators:\n   %s\nRelators:\n   %s' % (
 *             ','.join(self.generators()),
*/

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

/* "cython/core/fundamental_group.pyx":134
 *             '\n   '.join(self.relators()))
 * 
 *     def num_generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of generators for the presentation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_7num_generators(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_8SnapPyHP_17CFundamentalGroup_6num_generators, "\n        Return the number of generators for the presentation.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_7num_generators = {"num_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_7num_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_6num_generators};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_7num_generators(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("num_generators (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_generators", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_generators", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_6num_generators(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_6num_generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__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("num_generators", 0);

  /* "cython/core/fundamental_group.pyx":138
 *         Return the number of generators for the presentation.
 *         """
 *         return fg_get_num_generators(self.c_group_presentation)             # <<<<<<<<<<<<<<
 * 
 *     def num_relators(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = fg_get_num_generators(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 138, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":134
 *             '\n   '.join(self.relators()))
 * 
 *     def num_generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of generators for the presentation.
*/

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

/* "cython/core/fundamental_group.pyx":140
 *         return fg_get_num_generators(self.c_group_presentation)
 * 
 *     def num_relators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of generators for the presentation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_9num_relators(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_8SnapPyHP_17CFundamentalGroup_8num_relators, "\n        Return the number of generators for the presentation.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_9num_relators = {"num_relators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_9num_relators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_8num_relators};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_9num_relators(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("num_relators (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_relators", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_relators", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_8num_relators(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_8num_relators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__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("num_relators", 0);

  /* "cython/core/fundamental_group.pyx":144
 *         Return the number of generators for the presentation.
 *         """
 *         return fg_get_num_relations(self.c_group_presentation)             # <<<<<<<<<<<<<<
 * 
 *     def num_original_generators(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = fg_get_num_relations(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 144, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":140
 *         return fg_get_num_generators(self.c_group_presentation)
 * 
 *     def num_relators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of generators for the presentation.
*/

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

/* "cython/core/fundamental_group.pyx":146
 *         return fg_get_num_relations(self.c_group_presentation)
 * 
 *     def num_original_generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of geometric generators (before simplification).
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_11num_original_generators(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_8SnapPyHP_17CFundamentalGroup_10num_original_generators, "\n        Return the number of geometric generators (before simplification).\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_11num_original_generators = {"num_original_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_11num_original_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_10num_original_generators};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_11num_original_generators(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("num_original_generators (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_original_generators", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_original_generators", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_10num_original_generators(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_10num_original_generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__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("num_original_generators", 0);

  /* "cython/core/fundamental_group.pyx":150
 *         Return the number of geometric generators (before simplification).
 *         """
 *         return fg_get_num_orig_gens(self.c_group_presentation)             # <<<<<<<<<<<<<<
 * 
 *     def original_generators(self, verbose_form=False, as_int_list=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = fg_get_num_orig_gens(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 150, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":146
 *         return fg_get_num_relations(self.c_group_presentation)
 * 
 *     def num_original_generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of geometric generators (before simplification).
*/

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

/* "cython/core/fundamental_group.pyx":152
 *         return fg_get_num_orig_gens(self.c_group_presentation)
 * 
 *     def original_generators(self, verbose_form=False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the original geometric generators (before
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_13original_generators(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_8SnapPyHP_17CFundamentalGroup_12original_generators, "\n        Return the original geometric generators (before\n        simplification) in terms of the current generators.\n\n        >>> M = Manifold('v0000')\n        >>> G = M.fundamental_group()\n        >>> G.original_generators(as_int_list=True)\n        [[1], [-1, -2, 1, 2], [-1, 2], [-2, -1, 2], [2]]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_13original_generators = {"original_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_13original_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_12original_generators};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_13original_generators(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_verbose_form = 0;
  PyObject *__pyx_v_as_int_list = 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("original_generators (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_verbose_form,&__pyx_mstate_global->__pyx_n_u_as_int_list,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 152, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 152, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 152, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "original_generators", 0) < 0) __PYX_ERR(8, 152, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 152, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 152, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_verbose_form = values[0];
    __pyx_v_as_int_list = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("original_generators", 0, 0, 2, __pyx_nargs); __PYX_ERR(8, 152, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.original_generators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_12original_generators(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_verbose_form, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_12original_generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_as_int_list) {
  int __pyx_v_n;
  int *__pyx_v_gen;
  int __pyx_v_num_gen;
  int __pyx_v_num_orig_gens;
  PyObject *__pyx_v_orig_gens = NULL;
  PyObject *__pyx_v_word = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("original_generators", 0);

  /* "cython/core/fundamental_group.pyx":164
 *         cdef int n
 *         cdef int *gen
 *         cdef int num_gen = self.num_generators()             # <<<<<<<<<<<<<<
 *         cdef int num_orig_gens = self.num_original_generators()
 *         orig_gens = []
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_gen = __pyx_t_4;

  /* "cython/core/fundamental_group.pyx":165
 *         cdef int *gen
 *         cdef int num_gen = self.num_generators()
 *         cdef int num_orig_gens = self.num_original_generators()             # <<<<<<<<<<<<<<
 *         orig_gens = []
 *         for n from 0 <= n < num_orig_gens:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_original_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_orig_gens = __pyx_t_4;

  /* "cython/core/fundamental_group.pyx":166
 *         cdef int num_gen = self.num_generators()
 *         cdef int num_orig_gens = self.num_original_generators()
 *         orig_gens = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < num_orig_gens:
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_orig_gens = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":167
 *         cdef int num_orig_gens = self.num_original_generators()
 *         orig_gens = []
 *         for n from 0 <= n < num_orig_gens:             # <<<<<<<<<<<<<<
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 *             if as_int_list:
*/
  __pyx_t_4 = __pyx_v_num_orig_gens;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {

    /* "cython/core/fundamental_group.pyx":168
 *         orig_gens = []
 *         for n from 0 <= n < num_orig_gens:
 *             gen = fg_get_original_generator(self.c_group_presentation, n)             # <<<<<<<<<<<<<<
 *             if as_int_list:
 *                 word = c_word_as_int_list(gen)
*/
    __pyx_t_5 = fg_get_original_generator(__pyx_v_self->c_group_presentation, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 168, __pyx_L1_error)
    __pyx_v_gen = __pyx_t_5;

    /* "cython/core/fundamental_group.pyx":169
 *         for n from 0 <= n < num_orig_gens:
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 *             if as_int_list:             # <<<<<<<<<<<<<<
 *                 word = c_word_as_int_list(gen)
 *             else:
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_as_int_list); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(8, 169, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/fundamental_group.pyx":170
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 *             if as_int_list:
 *                 word = c_word_as_int_list(gen)             # <<<<<<<<<<<<<<
 *             else:
 *                 word = c_word_as_string(gen, num_gen, verbose_form)
*/
      __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_int_list(__pyx_v_gen); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":169
 *         for n from 0 <= n < num_orig_gens:
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 *             if as_int_list:             # <<<<<<<<<<<<<<
 *                 word = c_word_as_int_list(gen)
 *             else:
*/
      goto __pyx_L5;
    }

    /* "cython/core/fundamental_group.pyx":172
 *                 word = c_word_as_int_list(gen)
 *             else:
 *                 word = c_word_as_string(gen, num_gen, verbose_form)             # <<<<<<<<<<<<<<
 *             orig_gens.append(word)
 *             fg_free_relation(gen)
*/
    /*else*/ {
      __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_string(__pyx_v_gen, __pyx_v_num_gen, __pyx_v_verbose_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "cython/core/fundamental_group.pyx":173
 *             else:
 *                 word = c_word_as_string(gen, num_gen, verbose_form)
 *             orig_gens.append(word)             # <<<<<<<<<<<<<<
 *             fg_free_relation(gen)
 *         return orig_gens
*/
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_orig_gens, __pyx_v_word); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 173, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":174
 *                 word = c_word_as_string(gen, num_gen, verbose_form)
 *             orig_gens.append(word)
 *             fg_free_relation(gen)             # <<<<<<<<<<<<<<
 *         return orig_gens
 * 
*/
    fg_free_relation(__pyx_v_gen); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 174, __pyx_L1_error)
  }

  /* "cython/core/fundamental_group.pyx":175
 *             orig_gens.append(word)
 *             fg_free_relation(gen)
 *         return orig_gens             # <<<<<<<<<<<<<<
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form=False, as_int_list=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_orig_gens);
  __pyx_r = __pyx_v_orig_gens;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":152
 *         return fg_get_num_orig_gens(self.c_group_presentation)
 * 
 *     def original_generators(self, verbose_form=False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the original geometric generators (before
*/

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

/* "cython/core/fundamental_group.pyx":177
 *         return orig_gens
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form=False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the current generators in terms of the original
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_15generators_in_originals(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_8SnapPyHP_17CFundamentalGroup_14generators_in_originals, "\n        Return the current generators in terms of the original\n        geometric generators. Note that by default fundamental_group()\n        returns a simplified presentation of the group.\n\n        If the flag \"raw_form\" is set to True, it returns a sequence of\n        instructions for expressing the current generators in terms of\n        the original ones.  This is sometimes much more concise, though\n        the format is somewhat obscure.  See the source code of this\n        function in fundamental_group.pyx for details.\n\n        >>> M = Manifold('K7_1')\n        >>> G = M.fundamental_group()\n        >>> G.generators_in_originals()   #doctest: +NORMALIZE_WHITESPACE\n        ['DBcACbABcaCbDBcACbABcaCbACbaBcaCbd',\n         'DBcACbABcaCbDBcACbABcaCbCbDBcACbABcaBcACbaBcaCbdACbaBcaCbdBcBcACbaBcaCbd']\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_15generators_in_originals = {"generators_in_originals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_15generators_in_originals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_14generators_in_originals};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_15generators_in_originals(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_verbose_form = 0;
  PyObject *__pyx_v_raw_form = 0;
  PyObject *__pyx_v_as_int_list = 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("generators_in_originals (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_verbose_form,&__pyx_mstate_global->__pyx_n_u_raw_form,&__pyx_mstate_global->__pyx_n_u_as_int_list,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 177, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "generators_in_originals", 0) < 0) __PYX_ERR(8, 177, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_verbose_form = values[0];
    __pyx_v_raw_form = values[1];
    __pyx_v_as_int_list = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("generators_in_originals", 0, 0, 3, __pyx_nargs); __PYX_ERR(8, 177, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.generators_in_originals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_14generators_in_originals(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_verbose_form, __pyx_v_raw_form, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_14generators_in_originals(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_raw_form, PyObject *__pyx_v_as_int_list) {
  PyObject *__pyx_v_moves = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_words = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_word = NULL;
  PyObject *__pyx_v_parts = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_A = NULL;
  PyObject *__pyx_v_B = NULL;
  PyObject *__pyx_9genexpr73__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr74__pyx_v_g = NULL;
  PyObject *__pyx_9genexpr75__pyx_v_word = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generators_in_originals", 0);

  /* "cython/core/fundamental_group.pyx":195
 *          'DBcACbABcaCbDBcACbABcaCbCbDBcACbABcaBcACbaBcaCbdACbaBcaCbdBcBcACbaBcaCbd']
 *         """
 *         moves = self._word_moves()             # <<<<<<<<<<<<<<
 *         if raw_form:
 *             return moves
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_word_moves, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_moves = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":196
 *         """
 *         moves = self._word_moves()
 *         if raw_form:             # <<<<<<<<<<<<<<
 *             return moves
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_raw_form); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 196, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/fundamental_group.pyx":197
 *         moves = self._word_moves()
 *         if raw_form:
 *             return moves             # <<<<<<<<<<<<<<
 * 
 *         n = self.num_original_generators()
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_moves);
    __pyx_r = __pyx_v_moves;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":196
 *         """
 *         moves = self._word_moves()
 *         if raw_form:             # <<<<<<<<<<<<<<
 *             return moves
 * 
*/
  }

  /* "cython/core/fundamental_group.pyx":199
 *             return moves
 * 
 *         n = self.num_original_generators()             # <<<<<<<<<<<<<<
 * 
 *         words = [None] + [ [ i + 1 ] for i in range(n) ]
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_original_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":201
 *         n = self.num_original_generators()
 * 
 *         words = [None] + [ [ i + 1 ] for i in range(n) ]             # <<<<<<<<<<<<<<
 * 
 *         while len(moves) > 0:
*/
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_None) != (0)) __PYX_ERR(8, 201, __pyx_L1_error);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 201, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_7 = __pyx_builtin_range; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_n};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 201, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_7 = __pyx_t_5; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 201, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 201, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 201, __pyx_L6_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 201, __pyx_L6_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 201, __pyx_L6_error)
      } else {
        __pyx_t_5 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 201, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_9genexpr73__pyx_v_i, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_9genexpr73__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 201, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 201, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5) != (0)) __PYX_ERR(8, 201, __pyx_L6_error);
      __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(8, 201, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_9genexpr73__pyx_v_i); __pyx_9genexpr73__pyx_v_i = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr73__pyx_v_i); __pyx_9genexpr73__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_words = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "cython/core/fundamental_group.pyx":203
 *         words = [None] + [ [ i + 1 ] for i in range(n) ]
 * 
 *         while len(moves) > 0:             # <<<<<<<<<<<<<<
 *             a = moves.pop(0)
 *             if a >= len(words):  # new generator added
*/
  while (1) {
    __pyx_t_8 = PyObject_Length(__pyx_v_moves); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(8, 203, __pyx_L1_error)
    __pyx_t_4 = (__pyx_t_8 > 0);
    if (!__pyx_t_4) break;

    /* "cython/core/fundamental_group.pyx":204
 * 
 *         while len(moves) > 0:
 *             a = moves.pop(0)             # <<<<<<<<<<<<<<
 *             if a >= len(words):  # new generator added
 *                 n = moves.index(a)  # end symbol location
*/
    __pyx_t_7 = __Pyx_PyObject_PopIndex(__pyx_v_moves, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/fundamental_group.pyx":205
 *         while len(moves) > 0:
 *             a = moves.pop(0)
 *             if a >= len(words):  # new generator added             # <<<<<<<<<<<<<<
 *                 n = moves.index(a)  # end symbol location
 *                 # word is the expression of the new generator in terms
*/
    __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_v_words); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(8, 205, __pyx_L1_error)
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_a, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 205, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 205, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "cython/core/fundamental_group.pyx":206
 *             a = moves.pop(0)
 *             if a >= len(words):  # new generator added
 *                 n = moves.index(a)  # end symbol location             # <<<<<<<<<<<<<<
 *                 # word is the expression of the new generator in terms
 *                 # of the old ones
*/
      __pyx_t_7 = __pyx_v_moves;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_a};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/fundamental_group.pyx":209
 *                 # word is the expression of the new generator in terms
 *                 # of the old ones
 *                 word, moves = moves[:n], moves[n+1:]             # <<<<<<<<<<<<<<
 *                 parts = [words[g] if g > 0 else inverse_list_word(words[-g])
 *                          for g in word]
*/
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_moves, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyLong_AddObjC(__pyx_v_n, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_moves, 0, 0, &__pyx_t_7, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_moves, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":210
 *                 # of the old ones
 *                 word, moves = moves[:n], moves[n+1:]
 *                 parts = [words[g] if g > 0 else inverse_list_word(words[-g])             # <<<<<<<<<<<<<<
 *                          for g in word]
 *                 words.append(reduce_list_word(sum(parts, [])))
*/
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 210, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "cython/core/fundamental_group.pyx":211
 *                 word, moves = moves[:n], moves[n+1:]
 *                 parts = [words[g] if g > 0 else inverse_list_word(words[-g])
 *                          for g in word]             # <<<<<<<<<<<<<<
 *                 words.append(reduce_list_word(sum(parts, [])))
 *             else:
*/
        if (likely(PyList_CheckExact(__pyx_v_word)) || PyTuple_CheckExact(__pyx_v_word)) {
          __pyx_t_2 = __pyx_v_word; __Pyx_INCREF(__pyx_t_2);
          __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 211, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 211, __pyx_L16_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_2))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 211, __pyx_L16_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8);
              ++__pyx_t_8;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 211, __pyx_L16_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8));
              #else
              __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8);
              #endif
              ++__pyx_t_8;
            }
            if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 211, __pyx_L16_error)
          } else {
            __pyx_t_7 = __pyx_t_9(__pyx_t_2);
            if (unlikely(!__pyx_t_7)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 211, __pyx_L16_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_XDECREF_SET(__pyx_9genexpr74__pyx_v_g, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "cython/core/fundamental_group.pyx":210
 *                 # of the old ones
 *                 word, moves = moves[:n], moves[n+1:]
 *                 parts = [words[g] if g > 0 else inverse_list_word(words[-g])             # <<<<<<<<<<<<<<
 *                          for g in word]
 *                 words.append(reduce_list_word(sum(parts, [])))
*/
          __pyx_t_6 = PyObject_RichCompare(__pyx_9genexpr74__pyx_v_g, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 210, __pyx_L16_error)
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 210, __pyx_L16_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (__pyx_t_4) {
            __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_9genexpr74__pyx_v_g); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 210, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_7 = __pyx_t_6;
            __pyx_t_6 = 0;
          } else {
            __pyx_t_5 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_inverse_list_word); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 210, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = PyNumber_Negative(__pyx_9genexpr74__pyx_v_g); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 210, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 210, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_3 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_10))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
              assert(__pyx_t_5);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
              __pyx_t_3 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_12};
              __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 210, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __pyx_t_7 = __pyx_t_6;
            __pyx_t_6 = 0;
          }
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(8, 210, __pyx_L16_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "cython/core/fundamental_group.pyx":211
 *                 word, moves = moves[:n], moves[n+1:]
 *                 parts = [words[g] if g > 0 else inverse_list_word(words[-g])
 *                          for g in word]             # <<<<<<<<<<<<<<
 *                 words.append(reduce_list_word(sum(parts, [])))
 *             else:
*/
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_9genexpr74__pyx_v_g); __pyx_9genexpr74__pyx_v_g = 0;
        goto __pyx_L20_exit_scope;
        __pyx_L16_error:;
        __Pyx_XDECREF(__pyx_9genexpr74__pyx_v_g); __pyx_9genexpr74__pyx_v_g = 0;
        goto __pyx_L1_error;
        __pyx_L20_exit_scope:;
      } /* exit inner scope */
      __Pyx_XDECREF_SET(__pyx_v_parts, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":212
 *                 parts = [words[g] if g > 0 else inverse_list_word(words[-g])
 *                          for g in word]
 *                 words.append(reduce_list_word(sum(parts, [])))             # <<<<<<<<<<<<<<
 *             else:
 *                 b = moves.pop(0)
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_reduce_list_word); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_builtin_sum);
      __pyx_t_12 = __pyx_builtin_sum; 
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_parts, __pyx_t_5};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_3 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_words, __pyx_t_1); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(8, 212, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":205
 *         while len(moves) > 0:
 *             a = moves.pop(0)
 *             if a >= len(words):  # new generator added             # <<<<<<<<<<<<<<
 *                 n = moves.index(a)  # end symbol location
 *                 # word is the expression of the new generator in terms
*/
      goto __pyx_L13;
    }

    /* "cython/core/fundamental_group.pyx":214
 *                 words.append(reduce_list_word(sum(parts, [])))
 *             else:
 *                 b = moves.pop(0)             # <<<<<<<<<<<<<<
 *                 if a == b:  # generator removed
 *                     words[a] = words[-1]
*/
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_PopIndex(__pyx_v_moves, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":215
 *             else:
 *                 b = moves.pop(0)
 *                 if a == b:  # generator removed             # <<<<<<<<<<<<<<
 *                     words[a] = words[-1]
 *                     words = words[:-1]
*/
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 215, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 215, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_4) {

        /* "cython/core/fundamental_group.pyx":216
 *                 b = moves.pop(0)
 *                 if a == b:  # generator removed
 *                     words[a] = words[-1]             # <<<<<<<<<<<<<<
 *                     words = words[:-1]
 *                 elif a == -b:  # invert generator
*/
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_words, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely((PyObject_SetItem(__pyx_v_words, __pyx_v_a, __pyx_t_1) < 0))) __PYX_ERR(8, 216, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cython/core/fundamental_group.pyx":217
 *                 if a == b:  # generator removed
 *                     words[a] = words[-1]
 *                     words = words[:-1]             # <<<<<<<<<<<<<<
 *                 elif a == -b:  # invert generator
 *                     words[a] = inverse_list_word(words[a])
*/
        __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_words, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_words, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "cython/core/fundamental_group.pyx":215
 *             else:
 *                 b = moves.pop(0)
 *                 if a == b:  # generator removed             # <<<<<<<<<<<<<<
 *                     words[a] = words[-1]
 *                     words = words[:-1]
*/
        goto __pyx_L21;
      }

      /* "cython/core/fundamental_group.pyx":218
 *                     words[a] = words[-1]
 *                     words = words[:-1]
 *                 elif a == -b:  # invert generator             # <<<<<<<<<<<<<<
 *                     words[a] = inverse_list_word(words[a])
 *                 else:  # handle slide
*/
      __pyx_t_1 = PyNumber_Negative(__pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_a, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_4) {

        /* "cython/core/fundamental_group.pyx":219
 *                     words = words[:-1]
 *                 elif a == -b:  # invert generator
 *                     words[a] = inverse_list_word(words[a])             # <<<<<<<<<<<<<<
 *                 else:  # handle slide
 *                     A, B = words[abs(a)], words[abs(b)]
*/
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_inverse_list_word); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_v_a); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
          __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__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;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 219, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        if (unlikely((PyObject_SetItem(__pyx_v_words, __pyx_v_a, __pyx_t_7) < 0))) __PYX_ERR(8, 219, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cython/core/fundamental_group.pyx":218
 *                     words[a] = words[-1]
 *                     words = words[:-1]
 *                 elif a == -b:  # invert generator             # <<<<<<<<<<<<<<
 *                     words[a] = inverse_list_word(words[a])
 *                 else:  # handle slide
*/
        goto __pyx_L21;
      }

      /* "cython/core/fundamental_group.pyx":221
 *                     words[a] = inverse_list_word(words[a])
 *                 else:  # handle slide
 *                     A, B = words[abs(a)], words[abs(b)]             # <<<<<<<<<<<<<<
 *                     if a*b < 0:
 *                         B = inverse_list_word(B)
*/
      /*else*/ {
        __pyx_t_7 = __Pyx_PyNumber_Absolute(__pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyNumber_Absolute(__pyx_v_b); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_A, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_B, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cython/core/fundamental_group.pyx":222
 *                 else:  # handle slide
 *                     A, B = words[abs(a)], words[abs(b)]
 *                     if a*b < 0:             # <<<<<<<<<<<<<<
 *                         B = inverse_list_word(B)
 *                     words[abs(a)] = reduce_list_word(A+B if a > 0 else B+A)
*/
        __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 222, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 222, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_4) {

          /* "cython/core/fundamental_group.pyx":223
 *                     A, B = words[abs(a)], words[abs(b)]
 *                     if a*b < 0:
 *                         B = inverse_list_word(B)             # <<<<<<<<<<<<<<
 *                     words[abs(a)] = reduce_list_word(A+B if a > 0 else B+A)
 * 
*/
          __pyx_t_2 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_inverse_list_word); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_2);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_B};
            __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 223, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF_SET(__pyx_v_B, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "cython/core/fundamental_group.pyx":222
 *                 else:  # handle slide
 *                     A, B = words[abs(a)], words[abs(b)]
 *                     if a*b < 0:             # <<<<<<<<<<<<<<
 *                         B = inverse_list_word(B)
 *                     words[abs(a)] = reduce_list_word(A+B if a > 0 else B+A)
*/
        }

        /* "cython/core/fundamental_group.pyx":224
 *                     if a*b < 0:
 *                         B = inverse_list_word(B)
 *                     words[abs(a)] = reduce_list_word(A+B if a > 0 else B+A)             # <<<<<<<<<<<<<<
 * 
 *         if as_int_list:
*/
        __pyx_t_7 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_reduce_list_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = PyObject_RichCompare(__pyx_v_a, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 224, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 224, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (__pyx_t_4) {
          __pyx_t_12 = PyNumber_Add(__pyx_v_A, __pyx_v_B); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_1 = __pyx_t_12;
          __pyx_t_12 = 0;
        } else {
          __pyx_t_12 = PyNumber_Add(__pyx_v_B, __pyx_v_A); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_1 = __pyx_t_12;
          __pyx_t_12 = 0;
        }
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__pyx_t_7);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_v_a); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely((PyObject_SetItem(__pyx_v_words, __pyx_t_2, __pyx_t_6) < 0))) __PYX_ERR(8, 224, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_L21:;
    }
    __pyx_L13:;
  }

  /* "cython/core/fundamental_group.pyx":226
 *                     words[abs(a)] = reduce_list_word(A+B if a > 0 else B+A)
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return words[1:]
 *         else:
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_as_int_list); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 226, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/fundamental_group.pyx":227
 * 
 *         if as_int_list:
 *             return words[1:]             # <<<<<<<<<<<<<<
 *         else:
 *             n = self.num_original_generators()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyList_GetSlice(__pyx_v_words, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":226
 *                     words[abs(a)] = reduce_list_word(A+B if a > 0 else B+A)
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return words[1:]
 *         else:
*/
  }

  /* "cython/core/fundamental_group.pyx":229
 *             return words[1:]
 *         else:
 *             n = self.num_original_generators()             # <<<<<<<<<<<<<<
 *             return [ list_as_word(word, n, verbose_form) for word in words[1:]]
 * 
*/
  /*else*/ {
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_original_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/fundamental_group.pyx":230
 *         else:
 *             n = self.num_original_generators()
 *             return [ list_as_word(word, n, verbose_form) for word in words[1:]]             # <<<<<<<<<<<<<<
 * 
 *     def _word_moves(self):
*/
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 230, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_words, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 230, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 230, __pyx_L26_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_8);
        ++__pyx_t_8;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 230, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_9genexpr75__pyx_v_word, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_7 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_list_as_word); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 230, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_7);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_9genexpr75__pyx_v_word, __pyx_v_n, __pyx_v_verbose_form};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 230, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_2))) __PYX_ERR(8, 230, __pyx_L26_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_9genexpr75__pyx_v_word); __pyx_9genexpr75__pyx_v_word = 0;
      goto __pyx_L30_exit_scope;
      __pyx_L26_error:;
      __Pyx_XDECREF(__pyx_9genexpr75__pyx_v_word); __pyx_9genexpr75__pyx_v_word = 0;
      goto __pyx_L1_error;
      __pyx_L30_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/fundamental_group.pyx":177
 *         return orig_gens
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form=False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the current generators in terms of the original
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.generators_in_originals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_moves);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_words);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_word);
  __Pyx_XDECREF(__pyx_v_parts);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_B);
  __Pyx_XDECREF(__pyx_9genexpr73__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr74__pyx_v_g);
  __Pyx_XDECREF(__pyx_9genexpr75__pyx_v_word);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":232
 *             return [ list_as_word(word, n, verbose_form) for word in words[1:]]
 * 
 *     def _word_moves(self):             # <<<<<<<<<<<<<<
 *         cdef int *c_moves
 *         c_moves = fg_get_word_moves(self.c_group_presentation)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_17_word_moves(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_17_word_moves = {"_word_moves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_17_word_moves, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_17_word_moves(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("_word_moves (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_word_moves", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_word_moves", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_16_word_moves(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_16_word_moves(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  int *__pyx_v_c_moves;
  PyObject *__pyx_v_moves = 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("_word_moves", 0);

  /* "cython/core/fundamental_group.pyx":234
 *     def _word_moves(self):
 *         cdef int *c_moves
 *         c_moves = fg_get_word_moves(self.c_group_presentation)             # <<<<<<<<<<<<<<
 *         moves = c_word_as_int_list(c_moves)
 *         fg_free_relation(c_moves)
*/
  __pyx_t_1 = fg_get_word_moves(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 234, __pyx_L1_error)
  __pyx_v_c_moves = __pyx_t_1;

  /* "cython/core/fundamental_group.pyx":235
 *         cdef int *c_moves
 *         c_moves = fg_get_word_moves(self.c_group_presentation)
 *         moves = c_word_as_int_list(c_moves)             # <<<<<<<<<<<<<<
 *         fg_free_relation(c_moves)
 *         return moves
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_c_word_as_int_list(__pyx_v_c_moves); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_moves = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":236
 *         c_moves = fg_get_word_moves(self.c_group_presentation)
 *         moves = c_word_as_int_list(c_moves)
 *         fg_free_relation(c_moves)             # <<<<<<<<<<<<<<
 *         return moves
 * 
*/
  fg_free_relation(__pyx_v_c_moves); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 236, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":237
 *         moves = c_word_as_int_list(c_moves)
 *         fg_free_relation(c_moves)
 *         return moves             # <<<<<<<<<<<<<<
 * 
 *     def generators(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_moves);
  __pyx_r = __pyx_v_moves;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":232
 *             return [ list_as_word(word, n, verbose_form) for word in words[1:]]
 * 
 *     def _word_moves(self):             # <<<<<<<<<<<<<<
 *         cdef int *c_moves
 *         c_moves = fg_get_word_moves(self.c_group_presentation)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup._word_moves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_moves);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":239
 *         return moves
 * 
 *     def generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the letters representing the generators in the presentation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_19generators(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_8SnapPyHP_17CFundamentalGroup_18generators, "\n        Return the letters representing the generators in the presentation.\n\n        >>> M = Manifold('9_42')\n        >>> G = M.fundamental_group() #Presentation simplified by default\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaaabbABBBAbb\n        >>> H = M.fundamental_group(False) #Unsimplified presentation\n        >>> H\n        Generators:\n           a,b,c,d,e\n        Relators:\n           ECbC\n           dEb\n           dAcaB\n           dbaE\n\n        SnapPy stores a FundamentalGroup as a presentation of the group.\n        The following commands demonstrate how generators in the unsimplified\n        and simplified presentations above correspond:\n\n        >>> G.generators()\n        ['a', 'b']\n        >>> H.generators()\n        ['a', 'b', 'c', 'd', 'e']\n        >>> G.generators_in_originals()\n        ['BABcBcbCABcBcbCCbCba', 'BcBCbCbab']\n        >>> G.original_generators()\n        ['BBAbba', 'A', 'AB', 'abba', 'bba']\n        >>> G.num_generators()\n        2\n        >>> G.num_original_generators()\n        5\n        >>> H.num_generators()\n        5\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_19generators = {"generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_19generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_18generators};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_19generators(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("generators (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("generators", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("generators", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_18generators(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_18generators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_9genexpr76__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generators", 0);

  /* "cython/core/fundamental_group.pyx":279
 *         5
 *         """
 *         n = self.num_generators()             # <<<<<<<<<<<<<<
 *         return [ int_to_gen_string(i, n, verbose_form=False)
 *                  for i in range(1, 1+n) ]
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":280
 *         """
 *         n = self.num_generators()
 *         return [ int_to_gen_string(i, n, verbose_form=False)             # <<<<<<<<<<<<<<
 *                  for i in range(1, 1+n) ]
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 280, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/fundamental_group.pyx":281
 *         n = self.num_generators()
 *         return [ int_to_gen_string(i, n, verbose_form=False)
 *                  for i in range(1, 1+n) ]             # <<<<<<<<<<<<<<
 * 
 *     def relators(self, verbose_form = False, as_int_list=False):
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_5 = __pyx_builtin_range; 
    __pyx_t_6 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_v_n, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 281, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_1, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 281, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 281, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 281, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 281, __pyx_L5_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 281, __pyx_L5_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 281, __pyx_L5_error)
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_5);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 281, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_9genexpr76__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/fundamental_group.pyx":280
 *         """
 *         n = self.num_generators()
 *         return [ int_to_gen_string(i, n, verbose_form=False)             # <<<<<<<<<<<<<<
 *                  for i in range(1, 1+n) ]
 * 
*/
      __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_9genexpr76__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 280, __pyx_L5_error)
      __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_v_n); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 280, __pyx_L5_error)
      __pyx_t_2 = __pyx_f_8SnapPyHP_int_to_gen_string(__pyx_t_9, __pyx_t_10, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 280, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(8, 280, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/fundamental_group.pyx":281
 *         n = self.num_generators()
 *         return [ int_to_gen_string(i, n, verbose_form=False)
 *                  for i in range(1, 1+n) ]             # <<<<<<<<<<<<<<
 * 
 *     def relators(self, verbose_form = False, as_int_list=False):
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); __pyx_9genexpr76__pyx_v_i = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); __pyx_9genexpr76__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":239
 *         return moves
 * 
 *     def generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the letters representing the generators in the presentation.
*/

  /* 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("SnapPyHP.CFundamentalGroup.generators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":283
 *                  for i in range(1, 1+n) ]
 * 
 *     def relators(self, verbose_form = False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of words representing the relators in the presentation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_21relators(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_8SnapPyHP_17CFundamentalGroup_20relators, "\n        Return a list of words representing the relators in the presentation.\n\n        If the optional argument verbose_form is True, then the\n        relator is returned in the form \"a*b*a^-1*b^-1\" instead of \"abAB\".\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_21relators = {"relators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_21relators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_20relators};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_21relators(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_verbose_form = 0;
  PyObject *__pyx_v_as_int_list = 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("relators (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_verbose_form,&__pyx_mstate_global->__pyx_n_u_as_int_list,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 283, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "relators", 0) < 0) __PYX_ERR(8, 283, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_verbose_form = values[0];
    __pyx_v_as_int_list = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("relators", 0, 0, 2, __pyx_nargs); __PYX_ERR(8, 283, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.relators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_20relators(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_verbose_form, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_20relators(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_as_int_list) {
  int __pyx_v_n;
  int *__pyx_v_relation;
  int __pyx_v_num_gens;
  PyObject *__pyx_v_relation_list = NULL;
  int __pyx_v_num_relations;
  PyObject *__pyx_v_word = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relators", 0);

  /* "cython/core/fundamental_group.pyx":292
 *         cdef int n
 *         cdef int *relation
 *         cdef int num_gens = self.num_generators()             # <<<<<<<<<<<<<<
 * 
 *         relation_list = []
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_gens = __pyx_t_4;

  /* "cython/core/fundamental_group.pyx":294
 *         cdef int num_gens = self.num_generators()
 * 
 *         relation_list = []             # <<<<<<<<<<<<<<
 *         num_relations = fg_get_num_relations(self.c_group_presentation)
 *         for n from 0 <= n < num_relations:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_relation_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":295
 * 
 *         relation_list = []
 *         num_relations = fg_get_num_relations(self.c_group_presentation)             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < num_relations:
 *             relation = fg_get_relation(self.c_group_presentation, n)
*/
  __pyx_t_4 = fg_get_num_relations(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 295, __pyx_L1_error)
  __pyx_v_num_relations = __pyx_t_4;

  /* "cython/core/fundamental_group.pyx":296
 *         relation_list = []
 *         num_relations = fg_get_num_relations(self.c_group_presentation)
 *         for n from 0 <= n < num_relations:             # <<<<<<<<<<<<<<
 *             relation = fg_get_relation(self.c_group_presentation, n)
 *             if as_int_list:
*/
  __pyx_t_4 = __pyx_v_num_relations;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {

    /* "cython/core/fundamental_group.pyx":297
 *         num_relations = fg_get_num_relations(self.c_group_presentation)
 *         for n from 0 <= n < num_relations:
 *             relation = fg_get_relation(self.c_group_presentation, n)             # <<<<<<<<<<<<<<
 *             if as_int_list:
 *                 word = c_word_as_int_list(relation)
*/
    __pyx_t_5 = fg_get_relation(__pyx_v_self->c_group_presentation, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 297, __pyx_L1_error)
    __pyx_v_relation = __pyx_t_5;

    /* "cython/core/fundamental_group.pyx":298
 *         for n from 0 <= n < num_relations:
 *             relation = fg_get_relation(self.c_group_presentation, n)
 *             if as_int_list:             # <<<<<<<<<<<<<<
 *                 word = c_word_as_int_list(relation)
 *             else:
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_as_int_list); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(8, 298, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/fundamental_group.pyx":299
 *             relation = fg_get_relation(self.c_group_presentation, n)
 *             if as_int_list:
 *                 word = c_word_as_int_list(relation)             # <<<<<<<<<<<<<<
 *             else:
 *                 word = c_word_as_string(relation, num_gens, verbose_form)
*/
      __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_int_list(__pyx_v_relation); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":298
 *         for n from 0 <= n < num_relations:
 *             relation = fg_get_relation(self.c_group_presentation, n)
 *             if as_int_list:             # <<<<<<<<<<<<<<
 *                 word = c_word_as_int_list(relation)
 *             else:
*/
      goto __pyx_L5;
    }

    /* "cython/core/fundamental_group.pyx":301
 *                 word = c_word_as_int_list(relation)
 *             else:
 *                 word = c_word_as_string(relation, num_gens, verbose_form)             # <<<<<<<<<<<<<<
 *             relation_list.append(word)
 *             fg_free_relation(relation)
*/
    /*else*/ {
      __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_string(__pyx_v_relation, __pyx_v_num_gens, __pyx_v_verbose_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "cython/core/fundamental_group.pyx":302
 *             else:
 *                 word = c_word_as_string(relation, num_gens, verbose_form)
 *             relation_list.append(word)             # <<<<<<<<<<<<<<
 *             fg_free_relation(relation)
 *         return relation_list
*/
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_relation_list, __pyx_v_word); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 302, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":303
 *                 word = c_word_as_string(relation, num_gens, verbose_form)
 *             relation_list.append(word)
 *             fg_free_relation(relation)             # <<<<<<<<<<<<<<
 *         return relation_list
 * 
*/
    fg_free_relation(__pyx_v_relation); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 303, __pyx_L1_error)
  }

  /* "cython/core/fundamental_group.pyx":304
 *             relation_list.append(word)
 *             fg_free_relation(relation)
 *         return relation_list             # <<<<<<<<<<<<<<
 * 
 *     def meridian(self, int which_cusp=0, as_int_list=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_relation_list);
  __pyx_r = __pyx_v_relation_list;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":283
 *                  for i in range(1, 1+n) ]
 * 
 *     def relators(self, verbose_form = False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of words representing the relators in the presentation.
*/

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

/* "cython/core/fundamental_group.pyx":306
 *         return relation_list
 * 
 *     def meridian(self, int which_cusp=0, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a word representing a conjugate of the current
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_23meridian(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_8SnapPyHP_17CFundamentalGroup_22meridian, "\n        Returns a word representing a conjugate of the current\n        meridian for the given cusp.  Guaranteed to commute with the\n        longitude for the same cusp.\n\n        >>> G = Manifold('m125').fundamental_group()\n        >>> G.meridian(0)\n        'aaba'\n        >>> G.meridian(-1)  # The last cusp\n        'baaba'\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_23meridian = {"meridian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_23meridian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_22meridian};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_23meridian(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
) {
  int __pyx_v_which_cusp;
  PyObject *__pyx_v_as_int_list = 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("meridian (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_as_int_list,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 306, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "meridian", 0) < 0) __PYX_ERR(8, 306, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    if (values[0]) {
      __pyx_v_which_cusp = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_which_cusp == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 306, __pyx_L3_error)
    } else {
      __pyx_v_which_cusp = ((int)0);
    }
    __pyx_v_as_int_list = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("meridian", 0, 0, 2, __pyx_nargs); __PYX_ERR(8, 306, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.meridian", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_22meridian(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_22meridian(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, int __pyx_v_which_cusp, PyObject *__pyx_v_as_int_list) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("meridian", 0);

  /* "cython/core/fundamental_group.pyx":318
 *         'baaba'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/fundamental_group.pyx":319
 *         """
 *         which_cusp = valid_index(
 *             which_cusp, self.num_cusps,             # <<<<<<<<<<<<<<
 *             'The specified cusp (%s) does not exist.')
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_which_cusp); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_4, __pyx_v_self->num_cusps, __pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "cython/core/fundamental_group.pyx":318
 *         'baaba'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_which_cusp = __pyx_t_6;

  /* "cython/core/fundamental_group.pyx":322
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return c_word_as_int_list(
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
*/
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_as_int_list); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(8, 322, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/fundamental_group.pyx":323
 * 
 *         if as_int_list:
 *             return c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
*/
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":324
 *         if as_int_list:
 *             return c_word_as_int_list(
 *                fg_get_meridian(self.c_group_presentation, which_cusp))             # <<<<<<<<<<<<<<
 *         else:
 *             return c_word_as_string(
*/
    __pyx_t_8 = fg_get_meridian(__pyx_v_self->c_group_presentation, __pyx_v_which_cusp); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 324, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":323
 * 
 *         if as_int_list:
 *             return c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
*/
    __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_int_list(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":322
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return c_word_as_int_list(
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
*/
  }

  /* "cython/core/fundamental_group.pyx":326
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
 *             return c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp),
 *                self.num_generators(),
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":327
 *         else:
 *             return c_word_as_string(
 *                fg_get_meridian(self.c_group_presentation, which_cusp),             # <<<<<<<<<<<<<<
 *                self.num_generators(),
 *                verbose_form = False)
*/
    __pyx_t_8 = fg_get_meridian(__pyx_v_self->c_group_presentation, __pyx_v_which_cusp); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 327, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":328
 *             return c_word_as_string(
 *                fg_get_meridian(self.c_group_presentation, which_cusp),
 *                self.num_generators(),             # <<<<<<<<<<<<<<
 *                verbose_form = False)
 * 
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 328, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":326
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
 *             return c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp),
 *                self.num_generators(),
*/
    __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_string(__pyx_t_8, __pyx_t_6, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/fundamental_group.pyx":306
 *         return relation_list
 * 
 *     def meridian(self, int which_cusp=0, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a word representing a conjugate of the current
*/

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

/* "cython/core/fundamental_group.pyx":331
 *                verbose_form = False)
 * 
 *     def longitude(self, int which_cusp=0, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a word representing a conjugate of the current
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_25longitude(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_8SnapPyHP_17CFundamentalGroup_24longitude, "\n        Returns a word representing a conjugate of the current\n        longitude for the given cusp.  Guaranteed to commute with the\n        meridian for the same cusp.  Note: for Klein bottle cusps,\n        the longitude must be defined carefully.\n\n        >>> G = Manifold('m004').fundamental_group()\n        >>> G.longitude(0)\n        'aBAbABab'\n        >>> G.longitude()   # shortcut for the above.\n        'aBAbABab'\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_25longitude = {"longitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_25longitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_24longitude};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_25longitude(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
) {
  int __pyx_v_which_cusp;
  PyObject *__pyx_v_as_int_list = 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("longitude (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_as_int_list,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 331, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "longitude", 0) < 0) __PYX_ERR(8, 331, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    if (values[0]) {
      __pyx_v_which_cusp = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_which_cusp == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 331, __pyx_L3_error)
    } else {
      __pyx_v_which_cusp = ((int)0);
    }
    __pyx_v_as_int_list = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("longitude", 0, 0, 2, __pyx_nargs); __PYX_ERR(8, 331, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.longitude", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_24longitude(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_24longitude(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, int __pyx_v_which_cusp, PyObject *__pyx_v_as_int_list) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("longitude", 0);

  /* "cython/core/fundamental_group.pyx":344
 *         'aBAbABab'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/fundamental_group.pyx":345
 *         """
 *         which_cusp = valid_index(
 *             which_cusp, self.num_cusps,             # <<<<<<<<<<<<<<
 *             'The specified cusp (%s) does not exist.')
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_which_cusp); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_4, __pyx_v_self->num_cusps, __pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "cython/core/fundamental_group.pyx":344
 *         'aBAbABab'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
*/
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_which_cusp = __pyx_t_6;

  /* "cython/core/fundamental_group.pyx":348
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return c_word_as_int_list(
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
*/
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_as_int_list); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(8, 348, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/fundamental_group.pyx":349
 * 
 *         if as_int_list:
 *             return c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
*/
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":350
 *         if as_int_list:
 *             return c_word_as_int_list(
 *                fg_get_longitude(self.c_group_presentation, which_cusp))             # <<<<<<<<<<<<<<
 *         else:
 *             return c_word_as_string(
*/
    __pyx_t_8 = fg_get_longitude(__pyx_v_self->c_group_presentation, __pyx_v_which_cusp); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 350, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":349
 * 
 *         if as_int_list:
 *             return c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
*/
    __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_int_list(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":348
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return c_word_as_int_list(
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
*/
  }

  /* "cython/core/fundamental_group.pyx":352
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
 *             return c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp),
 *                self.num_generators(),
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":353
 *         else:
 *             return c_word_as_string(
 *                fg_get_longitude(self.c_group_presentation, which_cusp),             # <<<<<<<<<<<<<<
 *                self.num_generators(),
 *                verbose_form = False)
*/
    __pyx_t_8 = fg_get_longitude(__pyx_v_self->c_group_presentation, __pyx_v_which_cusp); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 353, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":354
 *             return c_word_as_string(
 *                fg_get_longitude(self.c_group_presentation, which_cusp),
 *                self.num_generators(),             # <<<<<<<<<<<<<<
 *                verbose_form = False)
 * 
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 354, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":352
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
 *             return c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp),
 *                self.num_generators(),
*/
    __pyx_t_1 = __pyx_f_8SnapPyHP_c_word_as_string(__pyx_t_8, __pyx_t_6, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/fundamental_group.pyx":331
 *                verbose_form = False)
 * 
 *     def longitude(self, int which_cusp=0, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a word representing a conjugate of the current
*/

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

/* "cython/core/fundamental_group.pyx":357
 *                verbose_form = False)
 * 
 *     def peripheral_curves(self, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of meridian-longitude pairs for all cusps.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_27peripheral_curves(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_8SnapPyHP_17CFundamentalGroup_26peripheral_curves, "\n        Returns a list of meridian-longitude pairs for all cusps.\n\n        >>> G = Manifold('m125').fundamental_group()\n        >>> G.peripheral_curves()\n        [('aaba', 'abb'), ('baaba', 'Ba')]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_27peripheral_curves = {"peripheral_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_27peripheral_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_26peripheral_curves};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_27peripheral_curves(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_as_int_list = 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("peripheral_curves (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_as_int_list,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 357, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "peripheral_curves", 0) < 0) __PYX_ERR(8, 357, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_as_int_list = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("peripheral_curves", 0, 0, 1, __pyx_nargs); __PYX_ERR(8, 357, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_26peripheral_curves(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_26peripheral_curves(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_int_list) {
  PyObject *__pyx_9genexpr77__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;
  PyObject *__pyx_t_4 = NULL;
  size_t __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_RefNannySetupContext("peripheral_curves", 0);

  /* "cython/core/fundamental_group.pyx":365
 *         [('aaba', 'abb'), ('baaba', 'Ba')]
 *         """
 *         return [ (self.meridian(n, as_int_list),             # <<<<<<<<<<<<<<
 *                   self.longitude(n, as_int_list))
 *                  for n in range(self.num_cusps) ]
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 365, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/fundamental_group.pyx":367
 *         return [ (self.meridian(n, as_int_list),
 *                   self.longitude(n, as_int_list))
 *                  for n in range(self.num_cusps) ]             # <<<<<<<<<<<<<<
 * 
 *     def magma_string(self):
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_4 = __pyx_builtin_range; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->num_cusps};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 367, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 367, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 367, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 367, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 367, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 367, __pyx_L5_error)
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 367, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_9genexpr77__pyx_v_n, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/fundamental_group.pyx":365
 *         [('aaba', 'abb'), ('baaba', 'Ba')]
 *         """
 *         return [ (self.meridian(n, as_int_list),             # <<<<<<<<<<<<<<
 *                   self.longitude(n, as_int_list))
 *                  for n in range(self.num_cusps) ]
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_9genexpr77__pyx_v_n, __pyx_v_as_int_list};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_meridian, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 365, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
      }

      /* "cython/core/fundamental_group.pyx":366
 *         """
 *         return [ (self.meridian(n, as_int_list),
 *                   self.longitude(n, as_int_list))             # <<<<<<<<<<<<<<
 *                  for n in range(self.num_cusps) ]
 * 
*/
      __pyx_t_8 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_9genexpr77__pyx_v_n, __pyx_v_as_int_list};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_longitude, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 366, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
      }

      /* "cython/core/fundamental_group.pyx":365
 *         [('aaba', 'abb'), ('baaba', 'Ba')]
 *         """
 *         return [ (self.meridian(n, as_int_list),             # <<<<<<<<<<<<<<
 *                   self.longitude(n, as_int_list))
 *                  for n in range(self.num_cusps) ]
*/
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 365, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2) != (0)) __PYX_ERR(8, 365, __pyx_L5_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(8, 365, __pyx_L5_error);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(8, 365, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/fundamental_group.pyx":367
 *         return [ (self.meridian(n, as_int_list),
 *                   self.longitude(n, as_int_list))
 *                  for n in range(self.num_cusps) ]             # <<<<<<<<<<<<<<
 * 
 *     def magma_string(self):
*/
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_n); __pyx_9genexpr77__pyx_v_n = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_n); __pyx_9genexpr77__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":357
 *                verbose_form = False)
 * 
 *     def peripheral_curves(self, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of meridian-longitude pairs for all cusps.
*/

  /* 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_8);
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":369
 *                  for n in range(self.num_cusps) ]
 * 
 *     def magma_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string which will define this group within MAGMA.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_29magma_string(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_8SnapPyHP_17CFundamentalGroup_28magma_string, "\n        Returns a string which will define this group within MAGMA.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_29magma_string = {"magma_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_29magma_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_28magma_string};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_29magma_string(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("magma_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("magma_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("magma_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_28magma_string(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_28magma_string(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("magma_string", 0);

  /* "cython/core/fundamental_group.pyx":373
 *         Returns a string which will define this group within MAGMA.
 *         """
 *         return ('Group<' + ','.join(self.generators()) + '|' +             # <<<<<<<<<<<<<<
 *                 ', '.join(self.relators(verbose_form=True)) + '>')
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__28, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Group, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__34); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":374
 *         """
 *         return ('Group<' + ','.join(self.generators()) + '|' +
 *                 ', '.join(self.relators(verbose_form=True)) + '>')             # <<<<<<<<<<<<<<
 * 
 *     def gap_string(self):
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_verbose_form, Py_True, __pyx_t_5, __pyx_callargs+1, 0) < 0) __PYX_ERR(8, 374, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_relators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":373
 *         Returns a string which will define this group within MAGMA.
 *         """
 *         return ('Group<' + ','.join(self.generators()) + '|' +             # <<<<<<<<<<<<<<
 *                 ', '.join(self.relators(verbose_form=True)) + '>')
 * 
*/
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/fundamental_group.pyx":374
 *         """
 *         return ('Group<' + ','.join(self.generators()) + '|' +
 *                 ', '.join(self.relators(verbose_form=True)) + '>')             # <<<<<<<<<<<<<<
 * 
 *     def gap_string(self):
*/
  __pyx_t_5 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__26); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":369
 *                  for n in range(self.num_cusps) ]
 * 
 *     def magma_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string which will define this group within MAGMA.
*/

  /* 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_AddTraceback("SnapPyHP.CFundamentalGroup.magma_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":376
 *                 ', '.join(self.relators(verbose_form=True)) + '>')
 * 
 *     def gap_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string which will define this group within GAP:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_31gap_string(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_8SnapPyHP_17CFundamentalGroup_30gap_string, "\n        Returns a string which will define this group within GAP:\n\n        >>> M = Manifold('b++LLR')\n        >>> G = M.fundamental_group()\n        >>> G\n        Generators:\n           a,b\n        Relators:\n           aaaaBAbbAB\n        >>> G.gap_string()\n        'CallFuncList(function() local F, a, b; F := FreeGroup(\"a\", \"b\"); a := F.1; b := F.2;   return F/[a*a*a*a*b^-1*a^-1*b*b*a^-1*b^-1]; end,[])'\n        >>> G.magma_string()\n        'Group<a,b|a*a*a*a*b^-1*a^-1*b*b*a^-1*b^-1>'\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_31gap_string = {"gap_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_31gap_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_30gap_string};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_31gap_string(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("gap_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("gap_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("gap_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_30gap_string(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_30gap_string(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_v_gens = NULL;
  PyObject *__pyx_v_gen_names = NULL;
  PyObject *__pyx_v_relators = NULL;
  PyObject *__pyx_v_assignments = NULL;
  PyObject *__pyx_9genexpr78__pyx_v_x = NULL;
  PyObject *__pyx_9genexpr79__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr79__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  PyObject *__pyx_t_11[9];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gap_string", 0);

  /* "cython/core/fundamental_group.pyx":392
 *         'Group<a,b|a*a*a*a*b^-1*a^-1*b*b*a^-1*b^-1>'
 *         """
 *         gens = ', '.join(self.generators())             # <<<<<<<<<<<<<<
 *         gen_names = ', '.join(['"' + x + '"' for x in self.generators()])
 *         relators = ', '.join(self.relators(verbose_form=True))
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_gens = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":393
 *         """
 *         gens = ', '.join(self.generators())
 *         gen_names = ', '.join(['"' + x + '"' for x in self.generators()])             # <<<<<<<<<<<<<<
 *         relators = ', '.join(self.relators(verbose_form=True))
 *         assignments = ''.join(
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 393, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 393, __pyx_L5_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_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 393, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 393, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 393, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_5);
          ++__pyx_t_5;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 393, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5));
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 393, __pyx_L5_error)
      } else {
        __pyx_t_1 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 393, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_9genexpr78__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u__35, __pyx_9genexpr78__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 393, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__35); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 393, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(8, 393, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr78__pyx_v_x); __pyx_9genexpr78__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr78__pyx_v_x); __pyx_9genexpr78__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_gen_names = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/fundamental_group.pyx":394
 *         gens = ', '.join(self.generators())
 *         gen_names = ', '.join(['"' + x + '"' for x in self.generators()])
 *         relators = ', '.join(self.relators(verbose_form=True))             # <<<<<<<<<<<<<<
 *         assignments = ''.join(
 *             ['%s := F.%d; ' % (x, i+1)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_verbose_form, Py_True, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(8, 394, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_relators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_relators = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "cython/core/fundamental_group.pyx":395
 *         gen_names = ', '.join(['"' + x + '"' for x in self.generators()])
 *         relators = ', '.join(self.relators(verbose_form=True))
 *         assignments = ''.join(             # <<<<<<<<<<<<<<
 *             ['%s := F.%d; ' % (x, i+1)
 *              for (i, x) in enumerate(self.generators())]
*/
  { /* enter inner scope */

    /* "cython/core/fundamental_group.pyx":396
 *         relators = ', '.join(self.relators(verbose_form=True))
 *         assignments = ''.join(
 *             ['%s := F.%d; ' % (x, i+1)             # <<<<<<<<<<<<<<
 *              for (i, x) in enumerate(self.generators())]
 *             )
*/
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 396, __pyx_L12_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_4 = __pyx_mstate_global->__pyx_int_0;

    /* "cython/core/fundamental_group.pyx":397
 *         assignments = ''.join(
 *             ['%s := F.%d; ' % (x, i+1)
 *              for (i, x) in enumerate(self.generators())]             # <<<<<<<<<<<<<<
 *             )
 *         return ('CallFuncList(function() local F, %s; '
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_generators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 397, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 397, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 397, __pyx_L12_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 397, __pyx_L12_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5);
          ++__pyx_t_5;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 397, __pyx_L12_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 397, __pyx_L12_error)
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 397, __pyx_L12_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_9genexpr79__pyx_v_x, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr79__pyx_v_i, __pyx_t_4);
      __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 397, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cython/core/fundamental_group.pyx":396
 *         relators = ', '.join(self.relators(verbose_form=True))
 *         assignments = ''.join(
 *             ['%s := F.%d; ' % (x, i+1)             # <<<<<<<<<<<<<<
 *              for (i, x) in enumerate(self.generators())]
 *             )
*/
      __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_9genexpr79__pyx_v_x), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 396, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_9genexpr79__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 396, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 396, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10[0] = __pyx_t_2;
      __pyx_t_10[1] = __pyx_mstate_global->__pyx_kp_u_F;
      __pyx_t_10[2] = __pyx_t_9;
      __pyx_t_10[3] = __pyx_mstate_global->__pyx_kp_u__36;
      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
      if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 396, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(8, 396, __pyx_L12_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/fundamental_group.pyx":397
 *         assignments = ''.join(
 *             ['%s := F.%d; ' % (x, i+1)
 *              for (i, x) in enumerate(self.generators())]             # <<<<<<<<<<<<<<
 *             )
 *         return ('CallFuncList(function() local F, %s; '
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_i); __pyx_9genexpr79__pyx_v_i = 0;
    __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_x); __pyx_9genexpr79__pyx_v_x = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_i); __pyx_9genexpr79__pyx_v_i = 0;
    __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_x); __pyx_9genexpr79__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */

  /* "cython/core/fundamental_group.pyx":395
 *         gen_names = ', '.join(['"' + x + '"' for x in self.generators()])
 *         relators = ', '.join(self.relators(verbose_form=True))
 *         assignments = ''.join(             # <<<<<<<<<<<<<<
 *             ['%s := F.%d; ' % (x, i+1)
 *              for (i, x) in enumerate(self.generators())]
*/
  __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__10, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_assignments = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/fundamental_group.pyx":399
 *              for (i, x) in enumerate(self.generators())]
 *             )
 *         return ('CallFuncList(function() local F, %s; '             # <<<<<<<<<<<<<<
 *                 'F := FreeGroup(%s); %s  return F/[%s]; end,[])'
 *                 % (gens, gen_names, assignments, relators)
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/fundamental_group.pyx":401
 *         return ('CallFuncList(function() local F, %s; '
 *                 'F := FreeGroup(%s); %s  return F/[%s]; end,[])'
 *                 % (gens, gen_names, assignments, relators)             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_gens); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_gen_names); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_relators); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_CallFuncList_function_local_F;
  __pyx_t_11[1] = __pyx_t_4;
  __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_F_FreeGroup;
  __pyx_t_11[3] = __pyx_t_7;
  __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__37;
  __pyx_t_11[5] = __pyx_t_1;
  __pyx_t_11[6] = __pyx_mstate_global->__pyx_kp_u_return_F;
  __pyx_t_11[7] = __pyx_t_8;
  __pyx_t_11[8] = __pyx_mstate_global->__pyx_kp_u_end;

  /* "cython/core/fundamental_group.pyx":399
 *              for (i, x) in enumerate(self.generators())]
 *             )
 *         return ('CallFuncList(function() local F, %s; '             # <<<<<<<<<<<<<<
 *                 'F := FreeGroup(%s); %s  return F/[%s]; end,[])'
 *                 % (gens, gen_names, assignments, relators)
*/
  __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_11, 9, 33 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 10, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
  if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":376
 *                 ', '.join(self.relators(verbose_form=True)) + '>')
 * 
 *     def gap_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string which will define this group within GAP:
*/

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.gap_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_gens);
  __Pyx_XDECREF(__pyx_v_gen_names);
  __Pyx_XDECREF(__pyx_v_relators);
  __Pyx_XDECREF(__pyx_v_assignments);
  __Pyx_XDECREF(__pyx_9genexpr78__pyx_v_x);
  __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":404
 *                 )
 * 
 *     def _gap_init_(self):             # <<<<<<<<<<<<<<
 *         return self.gap_string()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_33_gap_init_(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_33_gap_init_ = {"_gap_init_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_33_gap_init_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_33_gap_init_(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("_gap_init_ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_gap_init_", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_gap_init_", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_32_gap_init_(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_32_gap_init_(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_gap_init_", 0);

  /* "cython/core/fundamental_group.pyx":405
 * 
 *     def _gap_init_(self):
 *         return self.gap_string()             # <<<<<<<<<<<<<<
 * 
 *     def _magma_init_(self, magma):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_gap_string, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":404
 *                 )
 * 
 *     def _gap_init_(self):             # <<<<<<<<<<<<<<
 *         return self.gap_string()
 * 
*/

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

/* "cython/core/fundamental_group.pyx":407
 *         return self.gap_string()
 * 
 *     def _magma_init_(self, magma):             # <<<<<<<<<<<<<<
 *         return self.magma_string()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_35_magma_init_(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_35_magma_init_ = {"_magma_init_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_35_magma_init_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_35_magma_init_(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_magma = 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("_magma_init_ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_magma,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 407, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_magma_init_", 0) < 0) __PYX_ERR(8, 407, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_magma_init_", 1, 1, 1, i); __PYX_ERR(8, 407, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 407, __pyx_L3_error)
    }
    __pyx_v_magma = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_magma_init_", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 407, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup._magma_init_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_34_magma_init_(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_magma);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_34_magma_init_(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_magma) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_magma_init_", 0);

  /* "cython/core/fundamental_group.pyx":408
 * 
 *     def _magma_init_(self, magma):
 *         return self.magma_string()             # <<<<<<<<<<<<<<
 * 
 *     def sage(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_magma_string, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":407
 *         return self.gap_string()
 * 
 *     def _magma_init_(self, magma):             # <<<<<<<<<<<<<<
 *         return self.magma_string()
 * 
*/

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

/* "cython/core/fundamental_group.pyx":410
 *         return self.magma_string()
 * 
 *     def sage(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the corresponding Sage FinitelyPresentedGroup
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_37sage(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_8SnapPyHP_17CFundamentalGroup_36sage, "\n        Returns the corresponding Sage FinitelyPresentedGroup\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_37sage = {"sage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_37sage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_36sage};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_37sage(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("sage (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sage", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sage", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_36sage(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_36sage(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_v_F = NULL;
  PyObject *__pyx_v_rels = NULL;
  PyObject *__pyx_9genexpr80__pyx_v_R = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sage", 0);

  /* "cython/core/fundamental_group.pyx":414
 *         Returns the corresponding Sage FinitelyPresentedGroup
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Not within Sage")
 *         F = FreeGroup(self.generators())
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 414, __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(8, 414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/fundamental_group.pyx":415
 *         """
 *         if not _within_sage:
 *             raise RuntimeError("Not within Sage")             # <<<<<<<<<<<<<<
 *         F = FreeGroup(self.generators())
 *         rels = [F(R) for R in self.relators(as_int_list=True)]
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_5 = __pyx_builtin_RuntimeError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Not_within_Sage};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(8, 415, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":414
 *         Returns the corresponding Sage FinitelyPresentedGroup
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Not within Sage")
 *         F = FreeGroup(self.generators())
*/
  }

  /* "cython/core/fundamental_group.pyx":416
 *         if not _within_sage:
 *             raise RuntimeError("Not within Sage")
 *         F = FreeGroup(self.generators())             # <<<<<<<<<<<<<<
 *         rels = [F(R) for R in self.relators(as_int_list=True)]
 *         return F/rels
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FreeGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_generators, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_F = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":417
 *             raise RuntimeError("Not within Sage")
 *         F = FreeGroup(self.generators())
 *         rels = [F(R) for R in self.relators(as_int_list=True)]             # <<<<<<<<<<<<<<
 *         return F/rels
 * 
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 417, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 417, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_as_int_list, Py_True, __pyx_t_5, __pyx_callargs+1, 0) < 0) __PYX_ERR(8, 417, __pyx_L6_error)
      __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_relators, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 417, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 417, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 417, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 417, __pyx_L6_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_9);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 417, __pyx_L6_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 417, __pyx_L6_error)
      } else {
        __pyx_t_4 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(8, 417, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr80__pyx_v_R, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_F);
      __pyx_t_8 = __pyx_v_F; 
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_9genexpr80__pyx_v_R};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 417, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(8, 417, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr80__pyx_v_R); __pyx_9genexpr80__pyx_v_R = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr80__pyx_v_R); __pyx_9genexpr80__pyx_v_R = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_v_rels = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":418
 *         F = FreeGroup(self.generators())
 *         rels = [F(R) for R in self.relators(as_int_list=True)]
 *         return F/rels             # <<<<<<<<<<<<<<
 * 
 *     def character_variety_vars_and_polys(self, as_ideal=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_F, __pyx_v_rels); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":410
 *         return self.magma_string()
 * 
 *     def sage(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the corresponding Sage FinitelyPresentedGroup
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.sage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_F);
  __Pyx_XDECREF(__pyx_v_rels);
  __Pyx_XDECREF(__pyx_9genexpr80__pyx_v_R);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":420
 *         return F/rels
 * 
 *     def character_variety_vars_and_polys(self, as_ideal=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of variables and a list polynomials where the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_39character_variety_vars_and_polys(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_8SnapPyHP_17CFundamentalGroup_38character_variety_vars_and_polys, "\n        Returns a list of variables and a list polynomials where the\n        polynomials generate the ideal defining the SL(2, C) character\n        variety of this group.  Each variable is of the form \"Tw\" where\n        \"w\" is a word in the generators and \"Tw\" represents the trace\n        function of that word.\n\n        >>> H = Manifold('dLQacccbjkg')  # Hopf link exterior.\n        >>> G = H.fundamental_group()\n        >>> vars, polys = G.character_variety_vars_and_polys()\n        >>> vars\n        [Ta, Tb, Tab]\n        >>> polys    # doctest: +NORMALIZE_WHITESPACE\n        [Ta^3 - Tab*Tb*Ta^2 + (Tb^2 + (Tab^2 - 4))*Ta,\n         Ta^2 - Tab*Tb*Ta + (Tb^2 + (Tab^2 - 4))]\n\n        When used inside Sage, you can ask for the answer as a proper\n        ideal::\n\n          sage: M = Manifold('m000')  # Gieseking manifold\n          sage: G = M.fundamental_group()\n          sage: I = G.character_variety_vars_and_polys(as_ideal=True)\n          sage: I\n          Ideal (-Ta^3*Tb^2*Tab + Ta^4*Tb + Ta^2*Tb^3 + Ta^2*Tb*Tab^2 + Ta*Tb^2*Tab - 5*Ta^2*Tb - Tb^3 - Tb*Tab^2 + Ta*Tab - Ta + 3*Tb, Tb*Tab - Ta - Tb, -Ta^2*Tb^2*Tab + Ta^3*Tb + Ta*Tb^3 + Ta*Tb*Tab^2 - 4*Ta*Tb + Tab - 2) of Multivariate Polynomial Ring in Ta, Tb, Tab over Rational Field\n          sage: I.dimension()\n          1\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_39character_variety_vars_and_polys = {"character_variety_vars_and_polys", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_39character_variety_vars_and_polys, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_38character_variety_vars_and_polys};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_39character_variety_vars_and_polys(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_as_ideal = 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("character_variety_vars_and_polys (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_as_ideal,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 420, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "character_variety_vars_and_polys", 0) < 0) __PYX_ERR(8, 420, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_as_ideal = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("character_variety_vars_and_polys", 0, 0, 1, __pyx_nargs); __PYX_ERR(8, 420, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.character_variety_vars_and_polys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_38character_variety_vars_and_polys(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v_as_ideal);

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_38character_variety_vars_and_polys(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_ideal) {
  PyObject *__pyx_v_presentation = NULL;
  PyObject *__pyx_v_ans = 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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("character_variety_vars_and_polys", 0);

  /* "cython/core/fundamental_group.pyx":449
 * 
 *         """
 *         if not as_ideal:             # <<<<<<<<<<<<<<
 *             presentation = snap.character_variety(self)
 *             ans = presentation.gens, presentation.rels
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_as_ideal); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 449, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "cython/core/fundamental_group.pyx":450
 *         """
 *         if not as_ideal:
 *             presentation = snap.character_variety(self)             # <<<<<<<<<<<<<<
 *             ans = presentation.gens, presentation.rels
 *         else:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_snap); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_character_variety); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 450, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_presentation = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/fundamental_group.pyx":451
 *         if not as_ideal:
 *             presentation = snap.character_variety(self)
 *             ans = presentation.gens, presentation.rels             # <<<<<<<<<<<<<<
 *         else:
 *             if not _within_sage:
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_presentation, __pyx_mstate_global->__pyx_n_u_gens); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_presentation, __pyx_mstate_global->__pyx_n_u_rels); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(8, 451, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6) != (0)) __PYX_ERR(8, 451, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __pyx_v_ans = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/fundamental_group.pyx":449
 * 
 *         """
 *         if not as_ideal:             # <<<<<<<<<<<<<<
 *             presentation = snap.character_variety(self)
 *             ans = presentation.gens, presentation.rels
*/
    goto __pyx_L3;
  }

  /* "cython/core/fundamental_group.pyx":453
 *             ans = presentation.gens, presentation.rels
 *         else:
 *             if not _within_sage:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 453, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (!__pyx_t_2);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/fundamental_group.pyx":454
 *         else:
 *             if not _within_sage:
 *                 raise RuntimeError("Not within Sage")             # <<<<<<<<<<<<<<
 *             ans = snap.character_variety_ideal(self)
 *         return ans
*/
      __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_builtin_RuntimeError);
      __pyx_t_3 = __pyx_builtin_RuntimeError; 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Not_within_Sage};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(8, 454, __pyx_L1_error)

      /* "cython/core/fundamental_group.pyx":453
 *             ans = presentation.gens, presentation.rels
 *         else:
 *             if not _within_sage:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)
*/
    }

    /* "cython/core/fundamental_group.pyx":455
 *             if not _within_sage:
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)             # <<<<<<<<<<<<<<
 *         return ans
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_snap); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_character_variety_ideal); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_v_ans = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "cython/core/fundamental_group.pyx":456
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)
 *         return ans             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":420
 *         return F/rels
 * 
 *     def character_variety_vars_and_polys(self, as_ideal=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of variables and a list polynomials where the
*/

  /* 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("SnapPyHP.CFundamentalGroup.character_variety_vars_and_polys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_presentation);
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":106
 *     cdef c_GroupPresentation *c_group_presentation
 *     cdef c_Triangulation *c_triangulation
 *     cdef readonly num_cusps             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Triangulation triangulation,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_9num_cusps_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_9num_cusps_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_8SnapPyHP_17CFundamentalGroup_9num_cusps___get__(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CFundamentalGroup_9num_cusps___get__(struct __pyx_obj_8SnapPyHP_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->num_cusps);
  __pyx_r = __pyx_v_self->num_cusps;
  goto __pyx_L0;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_41__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_41__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_41__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_41__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_40__reduce_cython__(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self));

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_43__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CFundamentalGroup_43__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_43__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CFundamentalGroup_43__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
) {
  CYTHON_UNUSED 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CFundamentalGroup.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CFundamentalGroup_42__setstate_cython__(((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)__pyx_v_self), __pyx_v___pyx_state);

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

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

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

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

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

/* "cython/core/fundamental_group.pyx":486
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):
 *     def _matrix(self, word, group):             # <<<<<<<<<<<<<<
 *         """
 *         Returns  SL2C(word) if group == 'M' or O31(word) if group == 'O'
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_1_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_8SnapPyHP_14CHolonomyGroup__matrix, "\n        Returns  SL2C(word) if group == 'M' or O31(word) if group == 'O'\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_14CHolonomyGroup_1_matrix = {"_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_1_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup__matrix};
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_1_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
) {
  PyObject *__pyx_v_word = 0;
  PyObject *__pyx_v_group = 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("_matrix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word,&__pyx_mstate_global->__pyx_n_u_group,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 486, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_matrix", 0) < 0) __PYX_ERR(8, 486, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_matrix", 1, 2, 2, i); __PYX_ERR(8, 486, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 486, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 486, __pyx_L3_error)
    }
    __pyx_v_word = values[0];
    __pyx_v_group = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_matrix", 1, 2, 2, __pyx_nargs); __PYX_ERR(8, 486, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CHolonomyGroup._matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14CHolonomyGroup__matrix(((struct __pyx_obj_8SnapPyHP_CHolonomyGroup *)__pyx_v_self), __pyx_v_word, __pyx_v_group);

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

static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup__matrix(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word, PyObject *__pyx_v_group) {
  int *__pyx_v_c_word;
  FuncResult __pyx_v_result;
  PyObject *__pyx_v_word_list = NULL;
  O31Matrix __pyx_v_O;
  MoebiusTransformation __pyx_v_M;
  int __pyx_9genexpr81__pyx_v_i;
  int __pyx_9genexpr82__pyx_v_j;
  int __pyx_9genexpr83__pyx_v_i;
  int __pyx_9genexpr84__pyx_v_j;
  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;
  size_t __pyx_t_6;
  int *__pyx_t_7;
  int __pyx_t_8;
  FuncResult __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_matrix", 0);

  /* "cython/core/fundamental_group.pyx":493
 *         cdef c_FuncResult result
 *         cdef int i, j
 *         word_list = word_as_list(word, self.num_generators())             # <<<<<<<<<<<<<<
 *         c_word = c_word_from_list(word_list)
 *         cdef O31Matrix O
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_word_as_list); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_word, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_word_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":494
 *         cdef int i, j
 *         word_list = word_as_list(word, self.num_generators())
 *         c_word = c_word_from_list(word_list)             # <<<<<<<<<<<<<<
 *         cdef O31Matrix O
 *         cdef MoebiusTransformation M
*/
  __pyx_t_7 = __pyx_f_8SnapPyHP_c_word_from_list(__pyx_v_word_list); if (unlikely(__pyx_t_7 == ((int *)0) && PyErr_Occurred())) __PYX_ERR(8, 494, __pyx_L1_error)
  __pyx_v_c_word = __pyx_t_7;

  /* "cython/core/fundamental_group.pyx":497
 *         cdef O31Matrix O
 *         cdef MoebiusTransformation M
 *         if group == 'M':             # <<<<<<<<<<<<<<
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *             if result == 0:
*/
  __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_group, __pyx_mstate_global->__pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(8, 497, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "cython/core/fundamental_group.pyx":498
 *         cdef MoebiusTransformation M
 *         if group == 'M':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)             # <<<<<<<<<<<<<<
 *             if result == 0:
 *                 return matrix(
*/
    __pyx_t_9 = fg_word_to_matrix(__pyx_v_self->__pyx_base.c_group_presentation, __pyx_v_c_word, NULL, (&__pyx_v_M)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 498, __pyx_L1_error)
    __pyx_v_result = __pyx_t_9;

    /* "cython/core/fundamental_group.pyx":499
 *         if group == 'M':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *             if result == 0:             # <<<<<<<<<<<<<<
 *                 return matrix(
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))
*/
    __pyx_t_8 = (__pyx_v_result == 0);
    if (__pyx_t_8) {

      /* "cython/core/fundamental_group.pyx":500
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *             if result == 0:
 *                 return matrix(             # <<<<<<<<<<<<<<
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))
 *                       for j in range(2)] for i in range(2)] )
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      { /* enter inner scope */

        /* "cython/core/fundamental_group.pyx":501
 *             if result == 0:
 *                 return matrix(
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))             # <<<<<<<<<<<<<<
 *                       for j in range(2)] for i in range(2)] )
 *         elif group == 'O':
*/
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);

        /* "cython/core/fundamental_group.pyx":502
 *                 return matrix(
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))
 *                       for j in range(2)] for i in range(2)] )             # <<<<<<<<<<<<<<
 *         elif group == 'O':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)
*/
        for (__pyx_t_10 = 0; __pyx_t_10 < 2; __pyx_t_10+=1) {
          __pyx_9genexpr81__pyx_v_i = __pyx_t_10;
          { /* enter inner scope */

            /* "cython/core/fundamental_group.pyx":501
 *             if result == 0:
 *                 return matrix(
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))             # <<<<<<<<<<<<<<
 *                       for j in range(2)] for i in range(2)] )
 *         elif group == 'O':
*/
            __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 501, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);

            /* "cython/core/fundamental_group.pyx":502
 *                 return matrix(
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))
 *                       for j in range(2)] for i in range(2)] )             # <<<<<<<<<<<<<<
 *         elif group == 'O':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)
*/
            for (__pyx_t_11 = 0; __pyx_t_11 < 2; __pyx_t_11+=1) {
              __pyx_9genexpr82__pyx_v_j = __pyx_t_11;

              /* "cython/core/fundamental_group.pyx":501
 *             if result == 0:
 *                 return matrix(
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))             # <<<<<<<<<<<<<<
 *                       for j in range(2)] for i in range(2)] )
 *         elif group == 'O':
*/
              __pyx_t_13 = ((PyObject *)__pyx_v_self);
              __Pyx_INCREF(__pyx_t_13);
              __pyx_t_14 = __pyx_f_8SnapPyHP_Complex2Number(((__pyx_v_M.matrix[__pyx_9genexpr81__pyx_v_i])[__pyx_9genexpr82__pyx_v_j])); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 501, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_6 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
                __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 501, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_12);
              }
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_12))) __PYX_ERR(8, 501, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          } /* exit inner scope */
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(8, 501, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      } /* exit inner scope */
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 500, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cython/core/fundamental_group.pyx":499
 *         if group == 'M':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *             if result == 0:             # <<<<<<<<<<<<<<
 *                 return matrix(
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))
*/
    }

    /* "cython/core/fundamental_group.pyx":497
 *         cdef O31Matrix O
 *         cdef MoebiusTransformation M
 *         if group == 'M':             # <<<<<<<<<<<<<<
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *             if result == 0:
*/
    goto __pyx_L3;
  }

  /* "cython/core/fundamental_group.pyx":503
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))
 *                       for j in range(2)] for i in range(2)] )
 *         elif group == 'O':             # <<<<<<<<<<<<<<
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)
 *             if result == 0:
*/
  __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_group, __pyx_mstate_global->__pyx_n_u_O, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(8, 503, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "cython/core/fundamental_group.pyx":504
 *                       for j in range(2)] for i in range(2)] )
 *         elif group == 'O':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)             # <<<<<<<<<<<<<<
 *             if result == 0:
 *                 return matrix(
*/
    __pyx_t_9 = fg_word_to_matrix(__pyx_v_self->__pyx_base.c_group_presentation, __pyx_v_c_word, __pyx_v_O, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 504, __pyx_L1_error)
    __pyx_v_result = __pyx_t_9;

    /* "cython/core/fundamental_group.pyx":505
 *         elif group == 'O':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)
 *             if result == 0:             # <<<<<<<<<<<<<<
 *                 return matrix(
 *                     [[self._number_(Real2Number(<Real>O[i][j]))
*/
    __pyx_t_8 = (__pyx_v_result == 0);
    if (__pyx_t_8) {

      /* "cython/core/fundamental_group.pyx":506
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)
 *             if result == 0:
 *                 return matrix(             # <<<<<<<<<<<<<<
 *                     [[self._number_(Real2Number(<Real>O[i][j]))
 *                       for j in range(4)] for i in range(4)] )
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      { /* enter inner scope */

        /* "cython/core/fundamental_group.pyx":507
 *             if result == 0:
 *                 return matrix(
 *                     [[self._number_(Real2Number(<Real>O[i][j]))             # <<<<<<<<<<<<<<
 *                       for j in range(4)] for i in range(4)] )
 *         else:
*/
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 507, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);

        /* "cython/core/fundamental_group.pyx":508
 *                 return matrix(
 *                     [[self._number_(Real2Number(<Real>O[i][j]))
 *                       for j in range(4)] for i in range(4)] )             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
        for (__pyx_t_10 = 0; __pyx_t_10 < 4; __pyx_t_10+=1) {
          __pyx_9genexpr83__pyx_v_i = __pyx_t_10;
          { /* enter inner scope */

            /* "cython/core/fundamental_group.pyx":507
 *             if result == 0:
 *                 return matrix(
 *                     [[self._number_(Real2Number(<Real>O[i][j]))             # <<<<<<<<<<<<<<
 *                       for j in range(4)] for i in range(4)] )
 *         else:
*/
            __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 507, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);

            /* "cython/core/fundamental_group.pyx":508
 *                 return matrix(
 *                     [[self._number_(Real2Number(<Real>O[i][j]))
 *                       for j in range(4)] for i in range(4)] )             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
            for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
              __pyx_9genexpr84__pyx_v_j = __pyx_t_11;

              /* "cython/core/fundamental_group.pyx":507
 *             if result == 0:
 *                 return matrix(
 *                     [[self._number_(Real2Number(<Real>O[i][j]))             # <<<<<<<<<<<<<<
 *                       for j in range(4)] for i in range(4)] )
 *         else:
*/
              __pyx_t_14 = ((PyObject *)__pyx_v_self);
              __Pyx_INCREF(__pyx_t_14);
              __pyx_t_13 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)((__pyx_v_O[__pyx_9genexpr83__pyx_v_i])[__pyx_9genexpr84__pyx_v_j]))); if (unlikely(!__pyx_t_13)) __PYX_ERR(8, 507, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_6 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13};
                __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 507, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_12);
              }
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_12))) __PYX_ERR(8, 507, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          } /* exit inner scope */
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(8, 507, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      } /* exit inner scope */
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 506, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cython/core/fundamental_group.pyx":505
 *         elif group == 'O':
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)
 *             if result == 0:             # <<<<<<<<<<<<<<
 *                 return matrix(
 *                     [[self._number_(Real2Number(<Real>O[i][j]))
*/
    }

    /* "cython/core/fundamental_group.pyx":503
 *                     [[self._number_(Complex2Number(M.matrix[i][j]))
 *                       for j in range(2)] for i in range(2)] )
 *         elif group == 'O':             # <<<<<<<<<<<<<<
 *             result = fg_word_to_matrix(self.c_group_presentation, c_word, O, NULL)
 *             if result == 0:
*/
    goto __pyx_L3;
  }

  /* "cython/core/fundamental_group.pyx":510
 *                       for j in range(4)] for i in range(4)] )
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def SL2C(self, word : str):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cython/core/fundamental_group.pyx":486
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):
 *     def _matrix(self, word, group):             # <<<<<<<<<<<<<<
 *         """
 *         Returns  SL2C(word) if group == 'M' or O31(word) if group == 'O'
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.CHolonomyGroup._matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_word_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":512
 *             return None
 * 
 *     def SL2C(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_3SL2C(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_8SnapPyHP_14CHolonomyGroup_2SL2C, "\n        Return the image of the element represented by the input word\n        under some :math:`\\text{SL}(2,\\mathbb{C})`-representation that\n        lifts the holonomy representation.\n        Note: the choice of lift is not guaranteed to\n        vary continuously when filling coefficients are changed.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_14CHolonomyGroup_3SL2C = {"SL2C", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_3SL2C, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup_2SL2C};
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_3SL2C(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_word = 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("SL2C (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 512, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 512, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "SL2C", 0) < 0) __PYX_ERR(8, 512, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("SL2C", 1, 1, 1, i); __PYX_ERR(8, 512, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 512, __pyx_L3_error)
    }
    __pyx_v_word = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("SL2C", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 512, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CHolonomyGroup.SL2C", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyUnicode_Type), 0, "word", 2))) __PYX_ERR(8, 512, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_14CHolonomyGroup_2SL2C(((struct __pyx_obj_8SnapPyHP_CHolonomyGroup *)__pyx_v_self), __pyx_v_word);

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

static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_2SL2C(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SL2C", 0);

  /* "cython/core/fundamental_group.pyx":520
 *         vary continuously when filling coefficients are changed.
 *         """
 *         return self._matrix(word, 'M')             # <<<<<<<<<<<<<<
 * 
 *     def O31(self, word : str):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_word, __pyx_mstate_global->__pyx_n_u_M};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_matrix_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":512
 *             return None
 * 
 *     def SL2C(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
*/

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

/* "cython/core/fundamental_group.pyx":522
 *         return self._matrix(word, 'M')
 * 
 *     def O31(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_5O31(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_8SnapPyHP_14CHolonomyGroup_4O31, "\n        Return the image of the element represented by the input word\n        under the holonomy representation, where\n        :math:`\\text{Isom}(\\mathbb{H}^3)` is\n        identified with :math:`\\text{SO}(3,1)`.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_14CHolonomyGroup_5O31 = {"O31", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_5O31, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup_4O31};
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_5O31(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_word = 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("O31 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 522, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "O31", 0) < 0) __PYX_ERR(8, 522, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("O31", 1, 1, 1, i); __PYX_ERR(8, 522, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 522, __pyx_L3_error)
    }
    __pyx_v_word = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("O31", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 522, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CHolonomyGroup.O31", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyUnicode_Type), 0, "word", 2))) __PYX_ERR(8, 522, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_14CHolonomyGroup_4O31(((struct __pyx_obj_8SnapPyHP_CHolonomyGroup *)__pyx_v_self), __pyx_v_word);

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

static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_4O31(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("O31", 0);

  /* "cython/core/fundamental_group.pyx":529
 *         identified with :math:`\\text{SO}(3,1)`.
 *         """
 *         return self._matrix(word, 'O')             # <<<<<<<<<<<<<<
 * 
 *     def complex_length(self, word : str):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_word, __pyx_mstate_global->__pyx_n_u_O};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_matrix_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":522
 *         return self._matrix(word, 'M')
 * 
 *     def O31(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
*/

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

/* "cython/core/fundamental_group.pyx":531
 *         return self._matrix(word, 'O')
 * 
 *     def complex_length(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the complex length of the isometry represented by the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_7complex_length(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_8SnapPyHP_14CHolonomyGroup_6complex_length, "\n        Return the complex length of the isometry represented by the\n        input word.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_14CHolonomyGroup_7complex_length = {"complex_length", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_7complex_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup_6complex_length};
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_7complex_length(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_word = 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("complex_length (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 531, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 531, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "complex_length", 0) < 0) __PYX_ERR(8, 531, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("complex_length", 1, 1, 1, i); __PYX_ERR(8, 531, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 531, __pyx_L3_error)
    }
    __pyx_v_word = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("complex_length", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 531, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CHolonomyGroup.complex_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyUnicode_Type), 0, "word", 2))) __PYX_ERR(8, 531, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_14CHolonomyGroup_6complex_length(((struct __pyx_obj_8SnapPyHP_CHolonomyGroup *)__pyx_v_self), __pyx_v_word);

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

static PyObject *__pyx_pf_8SnapPyHP_14CHolonomyGroup_6complex_length(struct __pyx_obj_8SnapPyHP_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  int *__pyx_v_c_word;
  FuncResult __pyx_v_result;
  PyObject *__pyx_v_word_list = NULL;
  MoebiusTransformation __pyx_v_M;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int *__pyx_t_7;
  FuncResult __pyx_t_8;
  int __pyx_t_9;
  Complex __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("complex_length", 0);

  /* "cython/core/fundamental_group.pyx":538
 *         cdef int *c_word
 *         cdef c_FuncResult result
 *         word_list = word_as_list(word, self.num_generators())             # <<<<<<<<<<<<<<
 *         c_word = c_word_from_list(word_list)
 *         cdef MoebiusTransformation M
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_word_as_list); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_num_generators, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_word, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_word_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":539
 *         cdef c_FuncResult result
 *         word_list = word_as_list(word, self.num_generators())
 *         c_word = c_word_from_list(word_list)             # <<<<<<<<<<<<<<
 *         cdef MoebiusTransformation M
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
*/
  __pyx_t_7 = __pyx_f_8SnapPyHP_c_word_from_list(__pyx_v_word_list); if (unlikely(__pyx_t_7 == ((int *)0) && PyErr_Occurred())) __PYX_ERR(8, 539, __pyx_L1_error)
  __pyx_v_c_word = __pyx_t_7;

  /* "cython/core/fundamental_group.pyx":541
 *         c_word = c_word_from_list(word_list)
 *         cdef MoebiusTransformation M
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)             # <<<<<<<<<<<<<<
 *         if result == 0:
 *             return self._number_(Complex2Number(complex_length_mt(&M)))
*/
  __pyx_t_8 = fg_word_to_matrix(__pyx_v_self->__pyx_base.c_group_presentation, __pyx_v_c_word, NULL, (&__pyx_v_M)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 541, __pyx_L1_error)
  __pyx_v_result = __pyx_t_8;

  /* "cython/core/fundamental_group.pyx":542
 *         cdef MoebiusTransformation M
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *         if result == 0:             # <<<<<<<<<<<<<<
 *             return self._number_(Complex2Number(complex_length_mt(&M)))
 *         return None
*/
  __pyx_t_9 = (__pyx_v_result == 0);
  if (__pyx_t_9) {

    /* "cython/core/fundamental_group.pyx":543
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *         if result == 0:
 *             return self._number_(Complex2Number(complex_length_mt(&M)))             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_10 = complex_length_mt((&__pyx_v_M)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 543, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":542
 *         cdef MoebiusTransformation M
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, NULL, &M)
 *         if result == 0:             # <<<<<<<<<<<<<<
 *             return self._number_(Complex2Number(complex_length_mt(&M)))
 *         return None
*/
  }

  /* "cython/core/fundamental_group.pyx":544
 *         if result == 0:
 *             return self._number_(Complex2Number(complex_length_mt(&M)))
 *         return None             # <<<<<<<<<<<<<<
 * 
 * class HolonomyGroup(CHolonomyGroup):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":531
 *         return self._matrix(word, 'O')
 * 
 *     def complex_length(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the complex length of the isometry represented by the
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CHolonomyGroup.complex_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_word_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_9__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_14CHolonomyGroup_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_9__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_14CHolonomyGroup_8__reduce_cython__(((struct __pyx_obj_8SnapPyHP_CHolonomyGroup *)__pyx_v_self));

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_11__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_14CHolonomyGroup_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14CHolonomyGroup_11__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
) {
  CYTHON_UNUSED 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CHolonomyGroup.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14CHolonomyGroup_10__setstate_cython__(((struct __pyx_obj_8SnapPyHP_CHolonomyGroup *)__pyx_v_self), __pyx_v___pyx_state);

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

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

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

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

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

/* "cython/core/fundamental_group.pyx":600
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13HolonomyGroup_1_number_(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_8SnapPyHP_13HolonomyGroup_1_number_ = {"_number_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13HolonomyGroup_1_number_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13HolonomyGroup_1_number_(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("_number_ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 600, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 600, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_number_", 0) < 0) __PYX_ERR(8, 600, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, i); __PYX_ERR(8, 600, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 600, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 600, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.HolonomyGroup._number_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13HolonomyGroup__number_(__pyx_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_13HolonomyGroup__number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/fundamental_group.pyx":602
 *     @staticmethod
 *     def _number_(n):
 *         return number.number_to_native_number(n)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number_to_native_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_n};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":600
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

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

/* "cython/core/symmetry_group.pyx":16
 *     cdef readonly _owns_c_symmetry_group
 * 
 *     def __cinit__(self, is_full_group, owns_c_symmetry_group):             # <<<<<<<<<<<<<<
 *         self.c_symmetry_group = NULL
 *         self._is_full_group = is_full_group
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_13SymmetryGroup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_13SymmetryGroup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_is_full_group = 0;
  PyObject *__pyx_v_owns_c_symmetry_group = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_is_full_group,&__pyx_mstate_global->__pyx_n_u_owns_c_symmetry_group,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(9, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, i); __PYX_ERR(9, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 16, __pyx_L3_error)
    }
    __pyx_v_is_full_group = values[0];
    __pyx_v_owns_c_symmetry_group = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, __pyx_nargs); __PYX_ERR(9, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup___cinit__(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self), __pyx_v_is_full_group, __pyx_v_owns_c_symmetry_group);

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

static int __pyx_pf_8SnapPyHP_13SymmetryGroup___cinit__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self, PyObject *__pyx_v_is_full_group, PyObject *__pyx_v_owns_c_symmetry_group) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cython/core/symmetry_group.pyx":17
 * 
 *     def __cinit__(self, is_full_group, owns_c_symmetry_group):
 *         self.c_symmetry_group = NULL             # <<<<<<<<<<<<<<
 *         self._is_full_group = is_full_group
 *         self._owns_c_symmetry_group = owns_c_symmetry_group
*/
  __pyx_v_self->c_symmetry_group = NULL;

  /* "cython/core/symmetry_group.pyx":18
 *     def __cinit__(self, is_full_group, owns_c_symmetry_group):
 *         self.c_symmetry_group = NULL
 *         self._is_full_group = is_full_group             # <<<<<<<<<<<<<<
 *         self._owns_c_symmetry_group = owns_c_symmetry_group
 * 
*/
  __Pyx_INCREF(__pyx_v_is_full_group);
  __Pyx_GIVEREF(__pyx_v_is_full_group);
  __Pyx_GOTREF(__pyx_v_self->_is_full_group);
  __Pyx_DECREF(__pyx_v_self->_is_full_group);
  __pyx_v_self->_is_full_group = __pyx_v_is_full_group;

  /* "cython/core/symmetry_group.pyx":19
 *         self.c_symmetry_group = NULL
 *         self._is_full_group = is_full_group
 *         self._owns_c_symmetry_group = owns_c_symmetry_group             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __Pyx_INCREF(__pyx_v_owns_c_symmetry_group);
  __Pyx_GIVEREF(__pyx_v_owns_c_symmetry_group);
  __Pyx_GOTREF(__pyx_v_self->_owns_c_symmetry_group);
  __Pyx_DECREF(__pyx_v_self->_owns_c_symmetry_group);
  __pyx_v_self->_owns_c_symmetry_group = __pyx_v_owns_c_symmetry_group;

  /* "cython/core/symmetry_group.pyx":16
 *     cdef readonly _owns_c_symmetry_group
 * 
 *     def __cinit__(self, is_full_group, owns_c_symmetry_group):             # <<<<<<<<<<<<<<
 *         self.c_symmetry_group = NULL
 *         self._is_full_group = is_full_group
*/

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

/* "cython/core/symmetry_group.pyx":21
 *         self._owns_c_symmetry_group = owns_c_symmetry_group
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._owns_c_symmetry_group:
 *             free_symmetry_group(self.c_symmetry_group)
*/

/* Python wrapper */
static void __pyx_pw_8SnapPyHP_13SymmetryGroup_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8SnapPyHP_13SymmetryGroup_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_8SnapPyHP_13SymmetryGroup_2__dealloc__(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static void __pyx_pf_8SnapPyHP_13SymmetryGroup_2__dealloc__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cython/core/symmetry_group.pyx":22
 * 
 *     def __dealloc__(self):
 *         if self._owns_c_symmetry_group:             # <<<<<<<<<<<<<<
 *             free_symmetry_group(self.c_symmetry_group)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_owns_c_symmetry_group); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(9, 22, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/symmetry_group.pyx":23
 *     def __dealloc__(self):
 *         if self._owns_c_symmetry_group:
 *             free_symmetry_group(self.c_symmetry_group)             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_c_symmetry_group(self, c_SymmetryGroup * c_symmetry_group):
*/
    free_symmetry_group(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 23, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":22
 * 
 *     def __dealloc__(self):
 *         if self._owns_c_symmetry_group:             # <<<<<<<<<<<<<<
 *             free_symmetry_group(self.c_symmetry_group)
 * 
*/
  }

  /* "cython/core/symmetry_group.pyx":21
 *         self._owns_c_symmetry_group = owns_c_symmetry_group
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._owns_c_symmetry_group:
 *             free_symmetry_group(self.c_symmetry_group)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("SnapPyHP.SymmetryGroup.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
}

/* "cython/core/symmetry_group.pyx":25
 *             free_symmetry_group(self.c_symmetry_group)
 * 
 *     cdef _set_c_symmetry_group(self, c_SymmetryGroup * c_symmetry_group):             # <<<<<<<<<<<<<<
 *         if c_symmetry_group is NULL:
 *             raise ValueError('You tried to create an *empty* SymmetryGroup.')
*/

static PyObject *__pyx_f_8SnapPyHP_13SymmetryGroup__set_c_symmetry_group(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self, SymmetryGroup *__pyx_v_c_symmetry_group) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_c_symmetry_group", 0);

  /* "cython/core/symmetry_group.pyx":26
 * 
 *     cdef _set_c_symmetry_group(self, c_SymmetryGroup * c_symmetry_group):
 *         if c_symmetry_group is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('You tried to create an *empty* SymmetryGroup.')
 *         self.c_symmetry_group = c_symmetry_group
*/
  __pyx_t_1 = (__pyx_v_c_symmetry_group == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/symmetry_group.pyx":27
 *     cdef _set_c_symmetry_group(self, c_SymmetryGroup * c_symmetry_group):
 *         if c_symmetry_group is NULL:
 *             raise ValueError('You tried to create an *empty* SymmetryGroup.')             # <<<<<<<<<<<<<<
 *         self.c_symmetry_group = c_symmetry_group
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_You_tried_to_create_an_empty_Sym};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 27, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(9, 27, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":26
 * 
 *     cdef _set_c_symmetry_group(self, c_SymmetryGroup * c_symmetry_group):
 *         if c_symmetry_group is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('You tried to create an *empty* SymmetryGroup.')
 *         self.c_symmetry_group = c_symmetry_group
*/
  }

  /* "cython/core/symmetry_group.pyx":28
 *         if c_symmetry_group is NULL:
 *             raise ValueError('You tried to create an *empty* SymmetryGroup.')
 *         self.c_symmetry_group = c_symmetry_group             # <<<<<<<<<<<<<<
 * 
 *     def is_full_group(self):
*/
  __pyx_v_self->c_symmetry_group = __pyx_v_c_symmetry_group;

  /* "cython/core/symmetry_group.pyx":25
 *             free_symmetry_group(self.c_symmetry_group)
 * 
 *     cdef _set_c_symmetry_group(self, c_SymmetryGroup * c_symmetry_group):             # <<<<<<<<<<<<<<
 *         if c_symmetry_group is NULL:
 *             raise ValueError('You tried to create an *empty* SymmetryGroup.')
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup._set_c_symmetry_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":30
 *         self.c_symmetry_group = c_symmetry_group
 * 
 *     def is_full_group(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the full symmetry group has been found.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_5is_full_group(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_8SnapPyHP_13SymmetryGroup_4is_full_group, "\n        Return whether the full symmetry group has been found.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_full_group()\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_5is_full_group = {"is_full_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_5is_full_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_4is_full_group};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_5is_full_group(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("is_full_group (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_full_group", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_full_group", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_4is_full_group(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_4is_full_group(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_full_group", 0);

  /* "cython/core/symmetry_group.pyx":38
 *         True
 *         """
 *         return self._is_full_group             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_is_full_group);
  __pyx_r = __pyx_v_self->_is_full_group;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":30
 *         self.c_symmetry_group = c_symmetry_group
 * 
 *     def is_full_group(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the full symmetry group has been found.
*/

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

/* "cython/core/symmetry_group.pyx":40
 *         return self._is_full_group
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_full_group():
 *             thePretext = ''
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_7__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_8SnapPyHP_13SymmetryGroup_6__repr__(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_6__repr__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_v_thePretext = NULL;
  PyObject *__pyx_v_theText = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/symmetry_group.pyx":41
 * 
 *     def __repr__(self):
 *         if self.is_full_group():             # <<<<<<<<<<<<<<
 *             thePretext = ''
 *         elif self.order() == 1:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_full_group, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cython/core/symmetry_group.pyx":42
 *     def __repr__(self):
 *         if self.is_full_group():
 *             thePretext = ''             # <<<<<<<<<<<<<<
 *         elif self.order() == 1:
 *             return 'unknown'
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10);
    __pyx_v_thePretext = __pyx_mstate_global->__pyx_kp_u__10;

    /* "cython/core/symmetry_group.pyx":41
 * 
 *     def __repr__(self):
 *         if self.is_full_group():             # <<<<<<<<<<<<<<
 *             thePretext = ''
 *         elif self.order() == 1:
*/
    goto __pyx_L3;
  }

  /* "cython/core/symmetry_group.pyx":43
 *         if self.is_full_group():
 *             thePretext = ''
 *         elif self.order() == 1:             # <<<<<<<<<<<<<<
 *             return 'unknown'
 *         else:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_order, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cython/core/symmetry_group.pyx":44
 *             thePretext = ''
 *         elif self.order() == 1:
 *             return 'unknown'             # <<<<<<<<<<<<<<
 *         else:
 *             thePretext = 'at least '
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_unknown);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_unknown;
    goto __pyx_L0;

    /* "cython/core/symmetry_group.pyx":43
 *         if self.is_full_group():
 *             thePretext = ''
 *         elif self.order() == 1:             # <<<<<<<<<<<<<<
 *             return 'unknown'
 *         else:
*/
  }

  /* "cython/core/symmetry_group.pyx":46
 *             return 'unknown'
 *         else:
 *             thePretext = 'at least '             # <<<<<<<<<<<<<<
 *         if self.is_abelian():
 *             theText = repr(self.abelian_description())
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_at_least);
    __pyx_v_thePretext = __pyx_mstate_global->__pyx_kp_u_at_least;
  }
  __pyx_L3:;

  /* "cython/core/symmetry_group.pyx":47
 *         else:
 *             thePretext = 'at least '
 *         if self.is_abelian():             # <<<<<<<<<<<<<<
 *             theText = repr(self.abelian_description())
 *         elif self.is_dihedral():
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_abelian, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cython/core/symmetry_group.pyx":48
 *             thePretext = 'at least '
 *         if self.is_abelian():
 *             theText = repr(self.abelian_description())             # <<<<<<<<<<<<<<
 *         elif self.is_dihedral():
 *             theText = 'D%d' % (self.order()//2)
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_abelian_description, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_theText = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/symmetry_group.pyx":47
 *         else:
 *             thePretext = 'at least '
 *         if self.is_abelian():             # <<<<<<<<<<<<<<
 *             theText = repr(self.abelian_description())
 *         elif self.is_dihedral():
*/
    goto __pyx_L4;
  }

  /* "cython/core/symmetry_group.pyx":49
 *         if self.is_abelian():
 *             theText = repr(self.abelian_description())
 *         elif self.is_dihedral():             # <<<<<<<<<<<<<<
 *             theText = 'D%d' % (self.order()//2)
 *         elif self.is_polyhedral():
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_dihedral, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "cython/core/symmetry_group.pyx":50
 *             theText = repr(self.abelian_description())
 *         elif self.is_dihedral():
 *             theText = 'D%d' % (self.order()//2)             # <<<<<<<<<<<<<<
 *         elif self.is_polyhedral():
 *             theText = self.polyhedral_description()
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_order, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_D_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_theText = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/symmetry_group.pyx":49
 *         if self.is_abelian():
 *             theText = repr(self.abelian_description())
 *         elif self.is_dihedral():             # <<<<<<<<<<<<<<
 *             theText = 'D%d' % (self.order()//2)
 *         elif self.is_polyhedral():
*/
    goto __pyx_L4;
  }

  /* "cython/core/symmetry_group.pyx":51
 *         elif self.is_dihedral():
 *             theText = 'D%d' % (self.order()//2)
 *         elif self.is_polyhedral():             # <<<<<<<<<<<<<<
 *             theText = self.polyhedral_description()
 *         elif self.is_S5():
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_polyhedral, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "cython/core/symmetry_group.pyx":52
 *             theText = 'D%d' % (self.order()//2)
 *         elif self.is_polyhedral():
 *             theText = self.polyhedral_description()             # <<<<<<<<<<<<<<
 *         elif self.is_S5():
 *             theText = 'S5'
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_polyhedral_description, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_theText = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/symmetry_group.pyx":51
 *         elif self.is_dihedral():
 *             theText = 'D%d' % (self.order()//2)
 *         elif self.is_polyhedral():             # <<<<<<<<<<<<<<
 *             theText = self.polyhedral_description()
 *         elif self.is_S5():
*/
    goto __pyx_L4;
  }

  /* "cython/core/symmetry_group.pyx":53
 *         elif self.is_polyhedral():
 *             theText = self.polyhedral_description()
 *         elif self.is_S5():             # <<<<<<<<<<<<<<
 *             theText = 'S5'
 *         elif self.is_direct_product():
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_S5, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "cython/core/symmetry_group.pyx":54
 *             theText = self.polyhedral_description()
 *         elif self.is_S5():
 *             theText = 'S5'             # <<<<<<<<<<<<<<
 *         elif self.is_direct_product():
 *             theText = '%s x %s' % self.direct_product_description()
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_S5);
    __pyx_v_theText = __pyx_mstate_global->__pyx_n_u_S5;

    /* "cython/core/symmetry_group.pyx":53
 *         elif self.is_polyhedral():
 *             theText = self.polyhedral_description()
 *         elif self.is_S5():             # <<<<<<<<<<<<<<
 *             theText = 'S5'
 *         elif self.is_direct_product():
*/
    goto __pyx_L4;
  }

  /* "cython/core/symmetry_group.pyx":55
 *         elif self.is_S5():
 *             theText = 'S5'
 *         elif self.is_direct_product():             # <<<<<<<<<<<<<<
 *             theText = '%s x %s' % self.direct_product_description()
 *         else:
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_direct_product, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "cython/core/symmetry_group.pyx":56
 *             theText = 'S5'
 *         elif self.is_direct_product():
 *             theText = '%s x %s' % self.direct_product_description()             # <<<<<<<<<<<<<<
 *         else:
 *             theText = 'nonabelian group of order %d' % self.order()
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_direct_product_description, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_s_x_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_theText = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/symmetry_group.pyx":55
 *         elif self.is_S5():
 *             theText = 'S5'
 *         elif self.is_direct_product():             # <<<<<<<<<<<<<<
 *             theText = '%s x %s' % self.direct_product_description()
 *         else:
*/
    goto __pyx_L4;
  }

  /* "cython/core/symmetry_group.pyx":58
 *             theText = '%s x %s' % self.direct_product_description()
 *         else:
 *             theText = 'nonabelian group of order %d' % self.order()             # <<<<<<<<<<<<<<
 * 
 *         return thePretext + theText
*/
  /*else*/ {
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_order, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 58, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_nonabelian_group_of_order_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_theText = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cython/core/symmetry_group.pyx":60
 *             theText = 'nonabelian group of order %d' % self.order()
 * 
 *         return thePretext + theText             # <<<<<<<<<<<<<<
 * 
 *     def order(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyNumber_Add(__pyx_v_thePretext, __pyx_v_theText); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":40
 *         return self._is_full_group
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_full_group():
 *             thePretext = ''
*/

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

/* "cython/core/symmetry_group.pyx":62
 *         return thePretext + theText
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the order of the symmetry group
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_9order(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_8SnapPyHP_13SymmetryGroup_8order, "\n        Return the order of the symmetry group\n\n        >>> S = Manifold('s000').symmetry_group()\n        >>> S.order()\n        4\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_9order = {"order", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_9order, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_8order};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_9order(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("order (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("order", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("order", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_8order(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_8order(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__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("order", 0);

  /* "cython/core/symmetry_group.pyx":70
 *         4
 *         """
 *         return symmetry_group_order(self.c_symmetry_group)             # <<<<<<<<<<<<<<
 * 
 *     def is_abelian(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = symmetry_group_order(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 70, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":62
 *         return thePretext + theText
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the order of the symmetry group
*/

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

/* "cython/core/symmetry_group.pyx":72
 *         return symmetry_group_order(self.c_symmetry_group)
 * 
 *     def is_abelian(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is abelian.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_11is_abelian(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_8SnapPyHP_13SymmetryGroup_10is_abelian, "\n        Return whether the symmetry group is abelian.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_abelian()\n        False\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_11is_abelian = {"is_abelian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_11is_abelian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_10is_abelian};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_11is_abelian(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("is_abelian (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_abelian", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_abelian", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_10is_abelian(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_10is_abelian(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  AbelianGroup *__pyx_v_abelian_description;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_abelian", 0);

  /* "cython/core/symmetry_group.pyx":80
 *         False
 *         """
 *         cdef c_AbelianGroup* abelian_description = NULL             # <<<<<<<<<<<<<<
 *         return B2B(symmetry_group_is_abelian(
 *             self.c_symmetry_group, &abelian_description))
*/
  __pyx_v_abelian_description = NULL;

  /* "cython/core/symmetry_group.pyx":81
 *         """
 *         cdef c_AbelianGroup* abelian_description = NULL
 *         return B2B(symmetry_group_is_abelian(             # <<<<<<<<<<<<<<
 *             self.c_symmetry_group, &abelian_description))
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/symmetry_group.pyx":82
 *         cdef c_AbelianGroup* abelian_description = NULL
 *         return B2B(symmetry_group_is_abelian(
 *             self.c_symmetry_group, &abelian_description))             # <<<<<<<<<<<<<<
 * 
 *     def abelian_description(self):
*/
  __pyx_t_1 = symmetry_group_is_abelian(__pyx_v_self->c_symmetry_group, (&__pyx_v_abelian_description)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 81, __pyx_L1_error)

  /* "cython/core/symmetry_group.pyx":81
 *         """
 *         cdef c_AbelianGroup* abelian_description = NULL
 *         return B2B(symmetry_group_is_abelian(             # <<<<<<<<<<<<<<
 *             self.c_symmetry_group, &abelian_description))
 * 
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":72
 *         return symmetry_group_order(self.c_symmetry_group)
 * 
 *     def is_abelian(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is abelian.
*/

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

/* "cython/core/symmetry_group.pyx":84
 *             self.c_symmetry_group, &abelian_description))
 * 
 *     def abelian_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is abelian, return it as an AbelianGroup
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_13abelian_description(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_8SnapPyHP_13SymmetryGroup_12abelian_description, "\n        If the symmetry group is abelian, return it as an AbelianGroup\n\n        >>> S = Manifold('v3379').symmetry_group()\n        >>> S.abelian_description()\n        Z/2 + Z/2 + Z/2\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_13abelian_description = {"abelian_description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_13abelian_description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_12abelian_description};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_13abelian_description(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("abelian_description (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("abelian_description", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("abelian_description", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_12abelian_description(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_12abelian_description(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  AbelianGroup *__pyx_v_A;
  int __pyx_v_n;
  PyObject *__pyx_v_is_abelian = NULL;
  PyObject *__pyx_v_coeffs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abelian_description", 0);

  /* "cython/core/symmetry_group.pyx":94
 *         cdef c_AbelianGroup* A
 *         cdef int n
 *         is_abelian = B2B(symmetry_group_is_abelian(self.c_symmetry_group, &A))             # <<<<<<<<<<<<<<
 *         if not is_abelian:
 *             raise ValueError('The symmetry group is not abelian.')
*/
  __pyx_t_1 = symmetry_group_is_abelian(__pyx_v_self->c_symmetry_group, (&__pyx_v_A)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 94, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_is_abelian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":95
 *         cdef int n
 *         is_abelian = B2B(symmetry_group_is_abelian(self.c_symmetry_group, &A))
 *         if not is_abelian:             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not abelian.')
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_abelian); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(9, 95, __pyx_L1_error)
  __pyx_t_4 = (!__pyx_t_3);
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/symmetry_group.pyx":96
 *         is_abelian = B2B(symmetry_group_is_abelian(self.c_symmetry_group, &A))
 *         if not is_abelian:
 *             raise ValueError('The symmetry group is not abelian.')             # <<<<<<<<<<<<<<
 * 
 *         coeffs = []
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_The_symmetry_group_is_not_abelia};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(9, 96, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":95
 *         cdef int n
 *         is_abelian = B2B(symmetry_group_is_abelian(self.c_symmetry_group, &A))
 *         if not is_abelian:             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not abelian.')
 * 
*/
  }

  /* "cython/core/symmetry_group.pyx":98
 *             raise ValueError('The symmetry group is not abelian.')
 * 
 *         coeffs = []             # <<<<<<<<<<<<<<
 *         for n in range(A.num_torsion_coefficients):
 *             coeffs.append(A.torsion_coefficients[n])
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_coeffs = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":99
 * 
 *         coeffs = []
 *         for n in range(A.num_torsion_coefficients):             # <<<<<<<<<<<<<<
 *             coeffs.append(A.torsion_coefficients[n])
 * 
*/
  __pyx_t_8 = __pyx_v_A->num_torsion_coefficients;
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_n = __pyx_t_10;

    /* "cython/core/symmetry_group.pyx":100
 *         coeffs = []
 *         for n in range(A.num_torsion_coefficients):
 *             coeffs.append(A.torsion_coefficients[n])             # <<<<<<<<<<<<<<
 * 
 *         # Don't need to free A as it is attached to the symmetry group object
*/
    __pyx_t_2 = __Pyx_PyLong_From_long((__pyx_v_A->torsion_coefficients[__pyx_v_n])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_coeffs, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/symmetry_group.pyx":103
 * 
 *         # Don't need to free A as it is attached to the symmetry group object
 *         return AbelianGroup(elementary_divisors=coeffs)             # <<<<<<<<<<<<<<
 * 
 *     def is_dihedral(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup);
  __pyx_t_5 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, NULL};
    __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_v_coeffs, __pyx_t_12, __pyx_callargs+1, 0) < 0) __PYX_ERR(9, 103, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 103, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":84
 *             self.c_symmetry_group, &abelian_description))
 * 
 *     def abelian_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is abelian, return it as an AbelianGroup
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.abelian_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_is_abelian);
  __Pyx_XDECREF(__pyx_v_coeffs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":105
 *         return AbelianGroup(elementary_divisors=coeffs)
 * 
 *     def is_dihedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is dihedral.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_15is_dihedral(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_8SnapPyHP_13SymmetryGroup_14is_dihedral, "\n        Return whether the symmetry group is dihedral.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_dihedral()\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_15is_dihedral = {"is_dihedral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_15is_dihedral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_14is_dihedral};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_15is_dihedral(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("is_dihedral (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_dihedral", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_dihedral", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_14is_dihedral(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_14is_dihedral(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_dihedral", 0);

  /* "cython/core/symmetry_group.pyx":113
 *         True
 *         """
 *         return B2B(symmetry_group_is_dihedral(self.c_symmetry_group))             # <<<<<<<<<<<<<<
 * 
 *     def is_polyhedral(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = symmetry_group_is_dihedral(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 113, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":105
 *         return AbelianGroup(elementary_divisors=coeffs)
 * 
 *     def is_dihedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is dihedral.
*/

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

/* "cython/core/symmetry_group.pyx":115
 *         return B2B(symmetry_group_is_dihedral(self.c_symmetry_group))
 * 
 *     def is_polyhedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns whether the symmetry group is a (possibly binary)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_17is_polyhedral(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_8SnapPyHP_13SymmetryGroup_16is_polyhedral, "\n        Returns whether the symmetry group is a (possibly binary)\n        polyhedral group.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_17is_polyhedral = {"is_polyhedral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_17is_polyhedral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_16is_polyhedral};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_17is_polyhedral(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("is_polyhedral (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_polyhedral", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_polyhedral", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_16is_polyhedral(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_16is_polyhedral(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_polyhedral", 0);

  /* "cython/core/symmetry_group.pyx":120
 *         polyhedral group.
 *         """
 *         return B2B(symmetry_group_is_polyhedral(self.c_symmetry_group,             # <<<<<<<<<<<<<<
 *                                                 NULL, NULL, NULL, NULL))
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/symmetry_group.pyx":121
 *         """
 *         return B2B(symmetry_group_is_polyhedral(self.c_symmetry_group,
 *                                                 NULL, NULL, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def polyhedral_description(self):
*/
  __pyx_t_1 = symmetry_group_is_polyhedral(__pyx_v_self->c_symmetry_group, NULL, NULL, NULL, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 120, __pyx_L1_error)

  /* "cython/core/symmetry_group.pyx":120
 *         polyhedral group.
 *         """
 *         return B2B(symmetry_group_is_polyhedral(self.c_symmetry_group,             # <<<<<<<<<<<<<<
 *                                                 NULL, NULL, NULL, NULL))
 * 
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":115
 *         return B2B(symmetry_group_is_dihedral(self.c_symmetry_group))
 * 
 *     def is_polyhedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns whether the symmetry group is a (possibly binary)
*/

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

/* "cython/core/symmetry_group.pyx":123
 *                                                 NULL, NULL, NULL, NULL))
 * 
 *     def polyhedral_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is a (possibly binary)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_19polyhedral_description(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_8SnapPyHP_13SymmetryGroup_18polyhedral_description, "\n        If the symmetry group is a (possibly binary)\n        polyhedral group, return a description of it.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_19polyhedral_description = {"polyhedral_description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_19polyhedral_description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_18polyhedral_description};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_19polyhedral_description(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("polyhedral_description (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("polyhedral_description", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("polyhedral_description", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_18polyhedral_description(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_18polyhedral_description(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  Boolean __pyx_v_is_binary_group;
  int __pyx_v_p;
  int __pyx_v_q;
  int __pyx_v_r;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  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("polyhedral_description", 0);

  /* "cython/core/symmetry_group.pyx":131
 *         cdef int p, q, r
 * 
 *         if not self.is_polyhedral():             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not polyhedral.')
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_polyhedral, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":132
 * 
 *         if not self.is_polyhedral():
 *             raise ValueError('The symmetry group is not polyhedral.')             # <<<<<<<<<<<<<<
 * 
 *         symmetry_group_is_polyhedral(self.c_symmetry_group,
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_symmetry_group_is_not_polyhe};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(9, 132, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":131
 *         cdef int p, q, r
 * 
 *         if not self.is_polyhedral():             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not polyhedral.')
 * 
*/
  }

  /* "cython/core/symmetry_group.pyx":134
 *             raise ValueError('The symmetry group is not polyhedral.')
 * 
 *         symmetry_group_is_polyhedral(self.c_symmetry_group,             # <<<<<<<<<<<<<<
 *                                      &is_binary_group, &p, &q, &r)
 * 
*/
  symmetry_group_is_polyhedral(__pyx_v_self->c_symmetry_group, (&__pyx_v_is_binary_group), (&__pyx_v_p), (&__pyx_v_q), (&__pyx_v_r)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 134, __pyx_L1_error)

  /* "cython/core/symmetry_group.pyx":137
 *                                      &is_binary_group, &p, &q, &r)
 * 
 *         assert p == 2             # <<<<<<<<<<<<<<
 * 
 *         if q == 2:
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (__pyx_v_p == 2);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(9, 137, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(9, 137, __pyx_L1_error)
  #endif

  /* "cython/core/symmetry_group.pyx":139
 *         assert p == 2
 * 
 *         if q == 2:             # <<<<<<<<<<<<<<
 *             assert(is_binary_group)
 *             name = 'binary dihedral group <2,2,%d>' % r
*/
  switch (__pyx_v_q) {
    case 2:

    /* "cython/core/symmetry_group.pyx":140
 * 
 *         if q == 2:
 *             assert(is_binary_group)             # <<<<<<<<<<<<<<
 *             name = 'binary dihedral group <2,2,%d>' % r
 *         elif q== 3:
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (__pyx_v_is_binary_group != 0);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(9, 140, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(9, 140, __pyx_L1_error)
    #endif

    /* "cython/core/symmetry_group.pyx":141
 *         if q == 2:
 *             assert(is_binary_group)
 *             name = 'binary dihedral group <2,2,%d>' % r             # <<<<<<<<<<<<<<
 *         elif q== 3:
 *             name = 'binary ' if is_binary_group else ''
*/
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_binary_dihedral_group_2_2_d, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_name = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/symmetry_group.pyx":139
 *         assert p == 2
 * 
 *         if q == 2:             # <<<<<<<<<<<<<<
 *             assert(is_binary_group)
 *             name = 'binary dihedral group <2,2,%d>' % r
*/
    break;
    case 3:

    /* "cython/core/symmetry_group.pyx":143
 *             name = 'binary dihedral group <2,2,%d>' % r
 *         elif q== 3:
 *             name = 'binary ' if is_binary_group else ''             # <<<<<<<<<<<<<<
 *             name += {3: 'tetrahedral group',
 *                      4: 'octahedral group',
*/
    __pyx_t_5 = (__pyx_v_is_binary_group != 0);
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_binary);
      __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_binary;
    } else {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10);
      __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u__10;
    }
    __pyx_v_name = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/symmetry_group.pyx":144
 *         elif q== 3:
 *             name = 'binary ' if is_binary_group else ''
 *             name += {3: 'tetrahedral group',             # <<<<<<<<<<<<<<
 *                      4: 'octahedral group',
 *                      5: 'icosohedral group'}[r]
*/
    __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_kp_u_tetrahedral_group) < 0) __PYX_ERR(9, 144, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_kp_u_octahedral_group) < 0) __PYX_ERR(9, 144, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_kp_u_icosohedral_group) < 0) __PYX_ERR(9, 144, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":146
 *             name += {3: 'tetrahedral group',
 *                      4: 'octahedral group',
 *                      5: 'icosohedral group'}[r]             # <<<<<<<<<<<<<<
 * 
 *         return name
*/
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/symmetry_group.pyx":144
 *         elif q== 3:
 *             name = 'binary ' if is_binary_group else ''
 *             name += {3: 'tetrahedral group',             # <<<<<<<<<<<<<<
 *                      4: 'octahedral group',
 *                      5: 'icosohedral group'}[r]
*/
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/symmetry_group.pyx":142
 *             assert(is_binary_group)
 *             name = 'binary dihedral group <2,2,%d>' % r
 *         elif q== 3:             # <<<<<<<<<<<<<<
 *             name = 'binary ' if is_binary_group else ''
 *             name += {3: 'tetrahedral group',
*/
    break;
    default: break;
  }

  /* "cython/core/symmetry_group.pyx":148
 *                      5: 'icosohedral group'}[r]
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def is_S5(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(9, 148, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":123
 *                                                 NULL, NULL, NULL, NULL))
 * 
 *     def polyhedral_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is a (possibly binary)
*/

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

/* "cython/core/symmetry_group.pyx":150
 *         return name
 * 
 *     def is_S5(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns whether the group is the symmetric group on five things.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_21is_S5(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_8SnapPyHP_13SymmetryGroup_20is_S5, "\n        Returns whether the group is the symmetric group on five things.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_21is_S5 = {"is_S5", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_21is_S5, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_20is_S5};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_21is_S5(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("is_S5 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_S5", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_S5", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_20is_S5(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_20is_S5(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_S5", 0);

  /* "cython/core/symmetry_group.pyx":154
 *         Returns whether the group is the symmetric group on five things.
 *         """
 *         return B2B(symmetry_group_is_S5(self.c_symmetry_group))             # <<<<<<<<<<<<<<
 * 
 *     def is_direct_product(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = symmetry_group_is_S5(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 154, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":150
 *         return name
 * 
 *     def is_S5(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns whether the group is the symmetric group on five things.
*/

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

/* "cython/core/symmetry_group.pyx":156
 *         return B2B(symmetry_group_is_S5(self.c_symmetry_group))
 * 
 *     def is_direct_product(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the SymmetryGroup is a nontrivial direct
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_23is_direct_product(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_8SnapPyHP_13SymmetryGroup_22is_direct_product, "\n        Return whether the SymmetryGroup is a nontrivial direct\n        product with at least one nonabelian factor.\n\n        >>> S = Manifold('s960').symmetry_group()\n        >>> S.is_direct_product()\n        True\n        >>> S\n        Z/4 x D3\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_23is_direct_product = {"is_direct_product", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_23is_direct_product, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_22is_direct_product};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_23is_direct_product(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("is_direct_product (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_direct_product", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_direct_product", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_22is_direct_product(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_22is_direct_product(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_direct_product", 0);

  /* "cython/core/symmetry_group.pyx":167
 *         Z/4 x D3
 *         """
 *         return B2B(symmetry_group_is_direct_product(self.c_symmetry_group))             # <<<<<<<<<<<<<<
 * 
 *     def direct_product_description(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = symmetry_group_is_direct_product(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 167, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":156
 *         return B2B(symmetry_group_is_S5(self.c_symmetry_group))
 * 
 *     def is_direct_product(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the SymmetryGroup is a nontrivial direct
*/

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

/* "cython/core/symmetry_group.pyx":169
 *         return B2B(symmetry_group_is_direct_product(self.c_symmetry_group))
 * 
 *     def direct_product_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the SymmetryGroup is a nontrivial direct product with at
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_25direct_product_description(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_8SnapPyHP_13SymmetryGroup_24direct_product_description, "\n        If the SymmetryGroup is a nontrivial direct product with at\n        least one nonabelian factor, return a pair of SymmetryGroups\n        consisting of the (two) factors.\n\n        >>> S = Manifold('s960').symmetry_group()\n        >>> S.direct_product_description()\n        (Z/4, D3)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_25direct_product_description = {"direct_product_description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_25direct_product_description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_24direct_product_description};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_25direct_product_description(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("direct_product_description (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("direct_product_description", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("direct_product_description", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_24direct_product_description(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_24direct_product_description(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_factor_0;
  SymmetryGroup *__pyx_v_c_factor_1;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_factor_0 = 0;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_factor_1 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  SymmetryGroup *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("direct_product_description", 0);

  /* "cython/core/symmetry_group.pyx":179
 *         (Z/4, D3)
 *         """
 *         if not self.is_direct_product():             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not a nontrivial, '
 *                              'nonabelian direct product.')
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_direct_product, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":180
 *         """
 *         if not self.is_direct_product():
 *             raise ValueError('The symmetry group is not a nontrivial, '             # <<<<<<<<<<<<<<
 *                              'nonabelian direct product.')
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_symmetry_group_is_not_a_nont};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(9, 180, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":179
 *         (Z/4, D3)
 *         """
 *         if not self.is_direct_product():             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not a nontrivial, '
 *                              'nonabelian direct product.')
*/
  }

  /* "cython/core/symmetry_group.pyx":188
 *         cdef SymmetryGroup factor_1
 * 
 *         c_factor_0 = get_symmetry_group_factor(self.c_symmetry_group, 0)             # <<<<<<<<<<<<<<
 *         c_factor_1 = get_symmetry_group_factor(self.c_symmetry_group, 1)
 * 
*/
  __pyx_t_7 = get_symmetry_group_factor(__pyx_v_self->c_symmetry_group, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 188, __pyx_L1_error)
  __pyx_v_c_factor_0 = __pyx_t_7;

  /* "cython/core/symmetry_group.pyx":189
 * 
 *         c_factor_0 = get_symmetry_group_factor(self.c_symmetry_group, 0)
 *         c_factor_1 = get_symmetry_group_factor(self.c_symmetry_group, 1)             # <<<<<<<<<<<<<<
 * 
 *         factor_0 = SymmetryGroup(True, False)
*/
  __pyx_t_7 = get_symmetry_group_factor(__pyx_v_self->c_symmetry_group, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 189, __pyx_L1_error)
  __pyx_v_c_factor_1 = __pyx_t_7;

  /* "cython/core/symmetry_group.pyx":191
 *         c_factor_1 = get_symmetry_group_factor(self.c_symmetry_group, 1)
 * 
 *         factor_0 = SymmetryGroup(True, False)             # <<<<<<<<<<<<<<
 *         factor_1 = SymmetryGroup(True, False)
 *         factor_0._set_c_symmetry_group(c_factor_0)
*/
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup), __pyx_mstate_global->__pyx_tuple[22], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_factor_0 = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":192
 * 
 *         factor_0 = SymmetryGroup(True, False)
 *         factor_1 = SymmetryGroup(True, False)             # <<<<<<<<<<<<<<
 *         factor_0._set_c_symmetry_group(c_factor_0)
 *         factor_1._set_c_symmetry_group(c_factor_1)
*/
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup), __pyx_mstate_global->__pyx_tuple[22], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_factor_1 = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":193
 *         factor_0 = SymmetryGroup(True, False)
 *         factor_1 = SymmetryGroup(True, False)
 *         factor_0._set_c_symmetry_group(c_factor_0)             # <<<<<<<<<<<<<<
 *         factor_1._set_c_symmetry_group(c_factor_1)
 *         return (factor_0, factor_1)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *)__pyx_v_factor_0->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_factor_0, __pyx_v_c_factor_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":194
 *         factor_1 = SymmetryGroup(True, False)
 *         factor_0._set_c_symmetry_group(c_factor_0)
 *         factor_1._set_c_symmetry_group(c_factor_1)             # <<<<<<<<<<<<<<
 *         return (factor_0, factor_1)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *)__pyx_v_factor_1->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_factor_1, __pyx_v_c_factor_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":195
 *         factor_0._set_c_symmetry_group(c_factor_0)
 *         factor_1._set_c_symmetry_group(c_factor_1)
 *         return (factor_0, factor_1)             # <<<<<<<<<<<<<<
 * 
 *     def is_amphicheiral(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_factor_0);
  __Pyx_GIVEREF((PyObject *)__pyx_v_factor_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_factor_0)) != (0)) __PYX_ERR(9, 195, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_factor_1);
  __Pyx_GIVEREF((PyObject *)__pyx_v_factor_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_factor_1)) != (0)) __PYX_ERR(9, 195, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":169
 *         return B2B(symmetry_group_is_direct_product(self.c_symmetry_group))
 * 
 *     def direct_product_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the SymmetryGroup is a nontrivial direct product with at
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.direct_product_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_factor_0);
  __Pyx_XDECREF((PyObject *)__pyx_v_factor_1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":197
 *         return (factor_0, factor_1)
 * 
 *     def is_amphicheiral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the manifold has an orientation reversing symmetry.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_27is_amphicheiral(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_8SnapPyHP_13SymmetryGroup_26is_amphicheiral, "\n        Return whether the manifold has an orientation reversing symmetry.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_amphicheiral()\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_27is_amphicheiral = {"is_amphicheiral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_27is_amphicheiral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_26is_amphicheiral};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_27is_amphicheiral(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("is_amphicheiral (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_amphicheiral", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_amphicheiral", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_26is_amphicheiral(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_26is_amphicheiral(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_amphicheiral", 0);

  /* "cython/core/symmetry_group.pyx":205
 *         True
 *         """
 *         return B2B(symmetry_group_is_amphicheiral(self.c_symmetry_group))             # <<<<<<<<<<<<<<
 * 
 *     def is_invertible_knot(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = symmetry_group_is_amphicheiral(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 205, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":197
 *         return (factor_0, factor_1)
 * 
 *     def is_amphicheiral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the manifold has an orientation reversing symmetry.
*/

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

/* "cython/core/symmetry_group.pyx":207
 *         return B2B(symmetry_group_is_amphicheiral(self.c_symmetry_group))
 * 
 *     def is_invertible_knot(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether a one-cusped has a symmetry that acts on the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_29is_invertible_knot(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_8SnapPyHP_13SymmetryGroup_28is_invertible_knot, "\n        Return whether a one-cusped has a symmetry that acts on the\n        cusp via the matrix -I.\n\n        >>> S = Manifold('m015').symmetry_group()\n        >>> S.is_invertible_knot()\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_29is_invertible_knot = {"is_invertible_knot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_29is_invertible_knot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_28is_invertible_knot};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_29is_invertible_knot(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("is_invertible_knot (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_invertible_knot", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_invertible_knot", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_28is_invertible_knot(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_28is_invertible_knot(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_invertible_knot", 0);

  /* "cython/core/symmetry_group.pyx":216
 *         True
 *         """
 *         return B2B(symmetry_group_invertible_knot(self.c_symmetry_group))             # <<<<<<<<<<<<<<
 * 
 *     def commutator_subgroup(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = symmetry_group_invertible_knot(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 216, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8SnapPyHP_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":207
 *         return B2B(symmetry_group_is_amphicheiral(self.c_symmetry_group))
 * 
 *     def is_invertible_knot(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether a one-cusped has a symmetry that acts on the
*/

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

/* "cython/core/symmetry_group.pyx":218
 *         return B2B(symmetry_group_invertible_knot(self.c_symmetry_group))
 * 
 *     def commutator_subgroup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the commutator subgroup of the SymmetryGroup
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_31commutator_subgroup(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_8SnapPyHP_13SymmetryGroup_30commutator_subgroup, "\n        Return the commutator subgroup of the SymmetryGroup\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S\n        D4\n        >>> S.commutator_subgroup()\n        Z/2\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_31commutator_subgroup = {"commutator_subgroup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_31commutator_subgroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_30commutator_subgroup};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_31commutator_subgroup(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("commutator_subgroup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("commutator_subgroup", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("commutator_subgroup", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_30commutator_subgroup(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_30commutator_subgroup(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_comm_subgroup;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_comm_subgroup = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  SymmetryGroup *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("commutator_subgroup", 0);

  /* "cython/core/symmetry_group.pyx":231
 *         cdef SymmetryGroup comm_subgroup
 * 
 *         c_comm_subgroup = get_commutator_subgroup(self.c_symmetry_group)             # <<<<<<<<<<<<<<
 *         comm_subgroup = SymmetryGroup(self.is_full_group(), True)
 *         comm_subgroup._set_c_symmetry_group(c_comm_subgroup)
*/
  __pyx_t_1 = get_commutator_subgroup(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 231, __pyx_L1_error)
  __pyx_v_c_comm_subgroup = __pyx_t_1;

  /* "cython/core/symmetry_group.pyx":232
 * 
 *         c_comm_subgroup = get_commutator_subgroup(self.c_symmetry_group)
 *         comm_subgroup = SymmetryGroup(self.is_full_group(), True)             # <<<<<<<<<<<<<<
 *         comm_subgroup._set_c_symmetry_group(c_comm_subgroup)
 *         return comm_subgroup
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup); 
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_full_group, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, Py_True};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 232, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_comm_subgroup = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":233
 *         c_comm_subgroup = get_commutator_subgroup(self.c_symmetry_group)
 *         comm_subgroup = SymmetryGroup(self.is_full_group(), True)
 *         comm_subgroup._set_c_symmetry_group(c_comm_subgroup)             # <<<<<<<<<<<<<<
 *         return comm_subgroup
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *)__pyx_v_comm_subgroup->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_comm_subgroup, __pyx_v_c_comm_subgroup); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":234
 *         comm_subgroup = SymmetryGroup(self.is_full_group(), True)
 *         comm_subgroup._set_c_symmetry_group(c_comm_subgroup)
 *         return comm_subgroup             # <<<<<<<<<<<<<<
 * 
 *     def abelianization(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_comm_subgroup);
  __pyx_r = ((PyObject *)__pyx_v_comm_subgroup);
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":218
 *         return B2B(symmetry_group_invertible_knot(self.c_symmetry_group))
 * 
 *     def commutator_subgroup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the commutator subgroup of the SymmetryGroup
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.commutator_subgroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_comm_subgroup);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":236
 *         return comm_subgroup
 * 
 *     def abelianization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the abelianization of the symmetry group
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_33abelianization(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_8SnapPyHP_13SymmetryGroup_32abelianization, "\n        Return the abelianization of the symmetry group\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.abelianization()\n        Z/2 + Z/2\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_33abelianization = {"abelianization", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_33abelianization, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_32abelianization};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_33abelianization(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("abelianization (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("abelianization", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("abelianization", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_32abelianization(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_32abelianization(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_abelianization;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_abelianization = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  SymmetryGroup *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abelianization", 0);

  /* "cython/core/symmetry_group.pyx":245
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group is not known.')
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_full_group, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":246
 * 
 *         if not self.is_full_group():
 *             raise ValueError('The full symmetry group is not known.')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_SymmetryGroup* c_abelianization
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_full_symmetry_group_is_not_k};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(9, 246, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":245
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group is not known.')
 * 
*/
  }

  /* "cython/core/symmetry_group.pyx":251
 *         cdef SymmetryGroup abelianization
 * 
 *         c_abelianization = get_abelianization(self.c_symmetry_group)             # <<<<<<<<<<<<<<
 *         abelianization = SymmetryGroup(self.is_full_group(), True)
 *         abelianization._set_c_symmetry_group(c_abelianization)
*/
  __pyx_t_7 = get_abelianization(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 251, __pyx_L1_error)
  __pyx_v_c_abelianization = __pyx_t_7;

  /* "cython/core/symmetry_group.pyx":252
 * 
 *         c_abelianization = get_abelianization(self.c_symmetry_group)
 *         abelianization = SymmetryGroup(self.is_full_group(), True)             # <<<<<<<<<<<<<<
 *         abelianization._set_c_symmetry_group(c_abelianization)
 *         return abelianization.abelian_description()
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup);
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup); 
  __pyx_t_9 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_full_group, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_8, Py_True};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 252, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_abelianization = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":253
 *         c_abelianization = get_abelianization(self.c_symmetry_group)
 *         abelianization = SymmetryGroup(self.is_full_group(), True)
 *         abelianization._set_c_symmetry_group(c_abelianization)             # <<<<<<<<<<<<<<
 *         return abelianization.abelian_description()
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *)__pyx_v_abelianization->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_abelianization, __pyx_v_c_abelianization); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":254
 *         abelianization = SymmetryGroup(self.is_full_group(), True)
 *         abelianization._set_c_symmetry_group(c_abelianization)
 *         return abelianization.abelian_description()             # <<<<<<<<<<<<<<
 * 
 *     def center(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_abelianization);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_abelian_description, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":236
 *         return comm_subgroup
 * 
 *     def abelianization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the abelianization of the symmetry group
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.abelianization", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_abelianization);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":256
 *         return abelianization.abelian_description()
 * 
 *     def center(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the center of the symmetry group
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_35center(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_8SnapPyHP_13SymmetryGroup_34center, "\n        Return the center of the symmetry group\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.center()\n        Z/2\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_35center = {"center", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_35center, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_34center};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_35center(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("center (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("center", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("center", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_34center(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_34center(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_center;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_center = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  SymmetryGroup *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("center", 0);

  /* "cython/core/symmetry_group.pyx":265
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group not known.')
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_full_group, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(9, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":266
 * 
 *         if not self.is_full_group():
 *             raise ValueError('The full symmetry group not known.')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_SymmetryGroup* c_center
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_full_symmetry_group_not_know};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(9, 266, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":265
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group not known.')
 * 
*/
  }

  /* "cython/core/symmetry_group.pyx":271
 *         cdef SymmetryGroup center
 * 
 *         c_center = get_center(self.c_symmetry_group)             # <<<<<<<<<<<<<<
 *         center = SymmetryGroup(self.is_full_group(), True)
 *         center._set_c_symmetry_group(c_center)
*/
  __pyx_t_7 = get_center(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 271, __pyx_L1_error)
  __pyx_v_c_center = __pyx_t_7;

  /* "cython/core/symmetry_group.pyx":272
 * 
 *         c_center = get_center(self.c_symmetry_group)
 *         center = SymmetryGroup(self.is_full_group(), True)             # <<<<<<<<<<<<<<
 *         center._set_c_symmetry_group(c_center)
 *         return center.abelian_description()
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup);
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup); 
  __pyx_t_9 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_full_group, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_8, Py_True};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 272, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_center = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":273
 *         c_center = get_center(self.c_symmetry_group)
 *         center = SymmetryGroup(self.is_full_group(), True)
 *         center._set_c_symmetry_group(c_center)             # <<<<<<<<<<<<<<
 *         return center.abelian_description()
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup *)__pyx_v_center->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_center, __pyx_v_c_center); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":274
 *         center = SymmetryGroup(self.is_full_group(), True)
 *         center._set_c_symmetry_group(c_center)
 *         return center.abelian_description()             # <<<<<<<<<<<<<<
 * 
 *     def multiply_elements(self, i, j):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_center);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_abelian_description, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":256
 *         return abelianization.abelian_description()
 * 
 *     def center(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the center of the symmetry group
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.center", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_center);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":276
 *         return center.abelian_description()
 * 
 *     def multiply_elements(self, i, j):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the product of group elements i and j.  The convention
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_37multiply_elements(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_8SnapPyHP_13SymmetryGroup_36multiply_elements, "\n        Returns the product of group elements i and j.  The convention\n        is that products of symmetries read right to left.  That is,\n        the composition (symmetry[i] o symmetry[j]) acts by first\n        doing symmetry[j], then symmetry[i].\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.multiply_elements(2, 3)\n        1\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_37multiply_elements = {"multiply_elements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_37multiply_elements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_36multiply_elements};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_37multiply_elements(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_i = 0;
  PyObject *__pyx_v_j = 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("multiply_elements (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i,&__pyx_mstate_global->__pyx_n_u_j,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 276, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 276, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 276, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "multiply_elements", 0) < 0) __PYX_ERR(9, 276, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("multiply_elements", 1, 2, 2, i); __PYX_ERR(9, 276, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 276, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 276, __pyx_L3_error)
    }
    __pyx_v_i = values[0];
    __pyx_v_j = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("multiply_elements", 1, 2, 2, __pyx_nargs); __PYX_ERR(9, 276, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.multiply_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_36multiply_elements(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self), __pyx_v_i, __pyx_v_j);

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_36multiply_elements(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
  PyObject *__pyx_v_order = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("multiply_elements", 0);

  /* "cython/core/symmetry_group.pyx":287
 *         1
 *         """
 *         order = self.order()             # <<<<<<<<<<<<<<
 *         for x in [i, j]:
 *             if not (0 <= x < order):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_order, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_order = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":288
 *         """
 *         order = self.order()
 *         for x in [i, j]:             # <<<<<<<<<<<<<<
 *             if not (0 <= x < order):
 *                 raise ValueError('The symmetry group has only %d '
*/
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_i);
  __Pyx_GIVEREF(__pyx_v_i);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_i) != (0)) __PYX_ERR(9, 288, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_j);
  __Pyx_GIVEREF(__pyx_v_j);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_j) != (0)) __PYX_ERR(9, 288, __pyx_L1_error);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_4 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
    #endif
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/symmetry_group.pyx":289
 *         order = self.order()
 *         for x in [i, j]:
 *             if not (0 <= x < order):             # <<<<<<<<<<<<<<
 *                 raise ValueError('The symmetry group has only %d '
 *                                  'elements.' % order)
*/
    __pyx_t_1 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_x, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 289, __pyx_L1_error)
    if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_x, __pyx_v_order, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 289, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(9, 289, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (!__pyx_t_5);
    if (unlikely(__pyx_t_6)) {

      /* "cython/core/symmetry_group.pyx":290
 *         for x in [i, j]:
 *             if not (0 <= x < order):
 *                 raise ValueError('The symmetry group has only %d '             # <<<<<<<<<<<<<<
 *                                  'elements.' % order)
 * 
*/
      __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_8 = __pyx_builtin_ValueError; 

      /* "cython/core/symmetry_group.pyx":291
 *             if not (0 <= x < order):
 *                 raise ValueError('The symmetry group has only %d '
 *                                  'elements.' % order)             # <<<<<<<<<<<<<<
 * 
 *         return symmetry_group_product(self.c_symmetry_group, i, j)
*/
      __pyx_t_9 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_The_symmetry_group_has_only_d_el, __pyx_v_order); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(9, 290, __pyx_L1_error)

      /* "cython/core/symmetry_group.pyx":289
 *         order = self.order()
 *         for x in [i, j]:
 *             if not (0 <= x < order):             # <<<<<<<<<<<<<<
 *                 raise ValueError('The symmetry group has only %d '
 *                                  'elements.' % order)
*/
    }

    /* "cython/core/symmetry_group.pyx":288
 *         """
 *         order = self.order()
 *         for x in [i, j]:             # <<<<<<<<<<<<<<
 *             if not (0 <= x < order):
 *                 raise ValueError('The symmetry group has only %d '
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":293
 *                                  'elements.' % order)
 * 
 *         return symmetry_group_product(self.c_symmetry_group, i, j)             # <<<<<<<<<<<<<<
 * 
 *     def isometries(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_v_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 293, __pyx_L1_error)
  __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_j); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 293, __pyx_L1_error)
  __pyx_t_12 = symmetry_group_product(__pyx_v_self->c_symmetry_group, __pyx_t_10, __pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 293, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":276
 *         return center.abelian_description()
 * 
 *     def multiply_elements(self, i, j):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the product of group elements i and j.  The convention
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.multiply_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_order);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":295
 *         return symmetry_group_product(self.c_symmetry_group, i, j)
 * 
 *     def isometries(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a detailed list of all the isometries in the symmetry group.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_39isometries(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_8SnapPyHP_13SymmetryGroup_38isometries, "\n        Return a detailed list of all the isometries in the symmetry group.\n\n        >>> S = Manifold('s959').symmetry_group()\n        >>> isoms = S.isometries()\n        >>> isoms[8]\n        0 -> 1   1 -> 0\n        [-1 -1]  [ 0  1]\n        [ 1  0]  [-1 -1]\n        Does not extend to link\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_39isometries = {"isometries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_39isometries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_38isometries};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_39isometries(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("isometries (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isometries", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isometries", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_38isometries(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_38isometries(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  IsometryList *__pyx_v_isometries;
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  IsometryList *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isometries", 0);

  /* "cython/core/symmetry_group.pyx":309
 *         cdef IsometryList *isometries
 * 
 *         isometries = get_symmetry_list(self.c_symmetry_group)             # <<<<<<<<<<<<<<
 *         ans = IsometryListToIsometries(isometries)
 *         return ans
*/
  __pyx_t_1 = get_symmetry_list(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 309, __pyx_L1_error)
  __pyx_v_isometries = __pyx_t_1;

  /* "cython/core/symmetry_group.pyx":310
 * 
 *         isometries = get_symmetry_list(self.c_symmetry_group)
 *         ans = IsometryListToIsometries(isometries)             # <<<<<<<<<<<<<<
 *         return ans
*/
  __pyx_t_2 = __pyx_f_8SnapPyHP_IsometryListToIsometries(__pyx_v_isometries); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":311
 *         isometries = get_symmetry_list(self.c_symmetry_group)
 *         ans = IsometryListToIsometries(isometries)
 *         return ans             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":295
 *         return symmetry_group_product(self.c_symmetry_group, i, j)
 * 
 *     def isometries(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a detailed list of all the isometries in the symmetry group.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.isometries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/symmetry_group.pyx":13
 *     """
 *     cdef c_SymmetryGroup *c_symmetry_group
 *     cdef readonly _is_full_group             # <<<<<<<<<<<<<<
 *     cdef readonly _owns_c_symmetry_group
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_14_is_full_group_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_14_is_full_group_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_8SnapPyHP_13SymmetryGroup_14_is_full_group___get__(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_14_is_full_group___get__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_is_full_group);
  __pyx_r = __pyx_v_self->_is_full_group;
  goto __pyx_L0;

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

/* "cython/core/symmetry_group.pyx":14
 *     cdef c_SymmetryGroup *c_symmetry_group
 *     cdef readonly _is_full_group
 *     cdef readonly _owns_c_symmetry_group             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, is_full_group, owns_c_symmetry_group):
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_22_owns_c_symmetry_group_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_22_owns_c_symmetry_group_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_8SnapPyHP_13SymmetryGroup_22_owns_c_symmetry_group___get__(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_13SymmetryGroup_22_owns_c_symmetry_group___get__(struct __pyx_obj_8SnapPyHP_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_owns_c_symmetry_group);
  __pyx_r = __pyx_v_self->_owns_c_symmetry_group;
  goto __pyx_L0;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_41__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_41__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_41__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_41__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_40__reduce_cython__(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self));

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_43__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13SymmetryGroup_43__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_43__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13SymmetryGroup_43__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
) {
  CYTHON_UNUSED 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.SymmetryGroup.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13SymmetryGroup_42__setstate_cython__(((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)__pyx_v_self), __pyx_v___pyx_state);

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

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

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

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

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

/* "cython/core/dirichlet.pyx":3
 * # Dirichlet Domains
 * 
 * cdef (WEPolyhedron*, int) get_generators_from_bytes(data_bytes,             # <<<<<<<<<<<<<<
 *                                                     double vertex_epsilon,
 *                                                     displacement,
*/

static __pyx_ctuple_WEPolyhedron__ptr__and_int __pyx_f_8SnapPyHP_get_generators_from_bytes(PyObject *__pyx_v_data_bytes, double __pyx_v_vertex_epsilon, PyObject *__pyx_v_displacement, CYTHON_UNUSED PyObject *__pyx_v_centroid_at_origin, PyObject *__pyx_v_maximize_injectivity_radius, PyObject *__pyx_v_include_words) {
  int __pyx_v_num_gens;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_nums = NULL;
  PyObject *__pyx_v_line = NULL;
  O31Matrix *__pyx_v_generators;
  MoebiusTransformation *__pyx_v_temp_gens;
  int __pyx_v_i;
  long __pyx_v_j;
  long __pyx_v_k;
  PyObject *__pyx_v_num_string = NULL;
  WEPolyhedron *__pyx_v_dirichlet_domain;
  double __pyx_v_c_displacement[3];
  long __pyx_v_n;
  __pyx_ctuple_WEPolyhedron__ptr__and_int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  long __pyx_t_12;
  char *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Boolean __pyx_t_16;
  double __pyx_t_17;
  Boolean __pyx_t_18;
  WEPolyhedron *__pyx_t_19;
  __pyx_ctuple_WEPolyhedron__ptr__and_int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_generators_from_bytes", 0);

  /* "cython/core/dirichlet.pyx":12
 *     cdef int num_gens
 * 
 *     data = data_bytes.split(b'\n')             # <<<<<<<<<<<<<<
 *     if data[0].strip() != b'% Generators':
 *         raise ValueError('The generator data does not start with '
*/
  __pyx_t_2 = __pyx_v_data_bytes;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_b_};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":13
 * 
 *     data = data_bytes.split(b'\n')
 *     if data[0].strip() != b'% Generators':             # <<<<<<<<<<<<<<
 *         raise ValueError('The generator data does not start with '
 *                          '"% Generators"')
*/
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_b_Generators_2, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(10, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/dirichlet.pyx":14
 *     data = data_bytes.split(b'\n')
 *     if data[0].strip() != b'% Generators':
 *         raise ValueError('The generator data does not start with '             # <<<<<<<<<<<<<<
 *                          '"% Generators"')
 *     nums = []
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_2 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_generator_data_does_not_star};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(10, 14, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":13
 * 
 *     data = data_bytes.split(b'\n')
 *     if data[0].strip() != b'% Generators':             # <<<<<<<<<<<<<<
 *         raise ValueError('The generator data does not start with '
 *                          '"% Generators"')
*/
  }

  /* "cython/core/dirichlet.pyx":16
 *         raise ValueError('The generator data does not start with '
 *                          '"% Generators"')
 *     nums = []             # <<<<<<<<<<<<<<
 *     for line in data[1:]:
 *         nums += line.split()
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nums = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":17
 *                          '"% Generators"')
 *     nums = []
 *     for line in data[1:]:             # <<<<<<<<<<<<<<
 *         nums += line.split()
 *     num_gens = int(nums[0])
*/
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[5], 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 17, __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_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 17, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 17, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 17, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 17, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(10, 17, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":18
 *     nums = []
 *     for line in data[1:]:
 *         nums += line.split()             # <<<<<<<<<<<<<<
 *     num_gens = int(nums[0])
 *     nums.pop(0)
*/
    __pyx_t_4 = __pyx_v_line;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_nums, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_nums, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/dirichlet.pyx":17
 *                          '"% Generators"')
 *     nums = []
 *     for line in data[1:]:             # <<<<<<<<<<<<<<
 *         nums += line.split()
 *     num_gens = int(nums[0])
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":19
 *     for line in data[1:]:
 *         nums += line.split()
 *     num_gens = int(nums[0])             # <<<<<<<<<<<<<<
 *     nums.pop(0)
 * 
*/
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nums, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_num_gens = __pyx_t_8;

  /* "cython/core/dirichlet.pyx":20
 *         nums += line.split()
 *     num_gens = int(nums[0])
 *     nums.pop(0)             # <<<<<<<<<<<<<<
 * 
 *     cdef O31Matrix *generators
*/
  __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/dirichlet.pyx":24
 *     cdef O31Matrix *generators
 *     cdef MoebiusTransformation *temp_gens
 *     if len(nums) == 16 * num_gens:             # <<<<<<<<<<<<<<
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
 *         for i in range(num_gens):
*/
  __pyx_t_6 = PyObject_Length(__pyx_v_nums); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(10, 24, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 == (16 * __pyx_v_num_gens));
  if (__pyx_t_5) {

    /* "cython/core/dirichlet.pyx":25
 *     cdef MoebiusTransformation *temp_gens
 *     if len(nums) == 16 * num_gens:
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))             # <<<<<<<<<<<<<<
 *         for i in range(num_gens):
 *             for j in range(4):
*/
    __pyx_v_generators = ((O31Matrix *)malloc((__pyx_v_num_gens * (sizeof(O31Matrix)))));

    /* "cython/core/dirichlet.pyx":26
 *     if len(nums) == 16 * num_gens:
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
 *         for i in range(num_gens):             # <<<<<<<<<<<<<<
 *             for j in range(4):
 *                 for k in range(4):
*/
    __pyx_t_8 = __pyx_v_num_gens;
    __pyx_t_9 = __pyx_t_8;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "cython/core/dirichlet.pyx":27
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
 *         for i in range(num_gens):
 *             for j in range(4):             # <<<<<<<<<<<<<<
 *                 for k in range(4):
 *                     num_string = nums.pop(0)  # save a reference
*/
      for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
        __pyx_v_j = __pyx_t_11;

        /* "cython/core/dirichlet.pyx":28
 *         for i in range(num_gens):
 *             for j in range(4):
 *                 for k in range(4):             # <<<<<<<<<<<<<<
 *                     num_string = nums.pop(0)  # save a reference
 *                     generators[i][j][k] = <Real_struct>Real_from_string(
*/
        for (__pyx_t_12 = 0; __pyx_t_12 < 4; __pyx_t_12+=1) {
          __pyx_v_k = __pyx_t_12;

          /* "cython/core/dirichlet.pyx":29
 *             for j in range(4):
 *                 for k in range(4):
 *                     num_string = nums.pop(0)  # save a reference             # <<<<<<<<<<<<<<
 *                     generators[i][j][k] = <Real_struct>Real_from_string(
 *                         <char*>num_string)
*/
          __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 29, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_v_num_string, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "cython/core/dirichlet.pyx":31
 *                     num_string = nums.pop(0)  # save a reference
 *                     generators[i][j][k] = <Real_struct>Real_from_string(
 *                         <char*>num_string)             # <<<<<<<<<<<<<<
 *     elif len(nums) == 8*num_gens:
 *         temp_gens = <MoebiusTransformation *>malloc(
*/
          __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_num_string); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(10, 31, __pyx_L1_error)

          /* "cython/core/dirichlet.pyx":30
 *                 for k in range(4):
 *                     num_string = nums.pop(0)  # save a reference
 *                     generators[i][j][k] = <Real_struct>Real_from_string(             # <<<<<<<<<<<<<<
 *                         <char*>num_string)
 *     elif len(nums) == 8*num_gens:
*/
          (((__pyx_v_generators[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) = Real_from_string(((char *)__pyx_t_13));
        }
      }
    }

    /* "cython/core/dirichlet.pyx":24
 *     cdef O31Matrix *generators
 *     cdef MoebiusTransformation *temp_gens
 *     if len(nums) == 16 * num_gens:             # <<<<<<<<<<<<<<
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
 *         for i in range(num_gens):
*/
    goto __pyx_L7;
  }

  /* "cython/core/dirichlet.pyx":32
 *                     generators[i][j][k] = <Real_struct>Real_from_string(
 *                         <char*>num_string)
 *     elif len(nums) == 8*num_gens:             # <<<<<<<<<<<<<<
 *         temp_gens = <MoebiusTransformation *>malloc(
 *             num_gens*sizeof(MoebiusTransformation))
*/
  __pyx_t_6 = PyObject_Length(__pyx_v_nums); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(10, 32, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 == (8 * __pyx_v_num_gens));
  if (likely(__pyx_t_5)) {

    /* "cython/core/dirichlet.pyx":33
 *                         <char*>num_string)
 *     elif len(nums) == 8*num_gens:
 *         temp_gens = <MoebiusTransformation *>malloc(             # <<<<<<<<<<<<<<
 *             num_gens*sizeof(MoebiusTransformation))
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
*/
    __pyx_v_temp_gens = ((MoebiusTransformation *)malloc((__pyx_v_num_gens * (sizeof(MoebiusTransformation)))));

    /* "cython/core/dirichlet.pyx":35
 *         temp_gens = <MoebiusTransformation *>malloc(
 *             num_gens*sizeof(MoebiusTransformation))
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))             # <<<<<<<<<<<<<<
 *         for i in range(num_gens):
 *             temp_gens[i].parity = orientation_preserving
*/
    __pyx_v_generators = ((O31Matrix *)malloc((__pyx_v_num_gens * (sizeof(O31Matrix)))));

    /* "cython/core/dirichlet.pyx":36
 *             num_gens*sizeof(MoebiusTransformation))
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
 *         for i in range(num_gens):             # <<<<<<<<<<<<<<
 *             temp_gens[i].parity = orientation_preserving
 *             for j in range(2):
*/
    __pyx_t_8 = __pyx_v_num_gens;
    __pyx_t_9 = __pyx_t_8;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "cython/core/dirichlet.pyx":37
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
 *         for i in range(num_gens):
 *             temp_gens[i].parity = orientation_preserving             # <<<<<<<<<<<<<<
 *             for j in range(2):
 *                 for k in range(2):
*/
      (__pyx_v_temp_gens[__pyx_v_i]).parity = orientation_preserving;

      /* "cython/core/dirichlet.pyx":38
 *         for i in range(num_gens):
 *             temp_gens[i].parity = orientation_preserving
 *             for j in range(2):             # <<<<<<<<<<<<<<
 *                 for k in range(2):
 *                     num_string = nums.pop(0)  # save a reference
*/
      for (__pyx_t_11 = 0; __pyx_t_11 < 2; __pyx_t_11+=1) {
        __pyx_v_j = __pyx_t_11;

        /* "cython/core/dirichlet.pyx":39
 *             temp_gens[i].parity = orientation_preserving
 *             for j in range(2):
 *                 for k in range(2):             # <<<<<<<<<<<<<<
 *                     num_string = nums.pop(0)  # save a reference
 *                     temp_gens[i].matrix[j][k].real = Real_from_string(
*/
        for (__pyx_t_12 = 0; __pyx_t_12 < 2; __pyx_t_12+=1) {
          __pyx_v_k = __pyx_t_12;

          /* "cython/core/dirichlet.pyx":40
 *             for j in range(2):
 *                 for k in range(2):
 *                     num_string = nums.pop(0)  # save a reference             # <<<<<<<<<<<<<<
 *                     temp_gens[i].matrix[j][k].real = Real_from_string(
 *                         <char*>num_string)
*/
          __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 40, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_v_num_string, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "cython/core/dirichlet.pyx":42
 *                     num_string = nums.pop(0)  # save a reference
 *                     temp_gens[i].matrix[j][k].real = Real_from_string(
 *                         <char*>num_string)             # <<<<<<<<<<<<<<
 *                     num_string = nums.pop(0)  # save a reference
 *                     temp_gens[i].matrix[j][k].imag = Real_from_string(
*/
          __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_num_string); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(10, 42, __pyx_L1_error)

          /* "cython/core/dirichlet.pyx":41
 *                 for k in range(2):
 *                     num_string = nums.pop(0)  # save a reference
 *                     temp_gens[i].matrix[j][k].real = Real_from_string(             # <<<<<<<<<<<<<<
 *                         <char*>num_string)
 *                     num_string = nums.pop(0)  # save a reference
*/
          (((__pyx_v_temp_gens[__pyx_v_i]).matrix[__pyx_v_j])[__pyx_v_k]).real = Real_from_string(((char *)__pyx_t_13));

          /* "cython/core/dirichlet.pyx":43
 *                     temp_gens[i].matrix[j][k].real = Real_from_string(
 *                         <char*>num_string)
 *                     num_string = nums.pop(0)  # save a reference             # <<<<<<<<<<<<<<
 *                     temp_gens[i].matrix[j][k].imag = Real_from_string(
 *                         <char*>num_string)
*/
          __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 43, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_num_string, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "cython/core/dirichlet.pyx":45
 *                     num_string = nums.pop(0)  # save a reference
 *                     temp_gens[i].matrix[j][k].imag = Real_from_string(
 *                         <char*>num_string)             # <<<<<<<<<<<<<<
 *         Moebius_array_to_O31_array(temp_gens, generators, num_gens)
 *         free(temp_gens)
*/
          __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_num_string); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(10, 45, __pyx_L1_error)

          /* "cython/core/dirichlet.pyx":44
 *                         <char*>num_string)
 *                     num_string = nums.pop(0)  # save a reference
 *                     temp_gens[i].matrix[j][k].imag = Real_from_string(             # <<<<<<<<<<<<<<
 *                         <char*>num_string)
 *         Moebius_array_to_O31_array(temp_gens, generators, num_gens)
*/
          (((__pyx_v_temp_gens[__pyx_v_i]).matrix[__pyx_v_j])[__pyx_v_k]).imag = Real_from_string(((char *)__pyx_t_13));
        }
      }
    }

    /* "cython/core/dirichlet.pyx":46
 *                     temp_gens[i].matrix[j][k].imag = Real_from_string(
 *                         <char*>num_string)
 *         Moebius_array_to_O31_array(temp_gens, generators, num_gens)             # <<<<<<<<<<<<<<
 *         free(temp_gens)
 *     else:
*/
    Moebius_array_to_O31_array(__pyx_v_temp_gens, __pyx_v_generators, __pyx_v_num_gens); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 46, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":47
 *                         <char*>num_string)
 *         Moebius_array_to_O31_array(temp_gens, generators, num_gens)
 *         free(temp_gens)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('The amount of data given is not consistent '
*/
    free(__pyx_v_temp_gens);

    /* "cython/core/dirichlet.pyx":32
 *                     generators[i][j][k] = <Real_struct>Real_from_string(
 *                         <char*>num_string)
 *     elif len(nums) == 8*num_gens:             # <<<<<<<<<<<<<<
 *         temp_gens = <MoebiusTransformation *>malloc(
 *             num_gens*sizeof(MoebiusTransformation))
*/
    goto __pyx_L7;
  }

  /* "cython/core/dirichlet.pyx":49
 *         free(temp_gens)
 *     else:
 *         raise ValueError('The amount of data given is not consistent '             # <<<<<<<<<<<<<<
 *                          'with %d O31 or SL2C matrices.' % num_gens)
 * 
*/
  /*else*/ {
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_1 = __pyx_builtin_ValueError; 

    /* "cython/core/dirichlet.pyx":50
 *     else:
 *         raise ValueError('The amount of data given is not consistent '
 *                          'with %d O31 or SL2C matrices.' % num_gens)             # <<<<<<<<<<<<<<
 * 
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):
*/
    __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_num_gens); if (unlikely(!__pyx_t_14)) __PYX_ERR(10, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_The_amount_of_data_given_is_not, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(10, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_15};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(10, 49, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "cython/core/dirichlet.pyx":52
 *                          'with %d O31 or SL2C matrices.' % num_gens)
 * 
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):             # <<<<<<<<<<<<<<
 *         raise ValueError('The data given do not have the '
 *                          'right determinants.')
*/
  __pyx_t_16 = O31_determinants_OK(__pyx_v_generators, __pyx_v_num_gens, det_error_epsilon); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 52, __pyx_L1_error)
  __pyx_t_5 = (!(__pyx_t_16 != 0));
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/dirichlet.pyx":53
 * 
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):
 *         raise ValueError('The data given do not have the '             # <<<<<<<<<<<<<<
 *                          'right determinants.')
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_15 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_The_data_given_do_not_have_the_r};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(10, 53, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":52
 *                          'with %d O31 or SL2C matrices.' % num_gens)
 * 
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):             # <<<<<<<<<<<<<<
 *         raise ValueError('The data given do not have the '
 *                          'right determinants.')
*/
  }

  /* "cython/core/dirichlet.pyx":58
 *     cdef WEPolyhedron *dirichlet_domain
 *     cdef double c_displacement[3]
 *     for n from 0 <= n < 3:             # <<<<<<<<<<<<<<
 *         c_displacement[n] = <double>displacement[n]
 *     dirichlet_domain = Dirichlet_from_generators_with_displacement(
*/
  for (__pyx_v_n = 0; __pyx_v_n < 3; __pyx_v_n++) {

    /* "cython/core/dirichlet.pyx":59
 *     cdef double c_displacement[3]
 *     for n from 0 <= n < 3:
 *         c_displacement[n] = <double>displacement[n]             # <<<<<<<<<<<<<<
 *     dirichlet_domain = Dirichlet_from_generators_with_displacement(
 *         generators, num_gens, c_displacement, vertex_epsilon,
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_displacement, __pyx_v_n, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_17 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 59, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_c_displacement[__pyx_v_n]) = ((double)__pyx_t_17);
  }

  /* "cython/core/dirichlet.pyx":62
 *     dirichlet_domain = Dirichlet_from_generators_with_displacement(
 *         generators, num_gens, c_displacement, vertex_epsilon,
 *         Dirichlet_keep_going, maximize_injectivity_radius,             # <<<<<<<<<<<<<<
 *         include_words)
 *     free(generators)
*/
  __pyx_t_16 = __Pyx_PyLong_As_Boolean(__pyx_v_maximize_injectivity_radius); if (unlikely((__pyx_t_16 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 62, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":63
 *         generators, num_gens, c_displacement, vertex_epsilon,
 *         Dirichlet_keep_going, maximize_injectivity_radius,
 *         include_words)             # <<<<<<<<<<<<<<
 *     free(generators)
 *     return dirichlet_domain, num_gens
*/
  __pyx_t_18 = __Pyx_PyLong_As_Boolean(__pyx_v_include_words); if (unlikely((__pyx_t_18 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 63, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":60
 *     for n from 0 <= n < 3:
 *         c_displacement[n] = <double>displacement[n]
 *     dirichlet_domain = Dirichlet_from_generators_with_displacement(             # <<<<<<<<<<<<<<
 *         generators, num_gens, c_displacement, vertex_epsilon,
 *         Dirichlet_keep_going, maximize_injectivity_radius,
*/
  __pyx_t_19 = Dirichlet_from_generators_with_displacement(__pyx_v_generators, __pyx_v_num_gens, __pyx_v_c_displacement, __pyx_v_vertex_epsilon, Dirichlet_keep_going, __pyx_t_16, __pyx_t_18); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 60, __pyx_L1_error)
  __pyx_v_dirichlet_domain = __pyx_t_19;

  /* "cython/core/dirichlet.pyx":64
 *         Dirichlet_keep_going, maximize_injectivity_radius,
 *         include_words)
 *     free(generators)             # <<<<<<<<<<<<<<
 *     return dirichlet_domain, num_gens
 * 
*/
  free(__pyx_v_generators);

  /* "cython/core/dirichlet.pyx":65
 *         include_words)
 *     free(generators)
 *     return dirichlet_domain, num_gens             # <<<<<<<<<<<<<<
 * 
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(matrices,
*/
  __pyx_t_20.f0 = __pyx_v_dirichlet_domain;
  __pyx_t_20.f1 = __pyx_v_num_gens;
  __pyx_r = __pyx_t_20;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":3
 * # Dirichlet Domains
 * 
 * cdef (WEPolyhedron*, int) get_generators_from_bytes(data_bytes,             # <<<<<<<<<<<<<<
 *                                                     double vertex_epsilon,
 *                                                     displacement,
*/

  /* 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_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPyHP.get_generators_from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_nums);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_num_string);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":67
 *     return dirichlet_domain, num_gens
 * 
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(matrices,             # <<<<<<<<<<<<<<
 *                                                   double vertex_epsilon,
 *                                                   displacement,
*/

static WEPolyhedron *__pyx_f_8SnapPyHP_dirichlet_from_O31_matrix_list(PyObject *__pyx_v_matrices, double __pyx_v_vertex_epsilon, PyObject *__pyx_v_displacement, CYTHON_UNUSED PyObject *__pyx_v_centroid_at_origin, PyObject *__pyx_v_maximize_injectivity_radius, PyObject *__pyx_v_include_words) {
  WEPolyhedron *__pyx_v_c_dirichlet_domain;
  O31Matrix *__pyx_v_generators;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  int __pyx_v_num_gens;
  PyObject *__pyx_v_A = NULL;
  double __pyx_v_c_displacement[3];
  long __pyx_v_n;
  WEPolyhedron *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_8SnapPyHP_Real __pyx_t_10;
  Boolean __pyx_t_11;
  int __pyx_t_12;
  size_t __pyx_t_13;
  double __pyx_t_14;
  Boolean __pyx_t_15;
  WEPolyhedron *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dirichlet_from_O31_matrix_list", 0);

  /* "cython/core/dirichlet.pyx":77
 *     cdef O31Matrix* generators
 *     cdef int i, j, k, num_gens
 *     num_gens = <int>len(matrices)             # <<<<<<<<<<<<<<
 *     generators = <O31Matrix*>malloc(num_gens*sizeof(O31Matrix))
 *     for i, A in enumerate(matrices):
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_matrices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 77, __pyx_L1_error)
  __pyx_v_num_gens = ((int)__pyx_t_1);

  /* "cython/core/dirichlet.pyx":78
 *     cdef int i, j, k, num_gens
 *     num_gens = <int>len(matrices)
 *     generators = <O31Matrix*>malloc(num_gens*sizeof(O31Matrix))             # <<<<<<<<<<<<<<
 *     for i, A in enumerate(matrices):
 *         for j in range(4):
*/
  __pyx_v_generators = ((O31Matrix *)malloc((__pyx_v_num_gens * (sizeof(O31Matrix)))));

  /* "cython/core/dirichlet.pyx":79
 *     num_gens = <int>len(matrices)
 *     generators = <O31Matrix*>malloc(num_gens*sizeof(O31Matrix))
 *     for i, A in enumerate(matrices):             # <<<<<<<<<<<<<<
 *         for j in range(4):
 *             for k in range(4):
*/
  __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_v_matrices)) || PyTuple_CheckExact(__pyx_v_matrices)) {
    __pyx_t_3 = __pyx_v_matrices; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_matrices); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 79, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 79, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 79, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 79, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(10, 79, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_A, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "cython/core/dirichlet.pyx":80
 *     generators = <O31Matrix*>malloc(num_gens*sizeof(O31Matrix))
 *     for i, A in enumerate(matrices):
 *         for j in range(4):             # <<<<<<<<<<<<<<
 *             for k in range(4):
 *                 generators[i][j][k] = <Real_struct>Object2Real(A[j,k])
*/
    for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
      __pyx_v_j = __pyx_t_6;

      /* "cython/core/dirichlet.pyx":81
 *     for i, A in enumerate(matrices):
 *         for j in range(4):
 *             for k in range(4):             # <<<<<<<<<<<<<<
 *                 generators[i][j][k] = <Real_struct>Object2Real(A[j,k])
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):
*/
      for (__pyx_t_7 = 0; __pyx_t_7 < 4; __pyx_t_7+=1) {
        __pyx_v_k = __pyx_t_7;

        /* "cython/core/dirichlet.pyx":82
 *         for j in range(4):
 *             for k in range(4):
 *                 generators[i][j][k] = <Real_struct>Object2Real(A[j,k])             # <<<<<<<<<<<<<<
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):
 *         raise ValueError('The data given do not have the '
*/
        __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_5);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5) != (0)) __PYX_ERR(10, 82, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_8);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(10, 82, __pyx_L1_error);
        __pyx_t_5 = 0;
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_A, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = __pyx_f_8SnapPyHP_Object2Real(__pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 82, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        (((__pyx_v_generators[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) = __pyx_t_10;
      }
    }

    /* "cython/core/dirichlet.pyx":79
 *     num_gens = <int>len(matrices)
 *     generators = <O31Matrix*>malloc(num_gens*sizeof(O31Matrix))
 *     for i, A in enumerate(matrices):             # <<<<<<<<<<<<<<
 *         for j in range(4):
 *             for k in range(4):
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":83
 *             for k in range(4):
 *                 generators[i][j][k] = <Real_struct>Object2Real(A[j,k])
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):             # <<<<<<<<<<<<<<
 *         raise ValueError('The data given do not have the '
 *                          'right determinants.')
*/
  __pyx_t_11 = O31_determinants_OK(__pyx_v_generators, __pyx_v_num_gens, det_error_epsilon); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 83, __pyx_L1_error)
  __pyx_t_12 = (!(__pyx_t_11 != 0));
  if (unlikely(__pyx_t_12)) {

    /* "cython/core/dirichlet.pyx":84
 *                 generators[i][j][k] = <Real_struct>Object2Real(A[j,k])
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):
 *         raise ValueError('The data given do not have the '             # <<<<<<<<<<<<<<
 *                          'right determinants.')
 *     cdef double c_displacement[3]
*/
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_9 = __pyx_builtin_ValueError; 
    __pyx_t_13 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_The_data_given_do_not_have_the_r};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(10, 84, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":83
 *             for k in range(4):
 *                 generators[i][j][k] = <Real_struct>Object2Real(A[j,k])
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):             # <<<<<<<<<<<<<<
 *         raise ValueError('The data given do not have the '
 *                          'right determinants.')
*/
  }

  /* "cython/core/dirichlet.pyx":87
 *                          'right determinants.')
 *     cdef double c_displacement[3]
 *     for n from 0 <= n < 3:             # <<<<<<<<<<<<<<
 *         c_displacement[n] = <double>displacement[n]
 *     c_dirichlet_domain = Dirichlet_from_generators_with_displacement(
*/
  for (__pyx_v_n = 0; __pyx_v_n < 3; __pyx_v_n++) {

    /* "cython/core/dirichlet.pyx":88
 *     cdef double c_displacement[3]
 *     for n from 0 <= n < 3:
 *         c_displacement[n] = <double>displacement[n]             # <<<<<<<<<<<<<<
 *     c_dirichlet_domain = Dirichlet_from_generators_with_displacement(
 *         generators, num_gens, c_displacement, vertex_epsilon,
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_displacement, __pyx_v_n, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 88, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_c_displacement[__pyx_v_n]) = ((double)__pyx_t_14);
  }

  /* "cython/core/dirichlet.pyx":91
 *     c_dirichlet_domain = Dirichlet_from_generators_with_displacement(
 *         generators, num_gens, c_displacement, vertex_epsilon,
 *         Dirichlet_keep_going, maximize_injectivity_radius,             # <<<<<<<<<<<<<<
 *         include_words)
 *     free(generators)
*/
  __pyx_t_11 = __Pyx_PyLong_As_Boolean(__pyx_v_maximize_injectivity_radius); if (unlikely((__pyx_t_11 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 91, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":92
 *         generators, num_gens, c_displacement, vertex_epsilon,
 *         Dirichlet_keep_going, maximize_injectivity_radius,
 *         include_words)             # <<<<<<<<<<<<<<
 *     free(generators)
 *     return c_dirichlet_domain
*/
  __pyx_t_15 = __Pyx_PyLong_As_Boolean(__pyx_v_include_words); if (unlikely((__pyx_t_15 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 92, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":89
 *     for n from 0 <= n < 3:
 *         c_displacement[n] = <double>displacement[n]
 *     c_dirichlet_domain = Dirichlet_from_generators_with_displacement(             # <<<<<<<<<<<<<<
 *         generators, num_gens, c_displacement, vertex_epsilon,
 *         Dirichlet_keep_going, maximize_injectivity_radius,
*/
  __pyx_t_16 = Dirichlet_from_generators_with_displacement(__pyx_v_generators, __pyx_v_num_gens, __pyx_v_c_displacement, __pyx_v_vertex_epsilon, Dirichlet_keep_going, __pyx_t_11, __pyx_t_15); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 89, __pyx_L1_error)
  __pyx_v_c_dirichlet_domain = __pyx_t_16;

  /* "cython/core/dirichlet.pyx":93
 *         Dirichlet_keep_going, maximize_injectivity_radius,
 *         include_words)
 *     free(generators)             # <<<<<<<<<<<<<<
 *     return c_dirichlet_domain
 * 
*/
  free(__pyx_v_generators);

  /* "cython/core/dirichlet.pyx":94
 *         include_words)
 *     free(generators)
 *     return c_dirichlet_domain             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_c_dirichlet_domain;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":67
 *     return dirichlet_domain, num_gens
 * 
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(matrices,             # <<<<<<<<<<<<<<
 *                                                   double vertex_epsilon,
 *                                                   displacement,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.dirichlet_from_O31_matrix_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":102
 *     cdef int c_num_generators
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_1_number_(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_1_number_ = {"_number_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_1_number_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_1_number_(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_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("_number_ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 102, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_number_", 0) < 0) __PYX_ERR(10, 102, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, i); __PYX_ERR(10, 102, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 102, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, __pyx_nargs); __PYX_ERR(10, 102, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain._number_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain__number_(__pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain__number_(PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/dirichlet.pyx":104
 *     @staticmethod
 *     def _number_(n):
 *         return number.number_to_native_number(n)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number_to_native_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_n};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":102
 *     cdef int c_num_generators
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

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

/* "cython/core/dirichlet.pyx":106
 *         return number.number_to_native_number(n)
 * 
 *     def __cinit__(self,             # <<<<<<<<<<<<<<
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_16CDirichletDomain_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_16CDirichletDomain_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_manifold = 0;
  PyObject *__pyx_v_vertex_epsilon = 0;
  PyObject *__pyx_v_displacement = 0;
  PyObject *__pyx_v_centroid_at_origin = 0;
  PyObject *__pyx_v_maximize_injectivity_radius = 0;
  PyObject *__pyx_v_include_words = 0;
  PyObject *__pyx_v_generator_file = 0;
  PyObject *__pyx_v_generator_bytes = 0;
  PyObject *__pyx_v_O31_generators = 0;
  PyObject *__pyx_v_manifold_name = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_manifold,&__pyx_mstate_global->__pyx_n_u_vertex_epsilon,&__pyx_mstate_global->__pyx_n_u_displacement,&__pyx_mstate_global->__pyx_n_u_centroid_at_origin,&__pyx_mstate_global->__pyx_n_u_maximize_injectivity_radius,&__pyx_mstate_global->__pyx_n_u_include_words,&__pyx_mstate_global->__pyx_n_u_generator_file,&__pyx_mstate_global->__pyx_n_u_generator_bytes,&__pyx_mstate_global->__pyx_n_u_O31_generators,&__pyx_mstate_global->__pyx_n_u_manifold_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 106, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(10, 106, __pyx_L3_error)

      /* "cython/core/dirichlet.pyx":107
 * 
 *     def __cinit__(self,
 *                   Manifold manifold=None,             # <<<<<<<<<<<<<<
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_8SnapPyHP_Manifold *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__38);

      /* "cython/core/dirichlet.pyx":109
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=None,             # <<<<<<<<<<<<<<
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/dirichlet.pyx":110
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=None,
 *                   centroid_at_origin=True,             # <<<<<<<<<<<<<<
 *                   maximize_injectivity_radius=True,
 *                   include_words = False,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/dirichlet.pyx":111
 *                   displacement=None,
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,             # <<<<<<<<<<<<<<
 *                   include_words = False,
 *                   str generator_file='',
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/dirichlet.pyx":112
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,
 *                   include_words = False,             # <<<<<<<<<<<<<<
 *                   str generator_file='',
 *                   bytes generator_bytes=b'',
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__10));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__10));

      /* "cython/core/dirichlet.pyx":115
 *                   str generator_file='',
 *                   bytes generator_bytes=b'',
 *                   O31_generators=None,             # <<<<<<<<<<<<<<
 *                   str manifold_name='unnamed'):
 *         cdef double c_displacement[3]
*/
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_unnamed));
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "cython/core/dirichlet.pyx":107
 * 
 *     def __cinit__(self,
 *                   Manifold manifold=None,             # <<<<<<<<<<<<<<
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_8SnapPyHP_Manifold *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__38);

      /* "cython/core/dirichlet.pyx":109
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=None,             # <<<<<<<<<<<<<<
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "cython/core/dirichlet.pyx":110
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=None,
 *                   centroid_at_origin=True,             # <<<<<<<<<<<<<<
 *                   maximize_injectivity_radius=True,
 *                   include_words = False,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/dirichlet.pyx":111
 *                   displacement=None,
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,             # <<<<<<<<<<<<<<
 *                   include_words = False,
 *                   str generator_file='',
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/dirichlet.pyx":112
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,
 *                   include_words = False,             # <<<<<<<<<<<<<<
 *                   str generator_file='',
 *                   bytes generator_bytes=b'',
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__10));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__10));

      /* "cython/core/dirichlet.pyx":115
 *                   str generator_file='',
 *                   bytes generator_bytes=b'',
 *                   O31_generators=None,             # <<<<<<<<<<<<<<
 *                   str manifold_name='unnamed'):
 *         cdef double c_displacement[3]
*/
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_unnamed));
    }
    __pyx_v_manifold = ((struct __pyx_obj_8SnapPyHP_Manifold *)values[0]);
    __pyx_v_vertex_epsilon = values[1];
    __pyx_v_displacement = values[2];
    __pyx_v_centroid_at_origin = values[3];
    __pyx_v_maximize_injectivity_radius = values[4];
    __pyx_v_include_words = values[5];
    __pyx_v_generator_file = ((PyObject*)values[6]);
    __pyx_v_generator_bytes = ((PyObject*)values[7]);
    __pyx_v_O31_generators = values[8];
    __pyx_v_manifold_name = ((PyObject*)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, __pyx_nargs); __PYX_ERR(10, 106, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_manifold), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, 1, "manifold", 0))) __PYX_ERR(10, 107, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_generator_file), (&PyUnicode_Type), 1, "generator_file", 1))) __PYX_ERR(10, 113, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_generator_bytes), (&PyBytes_Type), 1, "generator_bytes", 1))) __PYX_ERR(10, 114, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_manifold_name), (&PyUnicode_Type), 1, "manifold_name", 1))) __PYX_ERR(10, 116, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_2__cinit__(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self), __pyx_v_manifold, __pyx_v_vertex_epsilon, __pyx_v_displacement, __pyx_v_centroid_at_origin, __pyx_v_maximize_injectivity_radius, __pyx_v_include_words, __pyx_v_generator_file, __pyx_v_generator_bytes, __pyx_v_O31_generators, __pyx_v_manifold_name);

  /* "cython/core/dirichlet.pyx":106
 *         return number.number_to_native_number(n)
 * 
 *     def __cinit__(self,             # <<<<<<<<<<<<<<
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
*/

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

static int __pyx_pf_8SnapPyHP_16CDirichletDomain_2__cinit__(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_manifold, PyObject *__pyx_v_vertex_epsilon, PyObject *__pyx_v_displacement, PyObject *__pyx_v_centroid_at_origin, PyObject *__pyx_v_maximize_injectivity_radius, PyObject *__pyx_v_include_words, PyObject *__pyx_v_generator_file, PyObject *__pyx_v_generator_bytes, PyObject *__pyx_v_O31_generators, PyObject *__pyx_v_manifold_name) {
  double __pyx_v_c_displacement[3];
  PyObject *__pyx_v_input_file = NULL;
  PyObject *__pyx_v_data = NULL;
  long __pyx_v_n;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  double __pyx_t_13;
  __pyx_ctuple_WEPolyhedron__ptr__and_int __pyx_t_14;
  WEPolyhedron *__pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Boolean __pyx_t_18;
  Boolean __pyx_t_19;
  Boolean __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_displacement);

  /* "cython/core/dirichlet.pyx":118
 *                   str manifold_name='unnamed'):
 *         cdef double c_displacement[3]
 *         if displacement is None:             # <<<<<<<<<<<<<<
 *             displacement = [0.0, 0.0, 0.0]
 *         self.c_dirichlet_domain = NULL
*/
  __pyx_t_1 = (__pyx_v_displacement == Py_None);
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":119
 *         cdef double c_displacement[3]
 *         if displacement is None:
 *             displacement = [0.0, 0.0, 0.0]             # <<<<<<<<<<<<<<
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':
*/
    __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_0);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_float_0_0) != (0)) __PYX_ERR(10, 119, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_0);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_float_0_0) != (0)) __PYX_ERR(10, 119, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_0);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_float_0_0) != (0)) __PYX_ERR(10, 119, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_displacement, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":118
 *                   str manifold_name='unnamed'):
 *         cdef double c_displacement[3]
 *         if displacement is None:             # <<<<<<<<<<<<<<
 *             displacement = [0.0, 0.0, 0.0]
 *         self.c_dirichlet_domain = NULL
*/
  }

  /* "cython/core/dirichlet.pyx":120
 *         if displacement is None:
 *             displacement = [0.0, 0.0, 0.0]
 *         self.c_dirichlet_domain = NULL             # <<<<<<<<<<<<<<
 *         if generator_file != '':
 *             with open(generator_file, mode='rb') as input_file:
*/
  __pyx_v_self->c_dirichlet_domain = NULL;

  /* "cython/core/dirichlet.pyx":121
 *             displacement = [0.0, 0.0, 0.0]
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':             # <<<<<<<<<<<<<<
 *             with open(generator_file, mode='rb') as input_file:
 *                 data = input_file.read()
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_generator_file, __pyx_mstate_global->__pyx_kp_u__10, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 121, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":122
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':
 *             with open(generator_file, mode='rb') as input_file:             # <<<<<<<<<<<<<<
 *                 data = input_file.read()
 *             self.c_dirichlet_domain, self.c_num_generators = (
*/
    /*with:*/ {
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_open);
      __pyx_t_4 = __pyx_builtin_open; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_v_generator_file};
        __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 122, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_rb, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(10, 122, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 122, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = NULL;
      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 122, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 122, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          /*try:*/ {
            __pyx_v_input_file = __pyx_t_3;
            __pyx_t_3 = 0;

            /* "cython/core/dirichlet.pyx":123
 *         if generator_file != '':
 *             with open(generator_file, mode='rb') as input_file:
 *                 data = input_file.read()             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain, self.c_num_generators = (
 *                 get_generators_from_bytes(
*/
            __pyx_t_2 = __pyx_v_input_file;
            __Pyx_INCREF(__pyx_t_2);
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
              __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 123, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_3);
            }
            __pyx_v_data = __pyx_t_3;
            __pyx_t_3 = 0;

            /* "cython/core/dirichlet.pyx":122
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':
 *             with open(generator_file, mode='rb') as input_file:             # <<<<<<<<<<<<<<
 *                 data = input_file.read()
 *             self.c_dirichlet_domain, self.c_num_generators = (
*/
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L14_try_end;
          __pyx_L9_error:;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(10, 122, __pyx_L11_except_error)
            __Pyx_XGOTREF(__pyx_t_3);
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_4);
            __pyx_t_6 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 122, __pyx_L11_except_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 122, __pyx_L11_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_1 < 0) __PYX_ERR(10, 122, __pyx_L11_except_error)
            __pyx_t_12 = (!__pyx_t_1);
            if (unlikely(__pyx_t_12)) {
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_4);
              __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_4);
              __pyx_t_3 = 0;  __pyx_t_2 = 0;  __pyx_t_4 = 0; 
              __PYX_ERR(10, 122, __pyx_L11_except_error)
            }
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L10_exception_handled;
          }
          __pyx_L11_except_error:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L10_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          __pyx_L14_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_7) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[23], NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 122, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
      goto __pyx_L18;
      __pyx_L5_error:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L1_error;
      __pyx_L18:;
    }

    /* "cython/core/dirichlet.pyx":126
 *             self.c_dirichlet_domain, self.c_num_generators = (
 *                 get_generators_from_bytes(
 *                     data, vertex_epsilon, displacement,             # <<<<<<<<<<<<<<
 *                     centroid_at_origin, maximize_injectivity_radius,
 *                     include_words))
*/
    if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(10, 126, __pyx_L1_error) }
    __pyx_t_13 = __Pyx_PyFloat_AsDouble(__pyx_v_vertex_epsilon); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 126, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":125
 *                 data = input_file.read()
 *             self.c_dirichlet_domain, self.c_num_generators = (
 *                 get_generators_from_bytes(             # <<<<<<<<<<<<<<
 *                     data, vertex_epsilon, displacement,
 *                     centroid_at_origin, maximize_injectivity_radius,
*/
    __pyx_t_14 = __pyx_f_8SnapPyHP_get_generators_from_bytes(__pyx_v_data, __pyx_t_13, __pyx_v_displacement, __pyx_v_centroid_at_origin, __pyx_v_maximize_injectivity_radius, __pyx_v_include_words); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 125, __pyx_L1_error)
    __pyx_t_15 = __pyx_t_14.f0;
    __pyx_t_16 = __pyx_t_14.f1;

    /* "cython/core/dirichlet.pyx":124
 *             with open(generator_file, mode='rb') as input_file:
 *                 data = input_file.read()
 *             self.c_dirichlet_domain, self.c_num_generators = (             # <<<<<<<<<<<<<<
 *                 get_generators_from_bytes(
 *                     data, vertex_epsilon, displacement,
*/
    __pyx_v_self->c_dirichlet_domain = __pyx_t_15;
    __pyx_v_self->c_num_generators = __pyx_t_16;

    /* "cython/core/dirichlet.pyx":129
 *                     centroid_at_origin, maximize_injectivity_radius,
 *                     include_words))
 *             self.manifold_name = generator_file             # <<<<<<<<<<<<<<
 *         elif generator_bytes != b'':
 *             self.c_dirichlet_domain, self.c_num_generators = (
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name, __pyx_v_generator_file) < 0) __PYX_ERR(10, 129, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":121
 *             displacement = [0.0, 0.0, 0.0]
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':             # <<<<<<<<<<<<<<
 *             with open(generator_file, mode='rb') as input_file:
 *                 data = input_file.read()
*/
    goto __pyx_L4;
  }

  /* "cython/core/dirichlet.pyx":130
 *                     include_words))
 *             self.manifold_name = generator_file
 *         elif generator_bytes != b'':             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain, self.c_num_generators = (
 *                 get_generators_from_bytes(
*/
  __pyx_t_12 = (__Pyx_PyBytes_Equals(__pyx_v_generator_bytes, __pyx_mstate_global->__pyx_kp_b__10, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(10, 130, __pyx_L1_error)
  if (__pyx_t_12) {

    /* "cython/core/dirichlet.pyx":133
 *             self.c_dirichlet_domain, self.c_num_generators = (
 *                 get_generators_from_bytes(
 *                     generator_bytes, vertex_epsilon, displacement,             # <<<<<<<<<<<<<<
 *                     centroid_at_origin, maximize_injectivity_radius,
 *                     include_words))
*/
    __pyx_t_13 = __Pyx_PyFloat_AsDouble(__pyx_v_vertex_epsilon); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 133, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":132
 *         elif generator_bytes != b'':
 *             self.c_dirichlet_domain, self.c_num_generators = (
 *                 get_generators_from_bytes(             # <<<<<<<<<<<<<<
 *                     generator_bytes, vertex_epsilon, displacement,
 *                     centroid_at_origin, maximize_injectivity_radius,
*/
    __pyx_t_14 = __pyx_f_8SnapPyHP_get_generators_from_bytes(__pyx_v_generator_bytes, __pyx_t_13, __pyx_v_displacement, __pyx_v_centroid_at_origin, __pyx_v_maximize_injectivity_radius, __pyx_v_include_words); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 132, __pyx_L1_error)
    __pyx_t_15 = __pyx_t_14.f0;
    __pyx_t_16 = __pyx_t_14.f1;

    /* "cython/core/dirichlet.pyx":131
 *             self.manifold_name = generator_file
 *         elif generator_bytes != b'':
 *             self.c_dirichlet_domain, self.c_num_generators = (             # <<<<<<<<<<<<<<
 *                 get_generators_from_bytes(
 *                     generator_bytes, vertex_epsilon, displacement,
*/
    __pyx_v_self->c_dirichlet_domain = __pyx_t_15;
    __pyx_v_self->c_num_generators = __pyx_t_16;

    /* "cython/core/dirichlet.pyx":136
 *                     centroid_at_origin, maximize_injectivity_radius,
 *                     include_words))
 *             self.manifold_name = manifold_name             # <<<<<<<<<<<<<<
 *         elif O31_generators is not None:
 *             self.c_num_generators = len(O31_generators)
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name, __pyx_v_manifold_name) < 0) __PYX_ERR(10, 136, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":130
 *                     include_words))
 *             self.manifold_name = generator_file
 *         elif generator_bytes != b'':             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain, self.c_num_generators = (
 *                 get_generators_from_bytes(
*/
    goto __pyx_L4;
  }

  /* "cython/core/dirichlet.pyx":137
 *                     include_words))
 *             self.manifold_name = manifold_name
 *         elif O31_generators is not None:             # <<<<<<<<<<<<<<
 *             self.c_num_generators = len(O31_generators)
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
*/
  __pyx_t_12 = (__pyx_v_O31_generators != Py_None);
  if (__pyx_t_12) {

    /* "cython/core/dirichlet.pyx":138
 *             self.manifold_name = manifold_name
 *         elif O31_generators is not None:
 *             self.c_num_generators = len(O31_generators)             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
 *                 O31_generators, vertex_epsilon, displacement,
*/
    __pyx_t_17 = PyObject_Length(__pyx_v_O31_generators); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(10, 138, __pyx_L1_error)
    __pyx_v_self->c_num_generators = __pyx_t_17;

    /* "cython/core/dirichlet.pyx":140
 *             self.c_num_generators = len(O31_generators)
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
 *                 O31_generators, vertex_epsilon, displacement,             # <<<<<<<<<<<<<<
 *                 centroid_at_origin, maximize_injectivity_radius,
 *                 include_words)
*/
    __pyx_t_13 = __Pyx_PyFloat_AsDouble(__pyx_v_vertex_epsilon); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 140, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":139
 *         elif O31_generators is not None:
 *             self.c_num_generators = len(O31_generators)
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(             # <<<<<<<<<<<<<<
 *                 O31_generators, vertex_epsilon, displacement,
 *                 centroid_at_origin, maximize_injectivity_radius,
*/
    __pyx_t_15 = __pyx_f_8SnapPyHP_dirichlet_from_O31_matrix_list(__pyx_v_O31_generators, __pyx_t_13, __pyx_v_displacement, __pyx_v_centroid_at_origin, __pyx_v_maximize_injectivity_radius, __pyx_v_include_words); if (unlikely(__pyx_t_15 == ((WEPolyhedron *)0) && PyErr_Occurred())) __PYX_ERR(10, 139, __pyx_L1_error)
    __pyx_v_self->c_dirichlet_domain = __pyx_t_15;

    /* "cython/core/dirichlet.pyx":143
 *                 centroid_at_origin, maximize_injectivity_radius,
 *                 include_words)
 *             self.manifold_name = manifold_name             # <<<<<<<<<<<<<<
 *         else:
 *             if manifold is None:
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name, __pyx_v_manifold_name) < 0) __PYX_ERR(10, 143, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":137
 *                     include_words))
 *             self.manifold_name = manifold_name
 *         elif O31_generators is not None:             # <<<<<<<<<<<<<<
 *             self.c_num_generators = len(O31_generators)
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
*/
    goto __pyx_L4;
  }

  /* "cython/core/dirichlet.pyx":145
 *             self.manifold_name = manifold_name
 *         else:
 *             if manifold is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Supply a manifold, or generators.')
 *             if manifold.c_triangulation is NULL:
*/
  /*else*/ {
    __pyx_t_12 = (((PyObject *)__pyx_v_manifold) == Py_None);
    if (unlikely(__pyx_t_12)) {

      /* "cython/core/dirichlet.pyx":146
 *         else:
 *             if manifold is None:
 *                 raise ValueError('Supply a manifold, or generators.')             # <<<<<<<<<<<<<<
 *             if manifold.c_triangulation is NULL:
 *                 raise ValueError('The Triangulation is empty.')
*/
      __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_3 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Supply_a_manifold_or_generators};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 146, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(10, 146, __pyx_L1_error)

      /* "cython/core/dirichlet.pyx":145
 *             self.manifold_name = manifold_name
 *         else:
 *             if manifold is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Supply a manifold, or generators.')
 *             if manifold.c_triangulation is NULL:
*/
    }

    /* "cython/core/dirichlet.pyx":147
 *             if manifold is None:
 *                 raise ValueError('Supply a manifold, or generators.')
 *             if manifold.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The Triangulation is empty.')
 *             for n from 0 <= n < 3:
*/
    __pyx_t_12 = (__pyx_v_manifold->__pyx_base.c_triangulation == NULL);
    if (unlikely(__pyx_t_12)) {

      /* "cython/core/dirichlet.pyx":148
 *                 raise ValueError('Supply a manifold, or generators.')
 *             if manifold.c_triangulation is NULL:
 *                 raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *             for n from 0 <= n < 3:
 *                 c_displacement[n] = <double>displacement[n]
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_2 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 148, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(10, 148, __pyx_L1_error)

      /* "cython/core/dirichlet.pyx":147
 *             if manifold is None:
 *                 raise ValueError('Supply a manifold, or generators.')
 *             if manifold.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The Triangulation is empty.')
 *             for n from 0 <= n < 3:
*/
    }

    /* "cython/core/dirichlet.pyx":149
 *             if manifold.c_triangulation is NULL:
 *                 raise ValueError('The Triangulation is empty.')
 *             for n from 0 <= n < 3:             # <<<<<<<<<<<<<<
 *                 c_displacement[n] = <double>displacement[n]
 *             copy_triangulation(manifold.c_triangulation,
*/
    for (__pyx_v_n = 0; __pyx_v_n < 3; __pyx_v_n++) {

      /* "cython/core/dirichlet.pyx":150
 *                 raise ValueError('The Triangulation is empty.')
 *             for n from 0 <= n < 3:
 *                 c_displacement[n] = <double>displacement[n]             # <<<<<<<<<<<<<<
 *             copy_triangulation(manifold.c_triangulation,
 *                                &self.c_triangulation)
*/
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_displacement, __pyx_v_n, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 150, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      (__pyx_v_c_displacement[__pyx_v_n]) = ((double)__pyx_t_13);
    }

    /* "cython/core/dirichlet.pyx":151
 *             for n from 0 <= n < 3:
 *                 c_displacement[n] = <double>displacement[n]
 *             copy_triangulation(manifold.c_triangulation,             # <<<<<<<<<<<<<<
 *                                &self.c_triangulation)
 *             self.c_dirichlet_domain = Dirichlet_with_displacement(
*/
    copy_triangulation(__pyx_v_manifold->__pyx_base.c_triangulation, (&__pyx_v_self->c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 151, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":156
 *                 self.c_triangulation,
 *                 c_displacement,
 *                 vertex_epsilon,             # <<<<<<<<<<<<<<
 *                 centroid_at_origin,
 *                 Dirichlet_keep_going,
*/
    __pyx_t_13 = __Pyx_PyFloat_AsDouble(__pyx_v_vertex_epsilon); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 156, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":157
 *                 c_displacement,
 *                 vertex_epsilon,
 *                 centroid_at_origin,             # <<<<<<<<<<<<<<
 *                 Dirichlet_keep_going,
 *                 maximize_injectivity_radius,
*/
    __pyx_t_18 = __Pyx_PyLong_As_Boolean(__pyx_v_centroid_at_origin); if (unlikely((__pyx_t_18 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 157, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":159
 *                 centroid_at_origin,
 *                 Dirichlet_keep_going,
 *                 maximize_injectivity_radius,             # <<<<<<<<<<<<<<
 *                 include_words)
 *             # num_generators computed implicitly by
*/
    __pyx_t_19 = __Pyx_PyLong_As_Boolean(__pyx_v_maximize_injectivity_radius); if (unlikely((__pyx_t_19 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 159, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":160
 *                 Dirichlet_keep_going,
 *                 maximize_injectivity_radius,
 *                 include_words)             # <<<<<<<<<<<<<<
 *             # num_generators computed implicitly by
 *             # Dirichlet_with_displacement.
*/
    __pyx_t_20 = __Pyx_PyLong_As_Boolean(__pyx_v_include_words); if (unlikely((__pyx_t_20 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 160, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":153
 *             copy_triangulation(manifold.c_triangulation,
 *                                &self.c_triangulation)
 *             self.c_dirichlet_domain = Dirichlet_with_displacement(             # <<<<<<<<<<<<<<
 *                 self.c_triangulation,
 *                 c_displacement,
*/
    __pyx_t_15 = Dirichlet_with_displacement(__pyx_v_self->c_triangulation, __pyx_v_c_displacement, __pyx_t_13, __pyx_t_18, Dirichlet_keep_going, __pyx_t_19, __pyx_t_20); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 153, __pyx_L1_error)
    __pyx_v_self->c_dirichlet_domain = __pyx_t_15;

    /* "cython/core/dirichlet.pyx":163
 *             # num_generators computed implicitly by
 *             # Dirichlet_with_displacement.
 *             self.c_num_generators = self.c_triangulation.num_generators             # <<<<<<<<<<<<<<
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:
*/
    __pyx_t_16 = __pyx_v_self->c_triangulation->num_generators;
    __pyx_v_self->c_num_generators = __pyx_t_16;

    /* "cython/core/dirichlet.pyx":164
 *             # Dirichlet_with_displacement.
 *             self.c_num_generators = self.c_triangulation.num_generators
 *             self.manifold_name = manifold.name()             # <<<<<<<<<<<<<<
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_manifold);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name, __pyx_t_4) < 0) __PYX_ERR(10, 164, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L4:;

  /* "cython/core/dirichlet.pyx":165
 *             self.c_num_generators = self.c_triangulation.num_generators
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:
*/
  __pyx_t_12 = (__pyx_v_self->c_dirichlet_domain == NULL);
  if (unlikely(__pyx_t_12)) {

    /* "cython/core/dirichlet.pyx":166
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')             # <<<<<<<<<<<<<<
 *         if manifold:
 *             self._number_ = manifold._number_
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_Dirichlet_construction_faile};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(10, 166, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":165
 *             self.c_num_generators = self.c_triangulation.num_generators
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:
*/
  }

  /* "cython/core/dirichlet.pyx":167
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:             # <<<<<<<<<<<<<<
 *             self._number_ = manifold._number_
 * 
*/
  __pyx_t_12 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_manifold)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(10, 167, __pyx_L1_error)
  if (__pyx_t_12) {

    /* "cython/core/dirichlet.pyx":168
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:
 *             self._number_ = manifold._number_             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_manifold), __pyx_mstate_global->__pyx_n_u_number_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_4) < 0) __PYX_ERR(10, 168, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/dirichlet.pyx":167
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:             # <<<<<<<<<<<<<<
 *             self._number_ = manifold._number_
 * 
*/
  }

  /* "cython/core/dirichlet.pyx":106
 *         return number.number_to_native_number(n)
 * 
 *     def __cinit__(self,             # <<<<<<<<<<<<<<
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_input_file);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_displacement);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":170
 *             self._number_ = manifold._number_
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/

/* Python wrapper */
static void __pyx_pw_8SnapPyHP_16CDirichletDomain_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8SnapPyHP_16CDirichletDomain_5__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_8SnapPyHP_16CDirichletDomain_4__dealloc__(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static void __pyx_pf_8SnapPyHP_16CDirichletDomain_4__dealloc__(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cython/core/dirichlet.pyx":171
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         if self.c_dirichlet_domain != NULL:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":172
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if self.c_dirichlet_domain != NULL:
 *             free_Dirichlet_domain(self.c_dirichlet_domain)
*/
    free_triangulation(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 172, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":171
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         if self.c_dirichlet_domain != NULL:
*/
  }

  /* "cython/core/dirichlet.pyx":173
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
 *         if self.c_dirichlet_domain != NULL:             # <<<<<<<<<<<<<<
 *             free_Dirichlet_domain(self.c_dirichlet_domain)
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_dirichlet_domain != NULL);
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":174
 *             free_triangulation(self.c_triangulation)
 *         if self.c_dirichlet_domain != NULL:
 *             free_Dirichlet_domain(self.c_dirichlet_domain)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
    free_Dirichlet_domain(__pyx_v_self->c_dirichlet_domain); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 174, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":173
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
 *         if self.c_dirichlet_domain != NULL:             # <<<<<<<<<<<<<<
 *             free_Dirichlet_domain(self.c_dirichlet_domain)
 * 
*/
  }

  /* "cython/core/dirichlet.pyx":170
 *             self._number_ = manifold._number_
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("SnapPyHP.CDirichletDomain.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
}

/* "cython/core/dirichlet.pyx":176
 *             free_Dirichlet_domain(self.c_dirichlet_domain)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%d finite vertices, %d ideal vertices; %d edges; %d faces' % (
 *             self.num_finite_vertices(),
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_7__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_8SnapPyHP_16CDirichletDomain_6__repr__(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

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

  /* "cython/core/dirichlet.pyx":177
 * 
 *     def __repr__(self):
 *         return '%d finite vertices, %d ideal vertices; %d edges; %d faces' % (             # <<<<<<<<<<<<<<
 *             self.num_finite_vertices(),
 *             self.num_ideal_vertices(),
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/dirichlet.pyx":178
 *     def __repr__(self):
 *         return '%d finite vertices, %d ideal vertices; %d edges; %d faces' % (
 *             self.num_finite_vertices(),             # <<<<<<<<<<<<<<
 *             self.num_ideal_vertices(),
 *             self.num_edges(),
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_finite_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_2), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":179
 *         return '%d finite vertices, %d ideal vertices; %d edges; %d faces' % (
 *             self.num_finite_vertices(),
 *             self.num_ideal_vertices(),             # <<<<<<<<<<<<<<
 *             self.num_edges(),
 *             self.num_faces(),
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_ideal_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":180
 *             self.num_finite_vertices(),
 *             self.num_ideal_vertices(),
 *             self.num_edges(),             # <<<<<<<<<<<<<<
 *             self.num_faces(),
 *             )
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/dirichlet.pyx":181
 *             self.num_ideal_vertices(),
 *             self.num_edges(),
 *             self.num_faces(),             # <<<<<<<<<<<<<<
 *             )
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_faces); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6[0] = __pyx_t_1;
  __pyx_t_6[1] = __pyx_mstate_global->__pyx_kp_u_finite_vertices;
  __pyx_t_6[2] = __pyx_t_2;
  __pyx_t_6[3] = __pyx_mstate_global->__pyx_kp_u_ideal_vertices;
  __pyx_t_6[4] = __pyx_t_3;
  __pyx_t_6[5] = __pyx_mstate_global->__pyx_kp_u_edges;
  __pyx_t_6[6] = __pyx_t_4;
  __pyx_t_6[7] = __pyx_mstate_global->__pyx_kp_u_faces;

  /* "cython/core/dirichlet.pyx":177
 * 
 *     def __repr__(self):
 *         return '%d finite vertices, %d ideal vertices; %d edges; %d faces' % (             # <<<<<<<<<<<<<<
 *             self.num_finite_vertices(),
 *             self.num_ideal_vertices(),
*/
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 8, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 6, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":176
 *             free_Dirichlet_domain(self.c_dirichlet_domain)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%d finite vertices, %d ideal vertices; %d edges; %d faces' % (
 *             self.num_finite_vertices(),
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":184
 *             )
 * 
 *     def num_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of vertices.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_9num_vertices(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_8SnapPyHP_16CDirichletDomain_8num_vertices, "\n        Return the number of vertices.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_9num_vertices = {"num_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_9num_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_8num_vertices};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_9num_vertices(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("num_vertices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_vertices", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_vertices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_8num_vertices(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_8num_vertices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__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("num_vertices", 0);

  /* "cython/core/dirichlet.pyx":188
 *         Return the number of vertices.
 *         """
 *         return self.c_dirichlet_domain.num_vertices             # <<<<<<<<<<<<<<
 * 
 *     def num_finite_vertices(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->c_dirichlet_domain->num_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":184
 *             )
 * 
 *     def num_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of vertices.
*/

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

/* "cython/core/dirichlet.pyx":190
 *         return self.c_dirichlet_domain.num_vertices
 * 
 *     def num_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of finite (non-ideal) vertices.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_11num_finite_vertices(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_8SnapPyHP_16CDirichletDomain_10num_finite_vertices, "\n        Return the number of finite (non-ideal) vertices.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_11num_finite_vertices = {"num_finite_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_11num_finite_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_10num_finite_vertices};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_11num_finite_vertices(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("num_finite_vertices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_finite_vertices", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_finite_vertices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_10num_finite_vertices(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_10num_finite_vertices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__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("num_finite_vertices", 0);

  /* "cython/core/dirichlet.pyx":194
 *         Return the number of finite (non-ideal) vertices.
 *         """
 *         return self.c_dirichlet_domain.num_finite_vertices             # <<<<<<<<<<<<<<
 * 
 *     def num_ideal_vertices(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->c_dirichlet_domain->num_finite_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":190
 *         return self.c_dirichlet_domain.num_vertices
 * 
 *     def num_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of finite (non-ideal) vertices.
*/

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

/* "cython/core/dirichlet.pyx":196
 *         return self.c_dirichlet_domain.num_finite_vertices
 * 
 *     def num_ideal_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of ideal vertices.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_13num_ideal_vertices(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_8SnapPyHP_16CDirichletDomain_12num_ideal_vertices, "\n        Return the number of ideal vertices.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_13num_ideal_vertices = {"num_ideal_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_13num_ideal_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_12num_ideal_vertices};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_13num_ideal_vertices(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("num_ideal_vertices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_ideal_vertices", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_ideal_vertices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_12num_ideal_vertices(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_12num_ideal_vertices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__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("num_ideal_vertices", 0);

  /* "cython/core/dirichlet.pyx":200
 *         Return the number of ideal vertices.
 *         """
 *         return self.c_dirichlet_domain.num_ideal_vertices             # <<<<<<<<<<<<<<
 * 
 *     def num_edges(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->c_dirichlet_domain->num_ideal_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":196
 *         return self.c_dirichlet_domain.num_finite_vertices
 * 
 *     def num_ideal_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of ideal vertices.
*/

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

/* "cython/core/dirichlet.pyx":202
 *         return self.c_dirichlet_domain.num_ideal_vertices
 * 
 *     def num_edges(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of edges.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_15num_edges(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_8SnapPyHP_16CDirichletDomain_14num_edges, "\n        Return the number of edges.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_15num_edges = {"num_edges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_15num_edges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_14num_edges};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_15num_edges(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("num_edges (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_edges", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_edges", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_14num_edges(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_14num_edges(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__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("num_edges", 0);

  /* "cython/core/dirichlet.pyx":206
 *         Return the number of edges.
 *         """
 *         return self.c_dirichlet_domain.num_edges             # <<<<<<<<<<<<<<
 * 
 *     def num_faces(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->c_dirichlet_domain->num_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":202
 *         return self.c_dirichlet_domain.num_ideal_vertices
 * 
 *     def num_edges(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of edges.
*/

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

/* "cython/core/dirichlet.pyx":208
 *         return self.c_dirichlet_domain.num_edges
 * 
 *     def num_faces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of faces.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_17num_faces(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_8SnapPyHP_16CDirichletDomain_16num_faces, "\n        Return the number of faces.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_17num_faces = {"num_faces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_17num_faces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_16num_faces};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_17num_faces(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("num_faces (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_faces", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_faces", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_16num_faces(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_16num_faces(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__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("num_faces", 0);

  /* "cython/core/dirichlet.pyx":212
 *         Return the number of faces.
 *         """
 *         return self.c_dirichlet_domain.num_faces             # <<<<<<<<<<<<<<
 * 
 *     def in_radius(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->c_dirichlet_domain->num_faces); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":208
 *         return self.c_dirichlet_domain.num_edges
 * 
 *     def num_faces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of faces.
*/

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

/* "cython/core/dirichlet.pyx":214
 *         return self.c_dirichlet_domain.num_faces
 * 
 *     def in_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the radius of the largest inscribed sphere.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_19in_radius(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_8SnapPyHP_16CDirichletDomain_18in_radius, "\n        Return the radius of the largest inscribed sphere.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_19in_radius = {"in_radius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_19in_radius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_18in_radius};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_19in_radius(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("in_radius (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("in_radius", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("in_radius", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_18in_radius(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_18in_radius(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_v_radius = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("in_radius", 0);

  /* "cython/core/dirichlet.pyx":218
 *         Return the radius of the largest inscribed sphere.
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.inradius)             # <<<<<<<<<<<<<<
 *         return self._number_(radius)
 * 
*/
  __pyx_t_1 = __pyx_f_8SnapPyHP_Real2Number(__pyx_v_self->c_dirichlet_domain->inradius); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_radius = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":219
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.inradius)
 *         return self._number_(radius)             # <<<<<<<<<<<<<<
 * 
 *     def out_radius(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_radius};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":214
 *         return self.c_dirichlet_domain.num_faces
 * 
 *     def in_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the radius of the largest inscribed sphere.
*/

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

/* "cython/core/dirichlet.pyx":221
 *         return self._number_(radius)
 * 
 *     def out_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the radius of the smallest circubscribed sphere.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_21out_radius(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_8SnapPyHP_16CDirichletDomain_20out_radius, "\n        Return the radius of the smallest circubscribed sphere.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_21out_radius = {"out_radius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_21out_radius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_20out_radius};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_21out_radius(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("out_radius (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("out_radius", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("out_radius", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_20out_radius(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_20out_radius(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_v_radius = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("out_radius", 0);

  /* "cython/core/dirichlet.pyx":225
 *         Return the radius of the smallest circubscribed sphere.
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.outradius)             # <<<<<<<<<<<<<<
 *         return self._number_(radius)
 * 
*/
  __pyx_t_1 = __pyx_f_8SnapPyHP_Real2Number(__pyx_v_self->c_dirichlet_domain->outradius); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_radius = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":226
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.outradius)
 *         return self._number_(radius)             # <<<<<<<<<<<<<<
 * 
 *     def spine_radius(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_radius};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":221
 *         return self._number_(radius)
 * 
 *     def out_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the radius of the smallest circubscribed sphere.
*/

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

/* "cython/core/dirichlet.pyx":228
 *         return self._number_(radius)
 * 
 *     def spine_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the infimum of the radii (measured from the origin) of all
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_23spine_radius(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_8SnapPyHP_16CDirichletDomain_22spine_radius, "\n        Return the infimum of the radii (measured from the origin) of all\n        spines dual to the Dirichlet domain.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_23spine_radius = {"spine_radius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_23spine_radius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_22spine_radius};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_23spine_radius(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("spine_radius (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("spine_radius", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("spine_radius", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_22spine_radius(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_22spine_radius(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_v_radius = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spine_radius", 0);

  /* "cython/core/dirichlet.pyx":233
 *         spines dual to the Dirichlet domain.
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.spine_radius)             # <<<<<<<<<<<<<<
 *         return self._number_(radius)
 * 
*/
  __pyx_t_1 = __pyx_f_8SnapPyHP_Real2Number(__pyx_v_self->c_dirichlet_domain->spine_radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_radius = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":234
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.spine_radius)
 *         return self._number_(radius)             # <<<<<<<<<<<<<<
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_radius};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":228
 *         return self._number_(radius)
 * 
 *     def spine_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the infimum of the radii (measured from the origin) of all
*/

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

/* "cython/core/dirichlet.pyx":236
 *         return self._number_(radius)
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,             # <<<<<<<<<<<<<<
 *                               full_rigor=True,
 *                               multiplicities=True,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_25length_spectrum_dicts(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_8SnapPyHP_16CDirichletDomain_24length_spectrum_dicts, "\n        Return a list of info objects describing the short\n        geodesics up to the specified cutoff length.  The keys are\n        'length', 'parity', 'topology', and 'multiplicity'.  The\n        length is the complex length; the parity specifies whether\n        orientation is preserved; and topology distinguishes between\n        circles and mirrored intervals.  Finally, the key 'matrix'\n        in the fundamental group realizing this element.\n\n        >>> M = Manifold('m004(1,2)')\n        >>> D = M.dirichlet_domain(maximize_injectivity_radius=False)\n        >>> lengths = D.length_spectrum_dicts()\n        >>> len(lengths)\n        2\n        >>> lengths[0].matrix in D.pairing_matrices()\n        True\n\n        If the flag 'grouped' is False, then each geodesic is returned as\n        a separate item rather than collating by (length, parity, topology).\n        If the flag 'multiplicities' is False, then the geodesics *are*\n        collated but the multiplicity of each item is set to 0.\n\n        >>> M = Manifold('m003(-3, 1)')\n        >>> D = M.dirichlet_domain()\n        >>> [g.multiplicity for g in D.length_spectrum_dicts()]\n        [3, 3]\n        >>> [g.multiplicity for g in D.length_spectrum_dicts(grouped=False)]\n        [1, 1, 1, 1, 1, 1]\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_25length_spectrum_dicts = {"length_spectrum_dicts", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_25length_spectrum_dicts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_24length_spectrum_dicts};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_25length_spectrum_dicts(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_cutoff_length = 0;
  PyObject *__pyx_v_full_rigor = 0;
  PyObject *__pyx_v_multiplicities = 0;
  PyObject *__pyx_v_user_radius = 0;
  PyObject *__pyx_v_grouped = 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("length_spectrum_dicts (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cutoff_length,&__pyx_mstate_global->__pyx_n_u_full_rigor,&__pyx_mstate_global->__pyx_n_u_multiplicities,&__pyx_mstate_global->__pyx_n_u_user_radius,&__pyx_mstate_global->__pyx_n_u_grouped,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 236, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "length_spectrum_dicts", 0) < 0) __PYX_ERR(10, 236, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));

      /* "cython/core/dirichlet.pyx":237
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
 *                               full_rigor=True,             # <<<<<<<<<<<<<<
 *                               multiplicities=True,
 *                               user_radius=0.0,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/dirichlet.pyx":238
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
 *                               full_rigor=True,
 *                               multiplicities=True,             # <<<<<<<<<<<<<<
 *                               user_radius=0.0,
 *                               grouped=True):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));

      /* "cython/core/dirichlet.pyx":240
 *                               multiplicities=True,
 *                               user_radius=0.0,
 *                               grouped=True):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of info objects describing the short
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));

      /* "cython/core/dirichlet.pyx":237
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
 *                               full_rigor=True,             # <<<<<<<<<<<<<<
 *                               multiplicities=True,
 *                               user_radius=0.0,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/dirichlet.pyx":238
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
 *                               full_rigor=True,
 *                               multiplicities=True,             # <<<<<<<<<<<<<<
 *                               user_radius=0.0,
 *                               grouped=True):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));

      /* "cython/core/dirichlet.pyx":240
 *                               multiplicities=True,
 *                               user_radius=0.0,
 *                               grouped=True):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of info objects describing the short
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_cutoff_length = values[0];
    __pyx_v_full_rigor = values[1];
    __pyx_v_multiplicities = values[2];
    __pyx_v_user_radius = values[3];
    __pyx_v_grouped = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("length_spectrum_dicts", 0, 0, 5, __pyx_nargs); __PYX_ERR(10, 236, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.length_spectrum_dicts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_24length_spectrum_dicts(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self), __pyx_v_cutoff_length, __pyx_v_full_rigor, __pyx_v_multiplicities, __pyx_v_user_radius, __pyx_v_grouped);

  /* "cython/core/dirichlet.pyx":236
 *         return self._number_(radius)
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,             # <<<<<<<<<<<<<<
 *                               full_rigor=True,
 *                               multiplicities=True,
*/

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_24length_spectrum_dicts(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_cutoff_length, PyObject *__pyx_v_full_rigor, PyObject *__pyx_v_multiplicities, PyObject *__pyx_v_user_radius, PyObject *__pyx_v_grouped) {
  int __pyx_v_num_lengths;
  MultiLength *__pyx_v_geodesics;
  int *__pyx_v_c_word;
  PyObject *__pyx_v_spectrum = NULL;
  long __pyx_v_n;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_v_its_matrix = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_9genexpr85__pyx_v_i = NULL;
  long __pyx_9genexpr86__pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_8SnapPyHP_Real __pyx_t_1;
  Boolean __pyx_t_2;
  Boolean __pyx_t_3;
  Boolean __pyx_t_4;
  __pyx_t_8SnapPyHP_Real __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  long __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  size_t __pyx_t_18;
  int *__pyx_t_19;
  int __pyx_t_20;
  int __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("length_spectrum_dicts", 0);

  /* "cython/core/dirichlet.pyx":275
 * 
 *         length_spectrum(self.c_dirichlet_domain,
 *                         Object2Real(cutoff_length),             # <<<<<<<<<<<<<<
 *                         full_rigor,
 *                         multiplicities,
*/
  __pyx_t_1 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_cutoff_length); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 275, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":276
 *         length_spectrum(self.c_dirichlet_domain,
 *                         Object2Real(cutoff_length),
 *                         full_rigor,             # <<<<<<<<<<<<<<
 *                         multiplicities,
 *                         grouped,
*/
  __pyx_t_2 = __Pyx_PyLong_As_Boolean(__pyx_v_full_rigor); if (unlikely((__pyx_t_2 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 276, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":277
 *                         Object2Real(cutoff_length),
 *                         full_rigor,
 *                         multiplicities,             # <<<<<<<<<<<<<<
 *                         grouped,
 *                         Object2Real(user_radius),
*/
  __pyx_t_3 = __Pyx_PyLong_As_Boolean(__pyx_v_multiplicities); if (unlikely((__pyx_t_3 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 277, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":278
 *                         full_rigor,
 *                         multiplicities,
 *                         grouped,             # <<<<<<<<<<<<<<
 *                         Object2Real(user_radius),
 *                         &geodesics,
*/
  __pyx_t_4 = __Pyx_PyLong_As_Boolean(__pyx_v_grouped); if (unlikely((__pyx_t_4 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 278, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":279
 *                         multiplicities,
 *                         grouped,
 *                         Object2Real(user_radius),             # <<<<<<<<<<<<<<
 *                         &geodesics,
 *                         &num_lengths)
*/
  __pyx_t_5 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_user_radius); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 279, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":274
 *         cdef int* c_word
 * 
 *         length_spectrum(self.c_dirichlet_domain,             # <<<<<<<<<<<<<<
 *                         Object2Real(cutoff_length),
 *                         full_rigor,
*/
  length_spectrum(__pyx_v_self->c_dirichlet_domain, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5), (&__pyx_v_geodesics), (&__pyx_v_num_lengths)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 274, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":282
 *                         &geodesics,
 *                         &num_lengths)
 *         spectrum = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)
*/
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_spectrum = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/dirichlet.pyx":283
 *                         &num_lengths)
 *         spectrum = []
 *         for n from 0 <= n < num_lengths:             # <<<<<<<<<<<<<<
 *             length = Complex2Number(geodesics[n].length)
 *             its_matrix = matrix([[self._number_(Real2Number(<Real>geodesics[n].matrix[i][j]))
*/
  __pyx_t_7 = __pyx_v_num_lengths;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_7; __pyx_v_n++) {

    /* "cython/core/dirichlet.pyx":284
 *         spectrum = []
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)             # <<<<<<<<<<<<<<
 *             its_matrix = matrix([[self._number_(Real2Number(<Real>geodesics[n].matrix[i][j]))
 *                                   for j in range(4)] for i in range(4)] )
*/
    __pyx_t_6 = __pyx_f_8SnapPyHP_Complex2Number((__pyx_v_geodesics[__pyx_v_n]).length); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":285
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)
 *             its_matrix = matrix([[self._number_(Real2Number(<Real>geodesics[n].matrix[i][j]))             # <<<<<<<<<<<<<<
 *                                   for j in range(4)] for i in range(4)] )
 *             d = {
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    { /* enter inner scope */
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 285, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "cython/core/dirichlet.pyx":286
 *             length = Complex2Number(geodesics[n].length)
 *             its_matrix = matrix([[self._number_(Real2Number(<Real>geodesics[n].matrix[i][j]))
 *                                   for j in range(4)] for i in range(4)] )             # <<<<<<<<<<<<<<
 *             d = {
 *                 "length" : self._number_(length),
*/
      for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
        __pyx_t_12 = PyLong_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 286, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF_SET(__pyx_9genexpr85__pyx_v_i, __pyx_t_12);
        __pyx_t_12 = 0;
        { /* enter inner scope */

          /* "cython/core/dirichlet.pyx":285
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)
 *             its_matrix = matrix([[self._number_(Real2Number(<Real>geodesics[n].matrix[i][j]))             # <<<<<<<<<<<<<<
 *                                   for j in range(4)] for i in range(4)] )
 *             d = {
*/
          __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 285, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_12);

          /* "cython/core/dirichlet.pyx":286
 *             length = Complex2Number(geodesics[n].length)
 *             its_matrix = matrix([[self._number_(Real2Number(<Real>geodesics[n].matrix[i][j]))
 *                                   for j in range(4)] for i in range(4)] )             # <<<<<<<<<<<<<<
 *             d = {
 *                 "length" : self._number_(length),
*/
          for (__pyx_t_13 = 0; __pyx_t_13 < 4; __pyx_t_13+=1) {
            __pyx_9genexpr86__pyx_v_j = __pyx_t_13;

            /* "cython/core/dirichlet.pyx":285
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)
 *             its_matrix = matrix([[self._number_(Real2Number(<Real>geodesics[n].matrix[i][j]))             # <<<<<<<<<<<<<<
 *                                   for j in range(4)] for i in range(4)] )
 *             d = {
*/
            __pyx_t_15 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_15);
            __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_9genexpr85__pyx_v_i); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 285, __pyx_L7_error)
            __pyx_t_17 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(((__pyx_v_geodesics[__pyx_v_n]).matrix[__pyx_t_16])[__pyx_9genexpr86__pyx_v_j]))); if (unlikely(!__pyx_t_17)) __PYX_ERR(10, 285, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_17};
              __pyx_t_14 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(10, 285, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_14);
            }
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_14))) __PYX_ERR(10, 285, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
        } /* exit inner scope */
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_12))) __PYX_ERR(10, 285, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_XDECREF(__pyx_9genexpr85__pyx_v_i); __pyx_9genexpr85__pyx_v_i = 0;
      goto __pyx_L12_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_9genexpr85__pyx_v_i); __pyx_9genexpr85__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L12_exit_scope:;
    } /* exit inner scope */
    __pyx_t_18 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_18 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_its_matrix, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":288
 *                                   for j in range(4)] for i in range(4)] )
 *             d = {
 *                 "length" : self._number_(length),             # <<<<<<<<<<<<<<
 *                 "parity" : MatrixParity[geodesics[n].parity],
 *                 "topology" : Orbifold1[geodesics[n].topology],
*/
    __pyx_t_6 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_18 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_length};
      __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_9) < 0) __PYX_ERR(10, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/dirichlet.pyx":289
 *             d = {
 *                 "length" : self._number_(length),
 *                 "parity" : MatrixParity[geodesics[n].parity],             # <<<<<<<<<<<<<<
 *                 "topology" : Orbifold1[geodesics[n].topology],
 *                 "multiplicity" :  geodesics[n].multiplicity,
*/
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MatrixParity); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyLong_From_MatrixParity((__pyx_v_geodesics[__pyx_v_n]).parity); if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_parity, __pyx_t_8) < 0) __PYX_ERR(10, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/dirichlet.pyx":290
 *                 "length" : self._number_(length),
 *                 "parity" : MatrixParity[geodesics[n].parity],
 *                 "topology" : Orbifold1[geodesics[n].topology],             # <<<<<<<<<<<<<<
 *                 "multiplicity" :  geodesics[n].multiplicity,
 *                 "matrix" : its_matrix }
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Orbifold1); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_PyLong_From_Orbifold1((__pyx_v_geodesics[__pyx_v_n]).topology); if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_topology, __pyx_t_9) < 0) __PYX_ERR(10, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/dirichlet.pyx":291
 *                 "parity" : MatrixParity[geodesics[n].parity],
 *                 "topology" : Orbifold1[geodesics[n].topology],
 *                 "multiplicity" :  geodesics[n].multiplicity,             # <<<<<<<<<<<<<<
 *                 "matrix" : its_matrix }
 * 
*/
    __pyx_t_9 = __Pyx_PyLong_From_int((__pyx_v_geodesics[__pyx_v_n]).multiplicity); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_multiplicity, __pyx_t_9) < 0) __PYX_ERR(10, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/dirichlet.pyx":292
 *                 "topology" : Orbifold1[geodesics[n].topology],
 *                 "multiplicity" :  geodesics[n].multiplicity,
 *                 "matrix" : its_matrix }             # <<<<<<<<<<<<<<
 * 
 *             c_word = geodesics[n].word
*/
    if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_matrix, __pyx_v_its_matrix) < 0) __PYX_ERR(10, 288, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_d, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":294
 *                 "matrix" : its_matrix }
 * 
 *             c_word = geodesics[n].word             # <<<<<<<<<<<<<<
 *             if c_word:
 *                 d['word'] = c_word_as_string(
*/
    __pyx_t_19 = (__pyx_v_geodesics[__pyx_v_n]).word;
    __pyx_v_c_word = __pyx_t_19;

    /* "cython/core/dirichlet.pyx":295
 * 
 *             c_word = geodesics[n].word
 *             if c_word:             # <<<<<<<<<<<<<<
 *                 d['word'] = c_word_as_string(
 *                     c_word, self.c_num_generators, verbose_form = False)
*/
    __pyx_t_20 = (__pyx_v_c_word != 0);
    if (__pyx_t_20) {

      /* "cython/core/dirichlet.pyx":296
 *             c_word = geodesics[n].word
 *             if c_word:
 *                 d['word'] = c_word_as_string(             # <<<<<<<<<<<<<<
 *                     c_word, self.c_num_generators, verbose_form = False)
 * 
*/
      __pyx_t_6 = __pyx_f_8SnapPyHP_c_word_as_string(__pyx_v_c_word, __pyx_v_self->c_num_generators, Py_False); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_mstate_global->__pyx_n_u_word, __pyx_t_6) < 0))) __PYX_ERR(10, 296, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/dirichlet.pyx":295
 * 
 *             c_word = geodesics[n].word
 *             if c_word:             # <<<<<<<<<<<<<<
 *                 d['word'] = c_word_as_string(
 *                     c_word, self.c_num_generators, verbose_form = False)
*/
    }

    /* "cython/core/dirichlet.pyx":299
 *                     c_word, self.c_num_generators, verbose_form = False)
 * 
 *             spectrum.append(LengthSpectrumInfo(**d))             # <<<<<<<<<<<<<<
 *         free_length_spectrum(geodesics, num_lengths)
 *         return LengthSpectrum(spectrum)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_LengthSpectrumInfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = PyDict_Copy(__pyx_v_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_spectrum, __pyx_t_10); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(10, 299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }

  /* "cython/core/dirichlet.pyx":300
 * 
 *             spectrum.append(LengthSpectrumInfo(**d))
 *         free_length_spectrum(geodesics, num_lengths)             # <<<<<<<<<<<<<<
 *         return LengthSpectrum(spectrum)
 * 
*/
  free_length_spectrum(__pyx_v_geodesics, __pyx_v_num_lengths); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 300, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":301
 *             spectrum.append(LengthSpectrumInfo(**d))
 *         free_length_spectrum(geodesics, num_lengths)
 *         return LengthSpectrum(spectrum)             # <<<<<<<<<<<<<<
 * 
 *     def vertex_list(self, details = False):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_LengthSpectrum); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_18 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_9);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_18 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_spectrum};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":236
 *         return self._number_(radius)
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,             # <<<<<<<<<<<<<<
 *                               full_rigor=True,
 *                               multiplicities=True,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.length_spectrum_dicts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_spectrum);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_its_matrix);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_9genexpr85__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":303
 *         return LengthSpectrum(spectrum)
 * 
 *     def vertex_list(self, details = False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the coordinates of the vertices.  These are
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_27vertex_list(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_8SnapPyHP_16CDirichletDomain_26vertex_list, "\n        Return a list of the coordinates of the vertices.  These are\n        the three space coordinates of a point in the time=1 slice of\n        Minkowski space.  That is to say, these are the coordinates of\n        the image of the point under projection into the Klein model.\n\n        If `details = True` is passed, returns a list of vertices,\n        each represented by a dictionary with keys 'position',\n        'ideal', 'vertex_class'. The coordinates are the value for\n        'position'. The index of the vertex class this vertex belongs\n        to is the value for 'vertex_class'. The value for 'ideal'\n        is True if the vertex is an ideal point.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_27vertex_list = {"vertex_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_27vertex_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_26vertex_list};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_27vertex_list(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_details = 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("vertex_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_details,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 303, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "vertex_list", 0) < 0) __PYX_ERR(10, 303, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_details = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("vertex_list", 0, 0, 1, __pyx_nargs); __PYX_ERR(10, 303, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.vertex_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_26vertex_list(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self), __pyx_v_details);

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_26vertex_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_details) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vertex_list", 0);

  /* "cython/core/dirichlet.pyx":318
 *         """
 * 
 *         if details:             # <<<<<<<<<<<<<<
 *             return self._vertex_data_list()
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_details); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 318, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":319
 * 
 *         if details:
 *             return self._vertex_data_list()             # <<<<<<<<<<<<<<
 *         else:
 *             return self._vertex_list()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_vertex_data_list, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/dirichlet.pyx":318
 *         """
 * 
 *         if details:             # <<<<<<<<<<<<<<
 *             return self._vertex_data_list()
 *         else:
*/
  }

  /* "cython/core/dirichlet.pyx":321
 *             return self._vertex_data_list()
 *         else:
 *             return self._vertex_list()             # <<<<<<<<<<<<<<
 * 
 *     def _vertex_list(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_vertex_list, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/dirichlet.pyx":303
 *         return LengthSpectrum(spectrum)
 * 
 *     def vertex_list(self, details = False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the coordinates of the vertices.  These are
*/

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

/* "cython/core/dirichlet.pyx":323
 *             return self._vertex_list()
 * 
 *     def _vertex_list(self):             # <<<<<<<<<<<<<<
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_29_vertex_list(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_29_vertex_list = {"_vertex_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_29_vertex_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_29_vertex_list(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("_vertex_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_vertex_list", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_vertex_list", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_28_vertex_list(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_28_vertex_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  WEVertex *__pyx_v_vertex;
  PyObject *__pyx_v_vertices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  WEVertex *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_vertex_list", 0);

  /* "cython/core/dirichlet.pyx":324
 * 
 *     def _vertex_list(self):
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin             # <<<<<<<<<<<<<<
 *         vertices = []
 *         vertex = vertex.next
*/
  __pyx_v_vertex = (&__pyx_v_self->c_dirichlet_domain->vertex_list_begin);

  /* "cython/core/dirichlet.pyx":325
 *     def _vertex_list(self):
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []             # <<<<<<<<<<<<<<
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":326
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
 *         vertex = vertex.next             # <<<<<<<<<<<<<<
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(
*/
  __pyx_t_2 = __pyx_v_vertex->next;
  __pyx_v_vertex = __pyx_t_2;

  /* "cython/core/dirichlet.pyx":327
 *         vertices = []
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:             # <<<<<<<<<<<<<<
 *             vertices.append(
 *                 (self._number_(Real2Number(<Real>vertex.x[1])),
*/
  while (1) {
    __pyx_t_3 = (__pyx_v_vertex != (&__pyx_v_self->c_dirichlet_domain->vertex_list_end));
    if (!__pyx_t_3) break;

    /* "cython/core/dirichlet.pyx":329
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(
 *                 (self._number_(Real2Number(<Real>vertex.x[1])),             # <<<<<<<<<<<<<<
 *                  self._number_(Real2Number(<Real>vertex.x[2])),
 *                  self._number_(Real2Number(<Real>vertex.x[3]))) )
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_vertex->x[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "cython/core/dirichlet.pyx":330
 *             vertices.append(
 *                 (self._number_(Real2Number(<Real>vertex.x[1])),
 *                  self._number_(Real2Number(<Real>vertex.x[2])),             # <<<<<<<<<<<<<<
 *                  self._number_(Real2Number(<Real>vertex.x[3]))) )
 *             vertex = vertex.next
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_vertex->x[2]))); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }

    /* "cython/core/dirichlet.pyx":331
 *                 (self._number_(Real2Number(<Real>vertex.x[1])),
 *                  self._number_(Real2Number(<Real>vertex.x[2])),
 *                  self._number_(Real2Number(<Real>vertex.x[3]))) )             # <<<<<<<<<<<<<<
 *             vertex = vertex.next
 *         return vertices
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_8 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_vertex->x[3]))); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }

    /* "cython/core/dirichlet.pyx":329
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(
 *                 (self._number_(Real2Number(<Real>vertex.x[1])),             # <<<<<<<<<<<<<<
 *                  self._number_(Real2Number(<Real>vertex.x[2])),
 *                  self._number_(Real2Number(<Real>vertex.x[3]))) )
*/
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(10, 329, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5) != (0)) __PYX_ERR(10, 329, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(10, 329, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;

    /* "cython/core/dirichlet.pyx":328
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(             # <<<<<<<<<<<<<<
 *                 (self._number_(Real2Number(<Real>vertex.x[1])),
 *                  self._number_(Real2Number(<Real>vertex.x[2])),
*/
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_vertices, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(10, 328, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/dirichlet.pyx":332
 *                  self._number_(Real2Number(<Real>vertex.x[2])),
 *                  self._number_(Real2Number(<Real>vertex.x[3]))) )
 *             vertex = vertex.next             # <<<<<<<<<<<<<<
 *         return vertices
 * 
*/
    __pyx_t_2 = __pyx_v_vertex->next;
    __pyx_v_vertex = __pyx_t_2;
  }

  /* "cython/core/dirichlet.pyx":333
 *                  self._number_(Real2Number(<Real>vertex.x[3]))) )
 *             vertex = vertex.next
 *         return vertices             # <<<<<<<<<<<<<<
 * 
 *     def _vertex_data_list(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_vertices);
  __pyx_r = __pyx_v_vertices;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":323
 *             return self._vertex_list()
 * 
 *     def _vertex_list(self):             # <<<<<<<<<<<<<<
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain._vertex_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":335
 *         return vertices
 * 
 *     def _vertex_data_list(self):             # <<<<<<<<<<<<<<
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_31_vertex_data_list(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_31_vertex_data_list = {"_vertex_data_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_31_vertex_data_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_31_vertex_data_list(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("_vertex_data_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_vertex_data_list", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_vertex_data_list", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_30_vertex_data_list(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_30_vertex_data_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  WEVertex *__pyx_v_vertex;
  PyObject *__pyx_v_vertices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  WEVertex *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_vertex_data_list", 0);

  /* "cython/core/dirichlet.pyx":336
 * 
 *     def _vertex_data_list(self):
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin             # <<<<<<<<<<<<<<
 *         vertices = []
 *         vertex = vertex.next
*/
  __pyx_v_vertex = (&__pyx_v_self->c_dirichlet_domain->vertex_list_begin);

  /* "cython/core/dirichlet.pyx":337
 *     def _vertex_data_list(self):
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []             # <<<<<<<<<<<<<<
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":338
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
 *         vertex = vertex.next             # <<<<<<<<<<<<<<
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(
*/
  __pyx_t_2 = __pyx_v_vertex->next;
  __pyx_v_vertex = __pyx_t_2;

  /* "cython/core/dirichlet.pyx":339
 *         vertices = []
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:             # <<<<<<<<<<<<<<
 *             vertices.append(
 *                 {'position': ( self._number_(Real2Number(<Real>vertex.x[1])),
*/
  while (1) {
    __pyx_t_3 = (__pyx_v_vertex != (&__pyx_v_self->c_dirichlet_domain->vertex_list_end));
    if (!__pyx_t_3) break;

    /* "cython/core/dirichlet.pyx":341
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(
 *                 {'position': ( self._number_(Real2Number(<Real>vertex.x[1])),             # <<<<<<<<<<<<<<
 *                                self._number_(Real2Number(<Real>vertex.x[2])),
 *                                self._number_(Real2Number(<Real>vertex.x[3])) ),
*/
    __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_vertex->x[1]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(10, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }

    /* "cython/core/dirichlet.pyx":342
 *             vertices.append(
 *                 {'position': ( self._number_(Real2Number(<Real>vertex.x[1])),
 *                                self._number_(Real2Number(<Real>vertex.x[2])),             # <<<<<<<<<<<<<<
 *                                self._number_(Real2Number(<Real>vertex.x[3])) ),
 *                  'ideal': bool(vertex.ideal),
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_vertex->x[2]))); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }

    /* "cython/core/dirichlet.pyx":343
 *                 {'position': ( self._number_(Real2Number(<Real>vertex.x[1])),
 *                                self._number_(Real2Number(<Real>vertex.x[2])),
 *                                self._number_(Real2Number(<Real>vertex.x[3])) ),             # <<<<<<<<<<<<<<
 *                  'ideal': bool(vertex.ideal),
 *                  'vertex_class' : vertex.v_class.index
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_9 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_vertex->x[3]))); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }

    /* "cython/core/dirichlet.pyx":341
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(
 *                 {'position': ( self._number_(Real2Number(<Real>vertex.x[1])),             # <<<<<<<<<<<<<<
 *                                self._number_(Real2Number(<Real>vertex.x[2])),
 *                                self._number_(Real2Number(<Real>vertex.x[3])) ),
*/
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4) != (0)) __PYX_ERR(10, 341, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6) != (0)) __PYX_ERR(10, 341, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8) != (0)) __PYX_ERR(10, 341, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_position, __pyx_t_9) < 0) __PYX_ERR(10, 341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/dirichlet.pyx":344
 *                                self._number_(Real2Number(<Real>vertex.x[2])),
 *                                self._number_(Real2Number(<Real>vertex.x[3])) ),
 *                  'ideal': bool(vertex.ideal),             # <<<<<<<<<<<<<<
 *                  'vertex_class' : vertex.v_class.index
 *                  })
*/
    __pyx_t_9 = __Pyx_PyLong_From_Boolean(__pyx_v_vertex->ideal); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(10, 344, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ideal, __pyx_t_9) < 0) __PYX_ERR(10, 341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/dirichlet.pyx":345
 *                                self._number_(Real2Number(<Real>vertex.x[3])) ),
 *                  'ideal': bool(vertex.ideal),
 *                  'vertex_class' : vertex.v_class.index             # <<<<<<<<<<<<<<
 *                  })
 *             vertex = vertex.next
*/
    __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_vertex->v_class->index); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_vertex_class, __pyx_t_9) < 0) __PYX_ERR(10, 341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/dirichlet.pyx":340
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             vertices.append(             # <<<<<<<<<<<<<<
 *                 {'position': ( self._number_(Real2Number(<Real>vertex.x[1])),
 *                                self._number_(Real2Number(<Real>vertex.x[2])),
*/
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_vertices, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(10, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":347
 *                  'vertex_class' : vertex.v_class.index
 *                  })
 *             vertex = vertex.next             # <<<<<<<<<<<<<<
 *         return vertices
 * 
*/
    __pyx_t_2 = __pyx_v_vertex->next;
    __pyx_v_vertex = __pyx_t_2;
  }

  /* "cython/core/dirichlet.pyx":348
 *                  })
 *             vertex = vertex.next
 *         return vertices             # <<<<<<<<<<<<<<
 * 
 *     def _vertex_to_index_dict(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_vertices);
  __pyx_r = __pyx_v_vertices;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":335
 *         return vertices
 * 
 *     def _vertex_data_list(self):             # <<<<<<<<<<<<<<
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
*/

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain._vertex_data_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":350
 *         return vertices
 * 
 *     def _vertex_to_index_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns dictionary from WEVertex pointer to index of vertex.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_33_vertex_to_index_dict(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_8SnapPyHP_16CDirichletDomain_32_vertex_to_index_dict, "\n        Returns dictionary from WEVertex pointer to index of vertex.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_33_vertex_to_index_dict = {"_vertex_to_index_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_33_vertex_to_index_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_32_vertex_to_index_dict};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_33_vertex_to_index_dict(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("_vertex_to_index_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_vertex_to_index_dict", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_vertex_to_index_dict", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_32_vertex_to_index_dict(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_32_vertex_to_index_dict(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  WEVertex *__pyx_v_vertex;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  WEVertex *__pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_vertex_to_index_dict", 0);

  /* "cython/core/dirichlet.pyx":354
 *         Returns dictionary from WEVertex pointer to index of vertex.
 *         """
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin             # <<<<<<<<<<<<<<
 * 
 *         result = {}
*/
  __pyx_v_vertex = (&__pyx_v_self->c_dirichlet_domain->vertex_list_begin);

  /* "cython/core/dirichlet.pyx":356
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 * 
 *         result = {}             # <<<<<<<<<<<<<<
 *         index = 0
 *         vertex = vertex.next
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":357
 * 
 *         result = {}
 *         index = 0             # <<<<<<<<<<<<<<
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_index = __pyx_mstate_global->__pyx_int_0;

  /* "cython/core/dirichlet.pyx":358
 *         result = {}
 *         index = 0
 *         vertex = vertex.next             # <<<<<<<<<<<<<<
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             result[<size_t>(vertex)] = index
*/
  __pyx_t_2 = __pyx_v_vertex->next;
  __pyx_v_vertex = __pyx_t_2;

  /* "cython/core/dirichlet.pyx":359
 *         index = 0
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:             # <<<<<<<<<<<<<<
 *             result[<size_t>(vertex)] = index
 *             index += 1
*/
  while (1) {
    __pyx_t_3 = (__pyx_v_vertex != (&__pyx_v_self->c_dirichlet_domain->vertex_list_end));
    if (!__pyx_t_3) break;

    /* "cython/core/dirichlet.pyx":360
 *         vertex = vertex.next
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             result[<size_t>(vertex)] = index             # <<<<<<<<<<<<<<
 *             index += 1
 *             vertex = vertex.next
*/
    __pyx_t_1 = __Pyx_PyLong_FromSize_t(((size_t)__pyx_v_vertex)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_t_1, __pyx_v_index) < 0))) __PYX_ERR(10, 360, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":361
 *         while vertex != &self.c_dirichlet_domain.vertex_list_end:
 *             result[<size_t>(vertex)] = index
 *             index += 1             # <<<<<<<<<<<<<<
 *             vertex = vertex.next
 *         return result
*/
    __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":362
 *             result[<size_t>(vertex)] = index
 *             index += 1
 *             vertex = vertex.next             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
    __pyx_t_2 = __pyx_v_vertex->next;
    __pyx_v_vertex = __pyx_t_2;
  }

  /* "cython/core/dirichlet.pyx":363
 *             index += 1
 *             vertex = vertex.next
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _edge_to_index_dict(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":350
 *         return vertices
 * 
 *     def _vertex_to_index_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns dictionary from WEVertex pointer to index of vertex.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain._vertex_to_index_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":365
 *         return result
 * 
 *     def _edge_to_index_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns dictionary from WEEdge pointer to index of edge.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_35_edge_to_index_dict(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_8SnapPyHP_16CDirichletDomain_34_edge_to_index_dict, "\n        Returns dictionary from WEEdge pointer to index of edge.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_35_edge_to_index_dict = {"_edge_to_index_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_35_edge_to_index_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_34_edge_to_index_dict};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_35_edge_to_index_dict(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("_edge_to_index_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_edge_to_index_dict", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_edge_to_index_dict", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_34_edge_to_index_dict(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_34_edge_to_index_dict(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  WEEdge *__pyx_v_edge;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  WEEdge *__pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_edge_to_index_dict", 0);

  /* "cython/core/dirichlet.pyx":369
 *         Returns dictionary from WEEdge pointer to index of edge.
 *         """
 *         cdef WEEdge *edge = &self.c_dirichlet_domain.edge_list_begin             # <<<<<<<<<<<<<<
 * 
 *         result = { }
*/
  __pyx_v_edge = (&__pyx_v_self->c_dirichlet_domain->edge_list_begin);

  /* "cython/core/dirichlet.pyx":371
 *         cdef WEEdge *edge = &self.c_dirichlet_domain.edge_list_begin
 * 
 *         result = { }             # <<<<<<<<<<<<<<
 *         index = 0
 *         edge = edge.next
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":372
 * 
 *         result = { }
 *         index = 0             # <<<<<<<<<<<<<<
 *         edge = edge.next
 *         while edge != &self.c_dirichlet_domain.edge_list_end:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_index = __pyx_mstate_global->__pyx_int_0;

  /* "cython/core/dirichlet.pyx":373
 *         result = { }
 *         index = 0
 *         edge = edge.next             # <<<<<<<<<<<<<<
 *         while edge != &self.c_dirichlet_domain.edge_list_end:
 *             result[<size_t>(edge)] = index
*/
  __pyx_t_2 = __pyx_v_edge->next;
  __pyx_v_edge = __pyx_t_2;

  /* "cython/core/dirichlet.pyx":374
 *         index = 0
 *         edge = edge.next
 *         while edge != &self.c_dirichlet_domain.edge_list_end:             # <<<<<<<<<<<<<<
 *             result[<size_t>(edge)] = index
 *             index += 1
*/
  while (1) {
    __pyx_t_3 = (__pyx_v_edge != (&__pyx_v_self->c_dirichlet_domain->edge_list_end));
    if (!__pyx_t_3) break;

    /* "cython/core/dirichlet.pyx":375
 *         edge = edge.next
 *         while edge != &self.c_dirichlet_domain.edge_list_end:
 *             result[<size_t>(edge)] = index             # <<<<<<<<<<<<<<
 *             index += 1
 *             edge = edge.next
*/
    __pyx_t_1 = __Pyx_PyLong_FromSize_t(((size_t)__pyx_v_edge)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_t_1, __pyx_v_index) < 0))) __PYX_ERR(10, 375, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":376
 *         while edge != &self.c_dirichlet_domain.edge_list_end:
 *             result[<size_t>(edge)] = index
 *             index += 1             # <<<<<<<<<<<<<<
 *             edge = edge.next
 *         return result
*/
    __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":377
 *             result[<size_t>(edge)] = index
 *             index += 1
 *             edge = edge.next             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
    __pyx_t_2 = __pyx_v_edge->next;
    __pyx_v_edge = __pyx_t_2;
  }

  /* "cython/core/dirichlet.pyx":378
 *             index += 1
 *             edge = edge.next
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def face_list(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":365
 *         return result
 * 
 *     def _edge_to_index_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns dictionary from WEEdge pointer to index of edge.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain._edge_to_index_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":380
 *         return result
 * 
 *     def face_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of faces, each represented as a dictionary with
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_37face_list(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_8SnapPyHP_16CDirichletDomain_36face_list, "\n        Return a list of faces, each represented as a dictionary with\n        keys 'vertices', 'distance', 'closest', 'hue', 'vertex_indices',\n        'edge_indices', 'vertex_image_indices', 'edge_image_indices',\n        'edge_orientations'.\n\n        The distance from the origin is the value for 'distance', and\n        the value for 'closest' is the orthogonal projection of the\n        origin to the plane containing the face.  The vertices of each\n        face are listed in clockwise order, as viewed from outside the\n        polyhedron.\n\n        The coordinates of vertices are stored in 'vertices' and the\n        corresponding index into vertex_data_list() is stored in\n        'vertex_index'. The indices (in edge_list()) to the edges of\n        the face (also in clockwise order) are stored in\n        'edge_indices' such that the first edge is adjacent to the\n        first and second vertex.  The respective value in\n        'edge_orientations' is +/-1 to indicate whether the\n        orientation of the edge induced from the orientation of the face\n        is the same or opposite than the edges orientation.\n\n        To find the image of a vertex or edge adjacent to a face under\n        the pairing matrix for this face, lookup the index in\n        'vertex_image_indices', respectively, 'edge_image_indices' at\n        the respective position.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_37face_list = {"face_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_37face_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_36face_list};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_37face_list(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("face_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("face_list", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("face_list", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_36face_list(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

/* "cython/core/dirichlet.pyx":434
 *                 vertex = edge.v[end]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 vertex_indices.append(
*/

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_9face_list_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct_7_genexpr *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(10, 434, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8SnapPyHP_16CDirichletDomain_9face_list_2generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_face_list_locals_genexpr, __pyx_mstate_global->__pyx_n_u_SnapPyHP); if (unlikely(!gen)) __PYX_ERR(10, 434, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.face_list.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_8SnapPyHP_16CDirichletDomain_9face_list_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  long __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_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 != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(10, 434, __pyx_L1_error)
  }

  /* "cython/core/dirichlet.pyx":435
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))
 *                     for i in range(1,4) ))             # <<<<<<<<<<<<<<
 *                 vertex_indices.append(
 *                     vertex_to_index[<size_t>(vertex)])
*/
  for (__pyx_t_1 = 1; __pyx_t_1 < 4; __pyx_t_1+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_1;

    /* "cython/core/dirichlet.pyx":434
 *                 vertex = edge.v[end]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 vertex_indices.append(
*/
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(10, 434, __pyx_L1_error) }
    __pyx_t_3 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_vertex->x[__pyx_cur_scope->__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __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;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(10, 434, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __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;
}

/* "cython/core/dirichlet.pyx":380
 *         return result
 * 
 *     def face_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of faces, each represented as a dictionary with
*/

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_36face_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *__pyx_cur_scope;
  WEFace *__pyx_v_face;
  WEEdge *__pyx_v_edge;
  WEEdge *__pyx_v_neighbor;
  PyObject *__pyx_v_vertex_to_index = NULL;
  PyObject *__pyx_v_edge_to_index = NULL;
  long __pyx_v_left;
  long __pyx_v_right;
  long __pyx_v_tail;
  long __pyx_v_tip;
  PyObject *__pyx_v_faces = NULL;
  PyObject *__pyx_v_vertices = NULL;
  PyObject *__pyx_v_vertex_indices = NULL;
  PyObject *__pyx_v_vertex_image_indices = NULL;
  PyObject *__pyx_v_edge_indices = NULL;
  PyObject *__pyx_v_edge_image_indices = NULL;
  PyObject *__pyx_v_edge_orientations = NULL;
  long __pyx_v_side;
  long __pyx_v_end;
  long __pyx_v_neighbor_end;
  PyObject *__pyx_gb_8SnapPyHP_16CDirichletDomain_9face_list_2generator4 = 0;
  PyObject *__pyx_9genexpr88__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  long __pyx_t_4;
  long __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  WEFace *__pyx_t_8;
  int __pyx_t_9;
  WEEdge *__pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  double __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("face_list", 0);
  __pyx_cur_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_6_face_list(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(10, 380, __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);

  /* "cython/core/dirichlet.pyx":408
 *         the respective position.
 *         """
 *         cdef WEFace *face = &self.c_dirichlet_domain.face_list_begin             # <<<<<<<<<<<<<<
 *         cdef WEEdge *edge
 *         cdef WEEdge *neighbor
*/
  __pyx_v_face = (&__pyx_cur_scope->__pyx_v_self->c_dirichlet_domain->face_list_begin);

  /* "cython/core/dirichlet.pyx":413
 *         cdef WEVertex *vertex
 * 
 *         vertex_to_index = self._vertex_to_index_dict()             # <<<<<<<<<<<<<<
 *         edge_to_index = self._edge_to_index_dict()
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_vertex_to_index_dict, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_vertex_to_index = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":414
 * 
 *         vertex_to_index = self._vertex_to_index_dict()
 *         edge_to_index = self._edge_to_index_dict()             # <<<<<<<<<<<<<<
 * 
 *         # WE enums -- see winged_edge.h
*/
  __pyx_t_2 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_edge_to_index_dict, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_edge_to_index = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":417
 * 
 *         # WE enums -- see winged_edge.h
 *         left, right, tail, tip = 0, 1, 0, 1             # <<<<<<<<<<<<<<
 *         faces = []
 *         face = face.next
*/
  __pyx_t_4 = 0;
  __pyx_t_5 = 1;
  __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  __pyx_v_left = __pyx_t_4;
  __pyx_v_right = __pyx_t_5;
  __pyx_v_tail = __pyx_t_6;
  __pyx_v_tip = __pyx_t_7;

  /* "cython/core/dirichlet.pyx":418
 *         # WE enums -- see winged_edge.h
 *         left, right, tail, tip = 0, 1, 0, 1
 *         faces = []             # <<<<<<<<<<<<<<
 *         face = face.next
 *         while face != &self.c_dirichlet_domain.face_list_end:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_faces = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":419
 *         left, right, tail, tip = 0, 1, 0, 1
 *         faces = []
 *         face = face.next             # <<<<<<<<<<<<<<
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             vertices = []
*/
  __pyx_t_8 = __pyx_v_face->next;
  __pyx_v_face = __pyx_t_8;

  /* "cython/core/dirichlet.pyx":420
 *         faces = []
 *         face = face.next
 *         while face != &self.c_dirichlet_domain.face_list_end:             # <<<<<<<<<<<<<<
 *             vertices = []
 *             vertex_indices = []
*/
  while (1) {
    __pyx_t_9 = (__pyx_v_face != (&__pyx_cur_scope->__pyx_v_self->c_dirichlet_domain->face_list_end));
    if (!__pyx_t_9) break;

    /* "cython/core/dirichlet.pyx":421
 *         face = face.next
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             vertices = []             # <<<<<<<<<<<<<<
 *             vertex_indices = []
 *             vertex_image_indices = []
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":422
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             vertices = []
 *             vertex_indices = []             # <<<<<<<<<<<<<<
 *             vertex_image_indices = []
 *             edge_indices = []
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_vertex_indices, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":423
 *             vertices = []
 *             vertex_indices = []
 *             vertex_image_indices = []             # <<<<<<<<<<<<<<
 *             edge_indices = []
 *             edge_image_indices = []
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_vertex_image_indices, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":424
 *             vertex_indices = []
 *             vertex_image_indices = []
 *             edge_indices = []             # <<<<<<<<<<<<<<
 *             edge_image_indices = []
 *             edge_orientations = []
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_edge_indices, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":425
 *             vertex_image_indices = []
 *             edge_indices = []
 *             edge_image_indices = []             # <<<<<<<<<<<<<<
 *             edge_orientations = []
 *             edge = face.some_edge
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_edge_image_indices, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":426
 *             edge_indices = []
 *             edge_image_indices = []
 *             edge_orientations = []             # <<<<<<<<<<<<<<
 *             edge = face.some_edge
 *             while True:
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_edge_orientations, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":427
 *             edge_image_indices = []
 *             edge_orientations = []
 *             edge = face.some_edge             # <<<<<<<<<<<<<<
 *             while True:
 *                 # find the vertex at the counter-clockwise end
*/
    __pyx_t_10 = __pyx_v_face->some_edge;
    __pyx_v_edge = __pyx_t_10;

    /* "cython/core/dirichlet.pyx":428
 *             edge_orientations = []
 *             edge = face.some_edge
 *             while True:             # <<<<<<<<<<<<<<
 *                 # find the vertex at the counter-clockwise end
 *                 side = left if edge.f[left] == face else right
*/
    while (1) {

      /* "cython/core/dirichlet.pyx":430
 *             while True:
 *                 # find the vertex at the counter-clockwise end
 *                 side = left if edge.f[left] == face else right             # <<<<<<<<<<<<<<
 *                 end = tip if side == left else tail
 *                 vertex = edge.v[end]
*/
      __pyx_t_9 = ((__pyx_v_edge->f[__pyx_v_left]) == __pyx_v_face);
      if (__pyx_t_9) {
        __pyx_t_7 = __pyx_v_left;
      } else {
        __pyx_t_7 = __pyx_v_right;
      }
      __pyx_v_side = __pyx_t_7;

      /* "cython/core/dirichlet.pyx":431
 *                 # find the vertex at the counter-clockwise end
 *                 side = left if edge.f[left] == face else right
 *                 end = tip if side == left else tail             # <<<<<<<<<<<<<<
 *                 vertex = edge.v[end]
 *                 vertices.append(tuple(
*/
      __pyx_t_9 = (__pyx_v_side == __pyx_v_left);
      if (__pyx_t_9) {
        __pyx_t_7 = __pyx_v_tip;
      } else {
        __pyx_t_7 = __pyx_v_tail;
      }
      __pyx_v_end = __pyx_t_7;

      /* "cython/core/dirichlet.pyx":432
 *                 side = left if edge.f[left] == face else right
 *                 end = tip if side == left else tail
 *                 vertex = edge.v[end]             # <<<<<<<<<<<<<<
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))
*/
      __pyx_cur_scope->__pyx_v_vertex = (__pyx_v_edge->v[__pyx_v_end]);

      /* "cython/core/dirichlet.pyx":434
 *                 vertex = edge.v[end]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 vertex_indices.append(
*/
      __pyx_t_1 = __pyx_pf_8SnapPyHP_16CDirichletDomain_9face_list_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/dirichlet.pyx":433
 *                 end = tip if side == left else tail
 *                 vertex = edge.v[end]
 *                 vertices.append(tuple(             # <<<<<<<<<<<<<<
 *                     self._number_(Real2Number(<Real>vertex.x[i]))
 *                     for i in range(1,4) ))
*/
      __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_vertices, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(10, 433, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/dirichlet.pyx":437
 *                     for i in range(1,4) ))
 *                 vertex_indices.append(
 *                     vertex_to_index[<size_t>(vertex)])             # <<<<<<<<<<<<<<
 *                 edge_indices.append(
 *                     edge_to_index[<size_t>(edge)])
*/
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vertex_to_index, ((size_t)__pyx_cur_scope->__pyx_v_vertex), size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/dirichlet.pyx":436
 *                     self._number_(Real2Number(<Real>vertex.x[i]))
 *                     for i in range(1,4) ))
 *                 vertex_indices.append(             # <<<<<<<<<<<<<<
 *                     vertex_to_index[<size_t>(vertex)])
 *                 edge_indices.append(
*/
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_vertex_indices, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(10, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/dirichlet.pyx":439
 *                     vertex_to_index[<size_t>(vertex)])
 *                 edge_indices.append(
 *                     edge_to_index[<size_t>(edge)])             # <<<<<<<<<<<<<<
 *                 edge_orientations.append(
 *                     +1 if side == left else -1)
*/
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_edge_to_index, ((size_t)__pyx_v_edge), size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/dirichlet.pyx":438
 *                 vertex_indices.append(
 *                     vertex_to_index[<size_t>(vertex)])
 *                 edge_indices.append(             # <<<<<<<<<<<<<<
 *                     edge_to_index[<size_t>(edge)])
 *                 edge_orientations.append(
*/
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_edge_indices, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(10, 438, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/dirichlet.pyx":441
 *                     edge_to_index[<size_t>(edge)])
 *                 edge_orientations.append(
 *                     +1 if side == left else -1)             # <<<<<<<<<<<<<<
 * 
 *                 neighbor = edge.neighbor[side]
*/
      __pyx_t_9 = (__pyx_v_side == __pyx_v_left);
      if (__pyx_t_9) {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
        __pyx_t_2 = __pyx_mstate_global->__pyx_int_1;
      } else {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
        __pyx_t_2 = __pyx_mstate_global->__pyx_int_neg_1;
      }

      /* "cython/core/dirichlet.pyx":440
 *                 edge_indices.append(
 *                     edge_to_index[<size_t>(edge)])
 *                 edge_orientations.append(             # <<<<<<<<<<<<<<
 *                     +1 if side == left else -1)
 * 
*/
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_edge_orientations, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(10, 440, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/dirichlet.pyx":443
 *                     +1 if side == left else -1)
 * 
 *                 neighbor = edge.neighbor[side]             # <<<<<<<<<<<<<<
 *                 edge_image_indices.append(
 *                     edge_to_index[<size_t>neighbor])
*/
      __pyx_v_neighbor = (__pyx_v_edge->neighbor[__pyx_v_side]);

      /* "cython/core/dirichlet.pyx":445
 *                 neighbor = edge.neighbor[side]
 *                 edge_image_indices.append(
 *                     edge_to_index[<size_t>neighbor])             # <<<<<<<<<<<<<<
 * 
 *                 neighbor_end = end
*/
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_edge_to_index, ((size_t)__pyx_v_neighbor), size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/dirichlet.pyx":444
 * 
 *                 neighbor = edge.neighbor[side]
 *                 edge_image_indices.append(             # <<<<<<<<<<<<<<
 *                     edge_to_index[<size_t>neighbor])
 * 
*/
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_edge_image_indices, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(10, 444, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/dirichlet.pyx":447
 *                     edge_to_index[<size_t>neighbor])
 * 
 *                 neighbor_end = end             # <<<<<<<<<<<<<<
 *                 if not edge.preserves_direction[side]:
 *                     neighbor_end = tail if end == tip else tip
*/
      __pyx_v_neighbor_end = __pyx_v_end;

      /* "cython/core/dirichlet.pyx":448
 * 
 *                 neighbor_end = end
 *                 if not edge.preserves_direction[side]:             # <<<<<<<<<<<<<<
 *                     neighbor_end = tail if end == tip else tip
 * 
*/
      __pyx_t_9 = (!((__pyx_v_edge->preserves_direction[__pyx_v_side]) != 0));
      if (__pyx_t_9) {

        /* "cython/core/dirichlet.pyx":449
 *                 neighbor_end = end
 *                 if not edge.preserves_direction[side]:
 *                     neighbor_end = tail if end == tip else tip             # <<<<<<<<<<<<<<
 * 
 *                 vertex_image_indices.append(
*/
        __pyx_t_9 = (__pyx_v_end == __pyx_v_tip);
        if (__pyx_t_9) {
          __pyx_t_7 = __pyx_v_tail;
        } else {
          __pyx_t_7 = __pyx_v_tip;
        }
        __pyx_v_neighbor_end = __pyx_t_7;

        /* "cython/core/dirichlet.pyx":448
 * 
 *                 neighbor_end = end
 *                 if not edge.preserves_direction[side]:             # <<<<<<<<<<<<<<
 *                     neighbor_end = tail if end == tip else tip
 * 
*/
      }

      /* "cython/core/dirichlet.pyx":452
 * 
 *                 vertex_image_indices.append(
 *                     vertex_to_index[<size_t>(neighbor.v[neighbor_end])])             # <<<<<<<<<<<<<<
 * 
 *                 # get the next edge
*/
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vertex_to_index, ((size_t)(__pyx_v_neighbor->v[__pyx_v_neighbor_end])), size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/dirichlet.pyx":451
 *                     neighbor_end = tail if end == tip else tip
 * 
 *                 vertex_image_indices.append(             # <<<<<<<<<<<<<<
 *                     vertex_to_index[<size_t>(neighbor.v[neighbor_end])])
 * 
*/
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_vertex_image_indices, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(10, 451, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/dirichlet.pyx":455
 * 
 *                 # get the next edge
 *                 edge = edge.e[end][side]             # <<<<<<<<<<<<<<
 *                 if edge == face.some_edge:
 *                     break
*/
      __pyx_v_edge = ((__pyx_v_edge->e[__pyx_v_end])[__pyx_v_side]);

      /* "cython/core/dirichlet.pyx":456
 *                 # get the next edge
 *                 edge = edge.e[end][side]
 *                 if edge == face.some_edge:             # <<<<<<<<<<<<<<
 *                     break
 * 
*/
      __pyx_t_9 = (__pyx_v_edge == __pyx_v_face->some_edge);
      if (__pyx_t_9) {

        /* "cython/core/dirichlet.pyx":457
 *                 edge = edge.e[end][side]
 *                 if edge == face.some_edge:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             faces.append(
*/
        goto __pyx_L6_break;

        /* "cython/core/dirichlet.pyx":456
 *                 # get the next edge
 *                 edge = edge.e[end][side]
 *                 if edge == face.some_edge:             # <<<<<<<<<<<<<<
 *                     break
 * 
*/
      }
    }
    __pyx_L6_break:;

    /* "cython/core/dirichlet.pyx":460
 * 
 *             faces.append(
 *                 {'vertices' : vertices,             # <<<<<<<<<<<<<<
 *                  'vertex_indices' : vertex_indices,
 *                  'edge_indices' : edge_indices,
*/
    __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vertices, __pyx_v_vertices) < 0) __PYX_ERR(10, 460, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":461
 *             faces.append(
 *                 {'vertices' : vertices,
 *                  'vertex_indices' : vertex_indices,             # <<<<<<<<<<<<<<
 *                  'edge_indices' : edge_indices,
 *                  'vertex_image_indices' : vertex_image_indices,
*/
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vertex_indices, __pyx_v_vertex_indices) < 0) __PYX_ERR(10, 460, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":462
 *                 {'vertices' : vertices,
 *                  'vertex_indices' : vertex_indices,
 *                  'edge_indices' : edge_indices,             # <<<<<<<<<<<<<<
 *                  'vertex_image_indices' : vertex_image_indices,
 *                  'edge_image_indices' : edge_image_indices,
*/
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_edge_indices, __pyx_v_edge_indices) < 0) __PYX_ERR(10, 460, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":463
 *                  'vertex_indices' : vertex_indices,
 *                  'edge_indices' : edge_indices,
 *                  'vertex_image_indices' : vertex_image_indices,             # <<<<<<<<<<<<<<
 *                  'edge_image_indices' : edge_image_indices,
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),
*/
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vertex_image_indices, __pyx_v_vertex_image_indices) < 0) __PYX_ERR(10, 460, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":464
 *                  'edge_indices' : edge_indices,
 *                  'vertex_image_indices' : vertex_image_indices,
 *                  'edge_image_indices' : edge_image_indices,             # <<<<<<<<<<<<<<
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),
 *                  'closest'  : [
*/
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_edge_image_indices, __pyx_v_edge_image_indices) < 0) __PYX_ERR(10, 460, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":465
 *                  'vertex_image_indices' : vertex_image_indices,
 *                  'edge_image_indices' : edge_image_indices,
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),             # <<<<<<<<<<<<<<
 *                  'closest'  : [
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
*/
    __pyx_t_12 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_13 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)__pyx_v_face->dist)); if (unlikely(!__pyx_t_13)) __PYX_ERR(10, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_distance, __pyx_t_1) < 0) __PYX_ERR(10, 460, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    { /* enter inner scope */

      /* "cython/core/dirichlet.pyx":466
 *                  'edge_image_indices' : edge_image_indices,
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),
 *                  'closest'  : [             # <<<<<<<<<<<<<<
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
 *                      for i in range(1,4) ],
*/
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 466, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/dirichlet.pyx":468
 *                  'closest'  : [
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
 *                      for i in range(1,4) ],             # <<<<<<<<<<<<<<
 *                  'hue'      : Real2double(face.f_class.hue),
 *                  'edge_orientations' : edge_orientations})
*/
      for (__pyx_t_14 = 1; __pyx_t_14 < 4; __pyx_t_14+=1) {
        __pyx_t_13 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(10, 468, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_XDECREF_SET(__pyx_9genexpr88__pyx_v_i, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "cython/core/dirichlet.pyx":467
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),
 *                  'closest'  : [
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))             # <<<<<<<<<<<<<<
 *                      for i in range(1,4) ],
 *                  'hue'      : Real2double(face.f_class.hue),
*/
        __pyx_t_12 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_9genexpr88__pyx_v_i); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 467, __pyx_L11_error)
        __pyx_t_16 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(__pyx_v_face->closest_point[__pyx_t_15]))); if (unlikely(!__pyx_t_16)) __PYX_ERR(10, 467, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_16};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(10, 467, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_13))) __PYX_ERR(10, 466, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_XDECREF(__pyx_9genexpr88__pyx_v_i); __pyx_9genexpr88__pyx_v_i = 0;
      goto __pyx_L14_exit_scope;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_9genexpr88__pyx_v_i); __pyx_9genexpr88__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L14_exit_scope:;
    } /* exit inner scope */
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_closest, __pyx_t_1) < 0) __PYX_ERR(10, 460, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":469
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
 *                      for i in range(1,4) ],
 *                  'hue'      : Real2double(face.f_class.hue),             # <<<<<<<<<<<<<<
 *                  'edge_orientations' : edge_orientations})
 *             face = face.next
*/
    __pyx_t_17 = __pyx_f_8SnapPyHP_Real2double(__pyx_v_face->f_class->hue); if (unlikely(__pyx_t_17 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(10, 469, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_hue, __pyx_t_1) < 0) __PYX_ERR(10, 460, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":470
 *                      for i in range(1,4) ],
 *                  'hue'      : Real2double(face.f_class.hue),
 *                  'edge_orientations' : edge_orientations})             # <<<<<<<<<<<<<<
 *             face = face.next
 *         return faces
*/
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_edge_orientations, __pyx_v_edge_orientations) < 0) __PYX_ERR(10, 460, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":459
 *                     break
 * 
 *             faces.append(             # <<<<<<<<<<<<<<
 *                 {'vertices' : vertices,
 *                  'vertex_indices' : vertex_indices,
*/
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_faces, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(10, 459, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":471
 *                  'hue'      : Real2double(face.f_class.hue),
 *                  'edge_orientations' : edge_orientations})
 *             face = face.next             # <<<<<<<<<<<<<<
 *         return faces
 * 
*/
    __pyx_t_8 = __pyx_v_face->next;
    __pyx_v_face = __pyx_t_8;
  }

  /* "cython/core/dirichlet.pyx":472
 *                  'edge_orientations' : edge_orientations})
 *             face = face.next
 *         return faces             # <<<<<<<<<<<<<<
 * 
 *     def edge_list(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_faces);
  __pyx_r = __pyx_v_faces;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":380
 *         return result
 * 
 *     def face_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of faces, each represented as a dictionary with
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.face_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vertex_to_index);
  __Pyx_XDECREF(__pyx_v_edge_to_index);
  __Pyx_XDECREF(__pyx_v_faces);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XDECREF(__pyx_v_vertex_indices);
  __Pyx_XDECREF(__pyx_v_vertex_image_indices);
  __Pyx_XDECREF(__pyx_v_edge_indices);
  __Pyx_XDECREF(__pyx_v_edge_image_indices);
  __Pyx_XDECREF(__pyx_v_edge_orientations);
  __Pyx_XDECREF(__pyx_gb_8SnapPyHP_16CDirichletDomain_9face_list_2generator4);
  __Pyx_XDECREF(__pyx_9genexpr88__pyx_v_i);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":474
 *         return faces
 * 
 *     def edge_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of edges, each represented as a dictionar with keys
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_39edge_list(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_8SnapPyHP_16CDirichletDomain_38edge_list, "\n        Return a list of edges, each represented as a dictionar with keys\n        'tail_vertex_index', 'tip_vertex_index', 'edge_class'.\n\n        The index (into vertex_data_list()) to the two vertices at the\n        end of the edge are stored in 'tail_vertex_index' and\n        'tip_vertex_index'. The index of the edge class this edge\n        belongs to is stored in 'edge_class'.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_39edge_list = {"edge_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_39edge_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_38edge_list};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_39edge_list(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("edge_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("edge_list", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("edge_list", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_38edge_list(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_38edge_list(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  WEEdge *__pyx_v_edge;
  PyObject *__pyx_v_edges = 0;
  PyObject *__pyx_v_vertex_to_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  WEEdge *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("edge_list", 0);

  /* "cython/core/dirichlet.pyx":485
 *         """
 * 
 *         cdef WEEdge *edge = &self.c_dirichlet_domain.edge_list_begin             # <<<<<<<<<<<<<<
 *         cdef list edges = []
 * 
*/
  __pyx_v_edge = (&__pyx_v_self->c_dirichlet_domain->edge_list_begin);

  /* "cython/core/dirichlet.pyx":486
 * 
 *         cdef WEEdge *edge = &self.c_dirichlet_domain.edge_list_begin
 *         cdef list edges = []             # <<<<<<<<<<<<<<
 * 
 *         vertex_to_index = self._vertex_to_index_dict()
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_edges = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":488
 *         cdef list edges = []
 * 
 *         vertex_to_index = self._vertex_to_index_dict()             # <<<<<<<<<<<<<<
 * 
 *         edge = edge.next
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_vertex_to_index_dict, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_vertex_to_index = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":490
 *         vertex_to_index = self._vertex_to_index_dict()
 * 
 *         edge = edge.next             # <<<<<<<<<<<<<<
 *         while edge != &self.c_dirichlet_domain.edge_list_end:
 * 
*/
  __pyx_t_4 = __pyx_v_edge->next;
  __pyx_v_edge = __pyx_t_4;

  /* "cython/core/dirichlet.pyx":491
 * 
 *         edge = edge.next
 *         while edge != &self.c_dirichlet_domain.edge_list_end:             # <<<<<<<<<<<<<<
 * 
 *             edges.append(
*/
  while (1) {
    __pyx_t_5 = (__pyx_v_edge != (&__pyx_v_self->c_dirichlet_domain->edge_list_end));
    if (!__pyx_t_5) break;

    /* "cython/core/dirichlet.pyx":494
 * 
 *             edges.append(
 *                 {'tail_vertex_index': vertex_to_index[<size_t>(edge.v[0])],             # <<<<<<<<<<<<<<
 *                  'tip_vertex_index': vertex_to_index[<size_t>(edge.v[1])],
 *                  'edge_class': edge.e_class.index})
*/
    __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vertex_to_index, ((size_t)(__pyx_v_edge->v[0])), size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_tail_vertex_index, __pyx_t_2) < 0) __PYX_ERR(10, 494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":495
 *             edges.append(
 *                 {'tail_vertex_index': vertex_to_index[<size_t>(edge.v[0])],
 *                  'tip_vertex_index': vertex_to_index[<size_t>(edge.v[1])],             # <<<<<<<<<<<<<<
 *                  'edge_class': edge.e_class.index})
 * 
*/
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vertex_to_index, ((size_t)(__pyx_v_edge->v[1])), size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_tip_vertex_index, __pyx_t_2) < 0) __PYX_ERR(10, 494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":496
 *                 {'tail_vertex_index': vertex_to_index[<size_t>(edge.v[0])],
 *                  'tip_vertex_index': vertex_to_index[<size_t>(edge.v[1])],
 *                  'edge_class': edge.e_class.index})             # <<<<<<<<<<<<<<
 * 
 *             edge = edge.next
*/
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_edge->e_class->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_edge_class, __pyx_t_2) < 0) __PYX_ERR(10, 494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":493
 *         while edge != &self.c_dirichlet_domain.edge_list_end:
 * 
 *             edges.append(             # <<<<<<<<<<<<<<
 *                 {'tail_vertex_index': vertex_to_index[<size_t>(edge.v[0])],
 *                  'tip_vertex_index': vertex_to_index[<size_t>(edge.v[1])],
*/
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_edges, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(10, 493, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":498
 *                  'edge_class': edge.e_class.index})
 * 
 *             edge = edge.next             # <<<<<<<<<<<<<<
 * 
 *         return edges
*/
    __pyx_t_4 = __pyx_v_edge->next;
    __pyx_v_edge = __pyx_t_4;
  }

  /* "cython/core/dirichlet.pyx":500
 *             edge = edge.next
 * 
 *         return edges             # <<<<<<<<<<<<<<
 * 
 *     def view(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_edges);
  __pyx_r = __pyx_v_edges;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":474
 *         return faces
 * 
 *     def edge_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of edges, each represented as a dictionar with keys
*/

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

/* "cython/core/dirichlet.pyx":502
 *         return edges
 * 
 *     def view(self):             # <<<<<<<<<<<<<<
 *         if PolyhedronViewer:
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_41view(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_41view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_41view, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_41view(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("view (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("view", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("view", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_40view(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_40view(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("view", 0);

  /* "cython/core/dirichlet.pyx":503
 * 
 *     def view(self):
 *         if PolyhedronViewer:             # <<<<<<<<<<<<<<
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),
 *                                 title=f'Dirichlet Domain of {self.manifold_name}')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PolyhedronViewer); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 503, __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(10, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/dirichlet.pyx":504
 *     def view(self):
 *         if PolyhedronViewer:
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),             # <<<<<<<<<<<<<<
 *                                 title=f'Dirichlet Domain of {self.manifold_name}')
 *         raise RuntimeError('The PolyhedronViewer class '
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ViewerWindow); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PolyhedronViewer); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_face_list, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }

    /* "cython/core/dirichlet.pyx":505
 *         if PolyhedronViewer:
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),
 *                                 title=f'Dirichlet Domain of {self.manifold_name}')             # <<<<<<<<<<<<<<
 *         raise RuntimeError('The PolyhedronViewer class '
 *                            'was not imported.')
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Dirichlet_Domain_of, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_facedicts, __pyx_t_6, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(10, 504, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_title, __pyx_t_7, __pyx_t_9, __pyx_callargs+2, 1) < 0) __PYX_ERR(10, 504, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/dirichlet.pyx":503
 * 
 *     def view(self):
 *         if PolyhedronViewer:             # <<<<<<<<<<<<<<
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),
 *                                 title=f'Dirichlet Domain of {self.manifold_name}')
*/
  }

  /* "cython/core/dirichlet.pyx":506
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),
 *                                 title=f'Dirichlet Domain of {self.manifold_name}')
 *         raise RuntimeError('The PolyhedronViewer class '             # <<<<<<<<<<<<<<
 *                            'was not imported.')
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_RuntimeError);
  __pyx_t_9 = __pyx_builtin_RuntimeError; 
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_PolyhedronViewer_class_was_n};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 506, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":502
 *         return edges
 * 
 *     def view(self):             # <<<<<<<<<<<<<<
 *         if PolyhedronViewer:
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":509
 *                            'was not imported.')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Manifold computed directly from the Dirichlet
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_43manifold(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_8SnapPyHP_16CDirichletDomain_42manifold, "\n        Returns a Manifold computed directly from the Dirichlet\n        domain, regarded as polyhedron with faces identified in pairs.\n        Only works if this gives a manifold not an orbifold.\n\n        >>> M = Manifold('7_3')\n        >>> D = M.dirichlet_domain()\n        >>> A = D.manifold()\n        >>> M.is_isometric_to(A)\n        True\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_43manifold = {"manifold", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_43manifold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_42manifold};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_43manifold(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("manifold (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("manifold", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("manifold", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_42manifold(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_42manifold(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("manifold", 0);

  /* "cython/core/dirichlet.pyx":522
 * 
 *         """
 *         return self.triangulate(_manifold_class)             # <<<<<<<<<<<<<<
 * 
 *     def triangulation(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_manifold_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_CDirichletDomain *)__pyx_v_self->__pyx_vtab)->triangulate(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 522, __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;

  /* "cython/core/dirichlet.pyx":509
 *                            'was not imported.')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Manifold computed directly from the Dirichlet
*/

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

/* "cython/core/dirichlet.pyx":524
 *         return self.triangulate(_manifold_class)
 * 
 *     def triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Triangulation computed directly from the Dirichlet
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_45triangulation(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_8SnapPyHP_16CDirichletDomain_44triangulation, "\n        Returns a Triangulation computed directly from the Dirichlet\n        domain, regarded as polyhedron with faces identified in pairs.\n        Only works if this gives a manifold not an orbifold.\n\n        >>> M = Manifold('7_3')\n        >>> D = M.dirichlet_domain()\n        >>> B = D.triangulation()\n        >>> M.is_isometric_to(B.with_hyperbolic_structure())\n        True\n\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_45triangulation = {"triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_45triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_44triangulation};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_45triangulation(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("triangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("triangulation", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("triangulation", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_44triangulation(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_44triangulation(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("triangulation", 0);

  /* "cython/core/dirichlet.pyx":537
 * 
 *         """
 *         return self.triangulate(_triangulation_class)             # <<<<<<<<<<<<<<
 * 
 *     cdef triangulate(self, return_class):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_triangulation_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_CDirichletDomain *)__pyx_v_self->__pyx_vtab)->triangulate(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 537, __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;

  /* "cython/core/dirichlet.pyx":524
 *         return self.triangulate(_manifold_class)
 * 
 *     def triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Triangulation computed directly from the Dirichlet
*/

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

/* "cython/core/dirichlet.pyx":539
 *         return self.triangulate(_triangulation_class)
 * 
 *     cdef triangulate(self, return_class):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation *c_triangulation
 *         cdef Triangulation M
*/

static PyObject *__pyx_f_8SnapPyHP_16CDirichletDomain_triangulate(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_return_class) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_M = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Triangulation *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("triangulate", 0);

  /* "cython/core/dirichlet.pyx":542
 *         cdef c_Triangulation *c_triangulation
 *         cdef Triangulation M
 *         c_triangulation = Dirichlet_to_triangulation(self.c_dirichlet_domain)             # <<<<<<<<<<<<<<
 *         if c_triangulation is NULL:
 *             raise ValueError('The Dirichlet domain could not be '
*/
  __pyx_t_1 = Dirichlet_to_triangulation(__pyx_v_self->c_dirichlet_domain); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 542, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_1;

  /* "cython/core/dirichlet.pyx":543
 *         cdef Triangulation M
 *         c_triangulation = Dirichlet_to_triangulation(self.c_dirichlet_domain)
 *         if c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dirichlet domain could not be '
 *                              'triangulated; perhaps this is an '
*/
  __pyx_t_2 = (__pyx_v_c_triangulation == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/dirichlet.pyx":544
 *         c_triangulation = Dirichlet_to_triangulation(self.c_dirichlet_domain)
 *         if c_triangulation is NULL:
 *             raise ValueError('The Dirichlet domain could not be '             # <<<<<<<<<<<<<<
 *                              'triangulated; perhaps this is an '
 *                              'orbifold group?')
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_Dirichlet_domain_could_not_b};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(10, 544, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":543
 *         cdef Triangulation M
 *         c_triangulation = Dirichlet_to_triangulation(self.c_dirichlet_domain)
 *         if c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dirichlet domain could not be '
 *                              'triangulated; perhaps this is an '
*/
  }

  /* "cython/core/dirichlet.pyx":547
 *                              'triangulated; perhaps this is an '
 *                              'orbifold group?')
 *         M = return_class('empty')             # <<<<<<<<<<<<<<
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name)
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_v_return_class);
  __pyx_t_4 = __pyx_v_return_class; 
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation))))) __PYX_ERR(10, 547, __pyx_L1_error)
  __pyx_v_M = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":548
 *                              'orbifold group?')
 *         M = return_class('empty')
 *         M.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         M.set_name(self.manifold_name)
 *         return M
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_M->__pyx_vtab)->set_c_triangulation(__pyx_v_M, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":549
 *         M = return_class('empty')
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name)             # <<<<<<<<<<<<<<
 *         return M
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_M);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":550
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name)
 *         return M             # <<<<<<<<<<<<<<
 * 
 *     def volume(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_M);
  __pyx_r = ((PyObject *)__pyx_v_M);
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":539
 *         return self.triangulate(_triangulation_class)
 * 
 *     cdef triangulate(self, return_class):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation *c_triangulation
 *         cdef Triangulation M
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.triangulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_M);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":552
 *         return M
 * 
 *     def volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the approximate volume of the DirichletDomain.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_47volume(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_8SnapPyHP_16CDirichletDomain_46volume, "\n        Returns the approximate volume of the DirichletDomain.\n        Because matrices in O(3,1) tend to accumulate roundoff error,\n        it's hard to get a good bound on the accuracy of the computed\n        volume.  Nevertheless, the kernel computes the best value it\n        can, with the hope that it will aid the user in recognizing\n        manifolds defined by a set of generators.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_47volume = {"volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_47volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_46volume};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_47volume(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("volume (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("volume", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("volume", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_46volume(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_46volume(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_v_volume = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("volume", 0);

  /* "cython/core/dirichlet.pyx":561
 *         manifolds defined by a set of generators.
 *         """
 *         volume = Real2Number(self.c_dirichlet_domain.approximate_volume)             # <<<<<<<<<<<<<<
 *         return self._number_(volume)
 * 
*/
  __pyx_t_1 = __pyx_f_8SnapPyHP_Real2Number(__pyx_v_self->c_dirichlet_domain->approximate_volume); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_volume = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":562
 *         """
 *         volume = Real2Number(self.c_dirichlet_domain.approximate_volume)
 *         return self._number_(volume)             # <<<<<<<<<<<<<<
 * 
 *     def pairing_matrices(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_volume};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":552
 *         return M
 * 
 *     def volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the approximate volume of the DirichletDomain.
*/

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

/* "cython/core/dirichlet.pyx":564
 *         return self._number_(volume)
 * 
 *     def pairing_matrices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of the O31Matrices which pair the faces of
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_49pairing_matrices(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_8SnapPyHP_16CDirichletDomain_48pairing_matrices, "\n        Returns a list of the O31Matrices which pair the faces of\n        this DirichletDomain.\n\n        >>> M = Manifold('s345')\n        >>> D = M.dirichlet_domain()\n        >>> matrices = D.pairing_matrices()\n        >>> D1 = DirichletDomain(O31_generators=matrices)\n        >>> N = D1.manifold()\n        >>> M.is_isometric_to(N)\n        True\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_49pairing_matrices = {"pairing_matrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_49pairing_matrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_48pairing_matrices};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_49pairing_matrices(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("pairing_matrices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pairing_matrices", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pairing_matrices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_48pairing_matrices(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_48pairing_matrices(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  O31Matrix *__pyx_v_M;
  WEFace *__pyx_v_face;
  PyObject *__pyx_v_matrices = NULL;
  int __pyx_9genexpr89__pyx_v_i;
  int __pyx_9genexpr90__pyx_v_j;
  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;
  size_t __pyx_t_5;
  WEFace *__pyx_t_6;
  O31Matrix *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pairing_matrices", 0);

  /* "cython/core/dirichlet.pyx":581
 *         cdef WEFace* face
 * 
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dirichlet Domain was not computed.')
 *         matrices = []
*/
  __pyx_t_1 = (__pyx_v_self->c_dirichlet_domain == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/dirichlet.pyx":582
 * 
 *         if self.c_dirichlet_domain == NULL:
 *             raise ValueError('The Dirichlet Domain was not computed.')             # <<<<<<<<<<<<<<
 *         matrices = []
 *         face = self.c_dirichlet_domain.face_list_begin.next
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Dirichlet_Domain_was_not_com};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(10, 582, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":581
 *         cdef WEFace* face
 * 
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dirichlet Domain was not computed.')
 *         matrices = []
*/
  }

  /* "cython/core/dirichlet.pyx":583
 *         if self.c_dirichlet_domain == NULL:
 *             raise ValueError('The Dirichlet Domain was not computed.')
 *         matrices = []             # <<<<<<<<<<<<<<
 *         face = self.c_dirichlet_domain.face_list_begin.next
 *         while face != &self.c_dirichlet_domain.face_list_end:
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_matrices = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":584
 *             raise ValueError('The Dirichlet Domain was not computed.')
 *         matrices = []
 *         face = self.c_dirichlet_domain.face_list_begin.next             # <<<<<<<<<<<<<<
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             M = face.group_element
*/
  __pyx_t_6 = __pyx_v_self->c_dirichlet_domain->face_list_begin.next;
  __pyx_v_face = __pyx_t_6;

  /* "cython/core/dirichlet.pyx":585
 *         matrices = []
 *         face = self.c_dirichlet_domain.face_list_begin.next
 *         while face != &self.c_dirichlet_domain.face_list_end:             # <<<<<<<<<<<<<<
 *             M = face.group_element
 *             matrices.append(matrix(
*/
  while (1) {
    __pyx_t_1 = (__pyx_v_face != (&__pyx_v_self->c_dirichlet_domain->face_list_end));
    if (!__pyx_t_1) break;

    /* "cython/core/dirichlet.pyx":586
 *         face = self.c_dirichlet_domain.face_list_begin.next
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             M = face.group_element             # <<<<<<<<<<<<<<
 *             matrices.append(matrix(
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))
*/
    __pyx_t_7 = __pyx_v_face->group_element;
    __pyx_v_M = __pyx_t_7;

    /* "cython/core/dirichlet.pyx":587
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             M = face.group_element
 *             matrices.append(matrix(             # <<<<<<<<<<<<<<
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))
 *                   for j in range(4)] for i in range(4)] ))
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { /* enter inner scope */

      /* "cython/core/dirichlet.pyx":588
 *             M = face.group_element
 *             matrices.append(matrix(
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(4)] for i in range(4)] ))
 *             face = face.next
*/
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);

      /* "cython/core/dirichlet.pyx":589
 *             matrices.append(matrix(
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))
 *                   for j in range(4)] for i in range(4)] ))             # <<<<<<<<<<<<<<
 *             face = face.next
 *         return matrices
*/
      for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) {
        __pyx_9genexpr89__pyx_v_i = __pyx_t_9;
        { /* enter inner scope */

          /* "cython/core/dirichlet.pyx":588
 *             M = face.group_element
 *             matrices.append(matrix(
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(4)] for i in range(4)] ))
 *             face = face.next
*/
          __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 588, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "cython/core/dirichlet.pyx":589
 *             matrices.append(matrix(
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))
 *                   for j in range(4)] for i in range(4)] ))             # <<<<<<<<<<<<<<
 *             face = face.next
 *         return matrices
*/
          for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
            __pyx_9genexpr90__pyx_v_j = __pyx_t_11;

            /* "cython/core/dirichlet.pyx":588
 *             M = face.group_element
 *             matrices.append(matrix(
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(4)] for i in range(4)] ))
 *             face = face.next
*/
            __pyx_t_13 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_13);
            __pyx_t_14 = __pyx_f_8SnapPyHP_Real2Number(((__pyx_t_8SnapPyHP_Real)(((__pyx_v_M[0])[__pyx_9genexpr89__pyx_v_i])[__pyx_9genexpr90__pyx_v_j]))); if (unlikely(!__pyx_t_14)) __PYX_ERR(10, 588, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
              __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 588, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
            }
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_12))) __PYX_ERR(10, 588, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
        } /* exit inner scope */
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_10))) __PYX_ERR(10, 588, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    } /* exit inner scope */
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 587, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "cython/core/dirichlet.pyx":587
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             M = face.group_element
 *             matrices.append(matrix(             # <<<<<<<<<<<<<<
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))
 *                   for j in range(4)] for i in range(4)] ))
*/
    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_matrices, __pyx_t_2); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(10, 587, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":590
 *                 [[self._number_(Real2Number(<Real>M[0][i][j]))
 *                   for j in range(4)] for i in range(4)] ))
 *             face = face.next             # <<<<<<<<<<<<<<
 *         return matrices
 * 
*/
    __pyx_t_6 = __pyx_v_face->next;
    __pyx_v_face = __pyx_t_6;
  }

  /* "cython/core/dirichlet.pyx":591
 *                   for j in range(4)] for i in range(4)] ))
 *             face = face.next
 *         return matrices             # <<<<<<<<<<<<<<
 * 
 *     def pairing_words(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_matrices);
  __pyx_r = __pyx_v_matrices;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":564
 *         return self._number_(volume)
 * 
 *     def pairing_matrices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of the O31Matrices which pair the faces of
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.pairing_matrices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matrices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":593
 *         return matrices
 * 
 *     def pairing_words(self):             # <<<<<<<<<<<<<<
 *         """
 *         Group elements which pair the faces of this DirichletDomain
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_51pairing_words(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_8SnapPyHP_16CDirichletDomain_50pairing_words, "\n        Group elements which pair the faces of this DirichletDomain\n        as words in the original generators:\n\n        >>> M = Manifold('m004')\n        >>> D = M.dirichlet_domain(include_words = True)\n        >>> sorted(D.pairing_words()) #doctest: +ELLIPSIS\n        ['A', ...]\n\n        Requires that DirichletDomain was computed with\n        include_words = True.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_51pairing_words = {"pairing_words", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_51pairing_words, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_50pairing_words};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_51pairing_words(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("pairing_words (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pairing_words", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pairing_words", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_50pairing_words(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_50pairing_words(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  WEFace *__pyx_v_face;
  int *__pyx_v_c_word;
  PyObject *__pyx_v_words = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  WEFace *__pyx_t_6;
  int *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pairing_words", 0);

  /* "cython/core/dirichlet.pyx":610
 *         cdef int* c_word
 * 
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dirichlet Domain was not computed.')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_dirichlet_domain == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/dirichlet.pyx":611
 * 
 *         if self.c_dirichlet_domain == NULL:
 *             raise ValueError('The Dirichlet Domain was not computed.')             # <<<<<<<<<<<<<<
 * 
 *         words = []
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Dirichlet_Domain_was_not_com};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(10, 611, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":610
 *         cdef int* c_word
 * 
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dirichlet Domain was not computed.')
 * 
*/
  }

  /* "cython/core/dirichlet.pyx":613
 *             raise ValueError('The Dirichlet Domain was not computed.')
 * 
 *         words = []             # <<<<<<<<<<<<<<
 * 
 *         face = self.c_dirichlet_domain.face_list_begin.next
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_words = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":615
 *         words = []
 * 
 *         face = self.c_dirichlet_domain.face_list_begin.next             # <<<<<<<<<<<<<<
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             c_word = face.group_element_word
*/
  __pyx_t_6 = __pyx_v_self->c_dirichlet_domain->face_list_begin.next;
  __pyx_v_face = __pyx_t_6;

  /* "cython/core/dirichlet.pyx":616
 * 
 *         face = self.c_dirichlet_domain.face_list_begin.next
 *         while face != &self.c_dirichlet_domain.face_list_end:             # <<<<<<<<<<<<<<
 *             c_word = face.group_element_word
 * 
*/
  while (1) {
    __pyx_t_1 = (__pyx_v_face != (&__pyx_v_self->c_dirichlet_domain->face_list_end));
    if (!__pyx_t_1) break;

    /* "cython/core/dirichlet.pyx":617
 *         face = self.c_dirichlet_domain.face_list_begin.next
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             c_word = face.group_element_word             # <<<<<<<<<<<<<<
 * 
 *             if c_word == NULL:
*/
    __pyx_t_7 = __pyx_v_face->group_element_word;
    __pyx_v_c_word = __pyx_t_7;

    /* "cython/core/dirichlet.pyx":619
 *             c_word = face.group_element_word
 * 
 *             if c_word == NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The Dirichlet Domain was computed without '
 *                                  'include_words = True.')
*/
    __pyx_t_1 = (__pyx_v_c_word == NULL);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/dirichlet.pyx":620
 * 
 *             if c_word == NULL:
 *                 raise ValueError('The Dirichlet Domain was computed without '             # <<<<<<<<<<<<<<
 *                                  'include_words = True.')
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_3 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_Dirichlet_Domain_was_compute};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 620, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(10, 620, __pyx_L1_error)

      /* "cython/core/dirichlet.pyx":619
 *             c_word = face.group_element_word
 * 
 *             if c_word == NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The Dirichlet Domain was computed without '
 *                                  'include_words = True.')
*/
    }

    /* "cython/core/dirichlet.pyx":624
 * 
 *             words.append(
 *                 c_word_as_string(             # <<<<<<<<<<<<<<
 *                     c_word, self.c_num_generators, verbose_form = False))
 * 
*/
    __pyx_t_2 = __pyx_f_8SnapPyHP_c_word_as_string(__pyx_v_c_word, __pyx_v_self->c_num_generators, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/dirichlet.pyx":623
 *                                  'include_words = True.')
 * 
 *             words.append(             # <<<<<<<<<<<<<<
 *                 c_word_as_string(
 *                     c_word, self.c_num_generators, verbose_form = False))
*/
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_words, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(10, 623, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":627
 *                     c_word, self.c_num_generators, verbose_form = False))
 * 
 *             face = face.next             # <<<<<<<<<<<<<<
 * 
 *         return words
*/
    __pyx_t_6 = __pyx_v_face->next;
    __pyx_v_face = __pyx_t_6;
  }

  /* "cython/core/dirichlet.pyx":629
 *             face = face.next
 * 
 *         return words             # <<<<<<<<<<<<<<
 * 
 *     def _to_string(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_words);
  __pyx_r = __pyx_v_words;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":593
 *         return matrices
 * 
 *     def pairing_words(self):             # <<<<<<<<<<<<<<
 *         """
 *         Group elements which pair the faces of this DirichletDomain
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.pairing_words", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_words);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":631
 *         return words
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n' % len(matrices)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_53_to_string(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_53_to_string = {"_to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_53_to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_53_to_string(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("_to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_to_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_to_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_52_to_string(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self));

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

/* "cython/core/dirichlet.pyx":636
 *         for matrix in matrices:
 *             for row in matrix:
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)             # <<<<<<<<<<<<<<
 *             result += '\n'
 *         return result
*/

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_10_to_string_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_8_genexpr(__pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(10, 636, __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_8SnapPyHP_16CDirichletDomain_10_to_string_2generator5, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_to_string_locals_genexpr, __pyx_mstate_global->__pyx_n_u_SnapPyHP); if (unlikely(!gen)) __PYX_ERR(10, 636, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain._to_string.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8SnapPyHP_16CDirichletDomain_10_to_string_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_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(10, 636, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(10, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(10, 636, __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(10, 636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 636, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 636, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 636, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 636, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(10, 636, __pyx_L1_error)
          PyErr_Clear();
        }
        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_Unicode(__pyx_cur_scope->__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(10, 636, __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_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __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;
}

/* "cython/core/dirichlet.pyx":631
 *         return words
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n' % len(matrices)
*/

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_52_to_string(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_v_matrices = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_matrix = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_gb_8SnapPyHP_16CDirichletDomain_10_to_string_2generator5 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_string", 0);

  /* "cython/core/dirichlet.pyx":632
 * 
 *     def _to_string(self):
 *         matrices = self.pairing_matrices()             # <<<<<<<<<<<<<<
 *         result = '%% Generators\n%s\n' % len(matrices)
 *         for matrix in matrices:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pairing_matrices, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_matrices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":633
 *     def _to_string(self):
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n' % len(matrices)             # <<<<<<<<<<<<<<
 *         for matrix in matrices:
 *             for row in matrix:
*/
  __pyx_t_4 = PyObject_Length(__pyx_v_matrices); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(10, 633, __pyx_L1_error)
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Generators_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":634
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n' % len(matrices)
 *         for matrix in matrices:             # <<<<<<<<<<<<<<
 *             for row in matrix:
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)
*/
  if (likely(PyList_CheckExact(__pyx_v_matrices)) || PyTuple_CheckExact(__pyx_v_matrices)) {
    __pyx_t_2 = __pyx_v_matrices; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_matrices); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 634, __pyx_L1_error)
  }
  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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 634, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 634, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 634, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(10, 634, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_matrix, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":635
 *         result = '%% Generators\n%s\n' % len(matrices)
 *         for matrix in matrices:
 *             for row in matrix:             # <<<<<<<<<<<<<<
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)
 *             result += '\n'
*/
    if (likely(PyList_CheckExact(__pyx_v_matrix)) || PyTuple_CheckExact(__pyx_v_matrix)) {
      __pyx_t_1 = __pyx_v_matrix; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 635, __pyx_L1_error)
    }
    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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 635, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 635, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6));
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 635, __pyx_L1_error)
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(10, 635, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/dirichlet.pyx":636
 *         for matrix in matrices:
 *             for row in matrix:
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)             # <<<<<<<<<<<<<<
 *             result += '\n'
 *         return result
*/
      __pyx_t_8 = __pyx_pf_8SnapPyHP_16CDirichletDomain_10_to_string_genexpr(NULL, __pyx_v_row); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__9, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_s_2, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_result, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "cython/core/dirichlet.pyx":635
 *         result = '%% Generators\n%s\n' % len(matrices)
 *         for matrix in matrices:
 *             for row in matrix:             # <<<<<<<<<<<<<<
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)
 *             result += '\n'
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":637
 *             for row in matrix:
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)
 *             result += '\n'             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
    __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_result, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":634
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n' % len(matrices)
 *         for matrix in matrices:             # <<<<<<<<<<<<<<
 *             for row in matrix:
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":638
 *                 result += ' %s\n' % ' '.join(str(x) for x in row)
 *             result += '\n'
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __reduce_ex__(self, protocol):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":631
 *         return words
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n' % len(matrices)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain._to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matrices);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_gb_8SnapPyHP_16CDirichletDomain_10_to_string_2generator5);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":640
 *         return result
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_name))
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_55__reduce_ex__(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_55__reduce_ex__ = {"__reduce_ex__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_55__reduce_ex__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_55__reduce_ex__(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_protocol = 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("__reduce_ex__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_protocol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 640, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 640, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__reduce_ex__", 0) < 0) __PYX_ERR(10, 640, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__reduce_ex__", 1, 1, 1, i); __PYX_ERR(10, 640, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 640, __pyx_L3_error)
    }
    __pyx_v_protocol = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__reduce_ex__", 1, 1, 1, __pyx_nargs); __PYX_ERR(10, 640, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.__reduce_ex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_54__reduce_ex__(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self), __pyx_v_protocol);

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_54__reduce_ex__(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_ex__", 0);

  /* "cython/core/dirichlet.pyx":641
 * 
 *     def __reduce_ex__(self, protocol):
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_name))             # <<<<<<<<<<<<<<
 * 
 *     def save(self, filename):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_unpickle_dirichlet_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_string, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(10, 641, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(10, 641, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(10, 641, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(10, 641, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":640
 *         return result
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_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_5);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.__reduce_ex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":643
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_name))
 * 
 *     def save(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Save the Dirichlet domain as a text file in "% Generators" format.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_57save(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_8SnapPyHP_16CDirichletDomain_56save, "\n        Save the Dirichlet domain as a text file in \"% Generators\" format.\n\n        >>> from snappy.number import Number\n        >>> acc, Number._accuracy_for_testing = Number._accuracy_for_testing, None\n        >>> M = Manifold('m125')\n        >>> D = M.dirichlet_domain()\n        >>> from tempfile import NamedTemporaryFile\n        >>> f = NamedTemporaryFile(delete=False)\n        >>> f.close()\n        >>> D.save(f.name)\n        >>> E = DirichletDomain(generator_file=f.name); E\n        30 finite vertices, 2 ideal vertices; 50 edges; 20 faces\n        >>> os.unlink(f.name)\n        >>> from pickle import dumps, loads\n        >>> E = loads(dumps(D)); E\n        30 finite vertices, 2 ideal vertices; 50 edges; 20 faces\n        >>> Number._accuracy_for_testing = acc\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_57save = {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_57save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_56save};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_57save(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_filename = 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("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 643, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "save", 0) < 0) __PYX_ERR(10, 643, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("save", 1, 1, 1, i); __PYX_ERR(10, 643, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 643, __pyx_L3_error)
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save", 1, 1, 1, __pyx_nargs); __PYX_ERR(10, 643, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_56save(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self), __pyx_v_filename);

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_56save(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save", 0);

  /* "cython/core/dirichlet.pyx":663
 *         >>> Number._accuracy_for_testing = acc
 *         """
 *         with open(filename, mode='wb') as output:             # <<<<<<<<<<<<<<
 *             output.write(self._to_string().encode('ascii'))
 * 
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_open);
    __pyx_t_3 = __pyx_builtin_open; 
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_filename};
      __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_wb, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(10, 663, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 663, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 663, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_output = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "cython/core/dirichlet.pyx":664
 *         """
 *         with open(filename, mode='wb') as output:
 *             output.write(self._to_string().encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,
*/
          __pyx_t_1 = __pyx_v_output;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_11 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_4 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
            __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_string, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 664, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __pyx_t_5 = __pyx_t_10;
          __Pyx_INCREF(__pyx_t_5);
          __pyx_t_4 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ascii};
            __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 664, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __pyx_t_4 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 664, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "cython/core/dirichlet.pyx":663
 *         >>> Number._accuracy_for_testing = acc
 *         """
 *         with open(filename, mode='wb') as output:             # <<<<<<<<<<<<<<
 *             output.write(self._to_string().encode('ascii'))
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(10, 663, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_10 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 663, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 663, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_13 < 0) __PYX_ERR(10, 663, __pyx_L9_except_error)
          __pyx_t_14 = (!__pyx_t_13);
          if (unlikely(__pyx_t_14)) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1);
            __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_1 = 0; 
            __PYX_ERR(10, 663, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[23], NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "cython/core/dirichlet.pyx":643
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_name))
 * 
 *     def save(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Save the Dirichlet domain as a text file in "% Generators" format.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":666
 *             output.write(self._to_string().encode('ascii'))
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,             # <<<<<<<<<<<<<<
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_59export_stl(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_8SnapPyHP_16CDirichletDomain_58export_stl, "\n        Export the Dirichlet domain as an stl file suitable for 3d printing.\n\n        Arguments can be given to modify the model produced:\n\n        * model='klein' - (alt. 'poincare') the model of HH^3 to use.\n\n        * cutout=False - remove the interior of each face\n\n        * shrink_factor=0.9 - the fraction to cut out of each face\n\n        * cuttoff_radius=0.9 - maximum rescaling for projection into Poincare model\n\n        * num_subdivision=3 - number of times to subdivide for the Poincare model\n\n        For printing domains in the Poincare model, cutoff_radius is critical for avoiding\n        infinitely thin cusps, which cannot be printed.\n\n        This can take a long time for finely subdivided domains. So we call UI_callback\n        every so often if it is not None.\n\n        >>> D = Manifold('m004').dirichlet_domain()\n        >>> D.export_stl('fig-eight-klein.stl')     #doctest: +SKIP\n        >>> D.export_stl('fig-eight-poincare.stl', model='poincare')     #doctest: +SKIP\n        >>> D.export_stl('fig-eight-klein-wireframe.stl', cutout=True)     #doctest: +SKIP\n        >>> D.export_stl('fig-eight-poincare-wireframe.stl', model='poincare', cutout=True)     #doctest: +SKIP\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_16CDirichletDomain_59export_stl = {"export_stl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_59export_stl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_58export_stl};
static PyObject *__pyx_pw_8SnapPyHP_16CDirichletDomain_59export_stl(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_filename = 0;
  PyObject *__pyx_v_model = 0;
  PyObject *__pyx_v_cutout = 0;
  PyObject *__pyx_v_num_subdivisions = 0;
  PyObject *__pyx_v_shrink_factor = 0;
  PyObject *__pyx_v_cutoff_radius = 0;
  CYTHON_UNUSED PyObject *__pyx_v_callback = 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("export_stl (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_model,&__pyx_mstate_global->__pyx_n_u_cutout,&__pyx_mstate_global->__pyx_n_u_num_subdivisions,&__pyx_mstate_global->__pyx_n_u_shrink_factor,&__pyx_mstate_global->__pyx_n_u_cutoff_radius,&__pyx_mstate_global->__pyx_n_u_callback,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 666, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "export_stl", 0) < 0) __PYX_ERR(10, 666, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_klein));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_3));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_9));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_9));

      /* "cython/core/dirichlet.pyx":667
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):             # <<<<<<<<<<<<<<
 *         """
 *         Export the Dirichlet domain as an stl file suitable for 3d printing.
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("export_stl", 0, 1, 7, i); __PYX_ERR(10, 666, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 666, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_klein));

      /* "cython/core/dirichlet.pyx":666
 *             output.write(self._to_string().encode('ascii'))
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,             # <<<<<<<<<<<<<<
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_3));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_9));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_9));

      /* "cython/core/dirichlet.pyx":667
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):             # <<<<<<<<<<<<<<
 *         """
 *         Export the Dirichlet domain as an stl file suitable for 3d printing.
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_filename = values[0];
    __pyx_v_model = values[1];
    __pyx_v_cutout = values[2];
    __pyx_v_num_subdivisions = values[3];
    __pyx_v_shrink_factor = values[4];
    __pyx_v_cutoff_radius = values[5];
    __pyx_v_callback = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("export_stl", 0, 1, 7, __pyx_nargs); __PYX_ERR(10, 666, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.export_stl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16CDirichletDomain_58export_stl(((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)__pyx_v_self), __pyx_v_filename, __pyx_v_model, __pyx_v_cutout, __pyx_v_num_subdivisions, __pyx_v_shrink_factor, __pyx_v_cutoff_radius, __pyx_v_callback);

  /* "cython/core/dirichlet.pyx":666
 *             output.write(self._to_string().encode('ascii'))
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,             # <<<<<<<<<<<<<<
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):
 *         """
*/

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

static PyObject *__pyx_pf_8SnapPyHP_16CDirichletDomain_58export_stl(struct __pyx_obj_8SnapPyHP_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_model, PyObject *__pyx_v_cutout, PyObject *__pyx_v_num_subdivisions, PyObject *__pyx_v_shrink_factor, PyObject *__pyx_v_cutoff_radius, CYTHON_UNUSED PyObject *__pyx_v_callback) {
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_v_output_file = NULL;
  PyObject *__pyx_v_line = 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;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("export_stl", 0);

  /* "cython/core/dirichlet.pyx":695
 *         >>> D.export_stl('fig-eight-poincare-wireframe.stl', model='poincare', cutout=True)     #doctest: +SKIP
 *         """
 *         output = stl(self.face_list(), model, cutout, num_subdivisions, shrink_factor, cutoff_radius)             # <<<<<<<<<<<<<<
 *         with open(filename, 'w') as output_file:
 *             for line in output:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_stl); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_face_list, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_t_4, __pyx_v_model, __pyx_v_cutout, __pyx_v_num_subdivisions, __pyx_v_shrink_factor, __pyx_v_cutoff_radius};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (7-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_output = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":696
 *         """
 *         output = stl(self.face_list(), model, cutout, num_subdivisions, shrink_factor, cutoff_radius)
 *         with open(filename, 'w') as output_file:             # <<<<<<<<<<<<<<
 *             for line in output:
 *                 if UI_callback is not None:
*/
  /*with:*/ {
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_open);
    __pyx_t_4 = __pyx_builtin_open; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = NULL;
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 696, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 696, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          __pyx_v_output_file = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "cython/core/dirichlet.pyx":697
 *         output = stl(self.face_list(), model, cutout, num_subdivisions, shrink_factor, cutoff_radius)
 *         with open(filename, 'w') as output_file:
 *             for line in output:             # <<<<<<<<<<<<<<
 *                 if UI_callback is not None:
 *                     UI_callback()
*/
          if (likely(PyList_CheckExact(__pyx_v_output)) || PyTuple_CheckExact(__pyx_v_output)) {
            __pyx_t_2 = __pyx_v_output; __Pyx_INCREF(__pyx_t_2);
            __pyx_t_11 = 0;
            __pyx_t_12 = NULL;
          } else {
            __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 697, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 697, __pyx_L7_error)
          }
          for (;;) {
            if (likely(!__pyx_t_12)) {
              if (likely(PyList_CheckExact(__pyx_t_2))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 697, __pyx_L7_error)
                  #endif
                  if (__pyx_t_11 >= __pyx_temp) break;
                }
                __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_11);
                ++__pyx_t_11;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 697, __pyx_L7_error)
                  #endif
                  if (__pyx_t_11 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11));
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11);
                #endif
                ++__pyx_t_11;
              }
              if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 697, __pyx_L7_error)
            } else {
              __pyx_t_1 = __pyx_t_12(__pyx_t_2);
              if (unlikely(!__pyx_t_1)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(10, 697, __pyx_L7_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "cython/core/dirichlet.pyx":698
 *         with open(filename, 'w') as output_file:
 *             for line in output:
 *                 if UI_callback is not None:             # <<<<<<<<<<<<<<
 *                     UI_callback()
 *                 output_file.write(line)
*/
            __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 698, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_13 = (__pyx_t_1 != Py_None);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_13) {

              /* "cython/core/dirichlet.pyx":699
 *             for line in output:
 *                 if UI_callback is not None:
 *                     UI_callback()             # <<<<<<<<<<<<<<
 *                 output_file.write(line)
 * 
*/
              __pyx_t_4 = NULL;
              __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_UI_callback); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 699, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_6 = 1;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_3))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
                assert(__pyx_t_4);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
                __pyx_t_6 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 699, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_1);
              }
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

              /* "cython/core/dirichlet.pyx":698
 *         with open(filename, 'w') as output_file:
 *             for line in output:
 *                 if UI_callback is not None:             # <<<<<<<<<<<<<<
 *                     UI_callback()
 *                 output_file.write(line)
*/
            }

            /* "cython/core/dirichlet.pyx":700
 *                 if UI_callback is not None:
 *                     UI_callback()
 *                 output_file.write(line)             # <<<<<<<<<<<<<<
 * 
 * 
*/
            __pyx_t_3 = __pyx_v_output_file;
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_6 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_line};
              __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 700, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "cython/core/dirichlet.pyx":697
 *         output = stl(self.face_list(), model, cutout, num_subdivisions, shrink_factor, cutoff_radius)
 *         with open(filename, 'w') as output_file:
 *             for line in output:             # <<<<<<<<<<<<<<
 *                 if UI_callback is not None:
 *                     UI_callback()
*/
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "cython/core/dirichlet.pyx":696
 *         """
 *         output = stl(self.face_list(), model, cutout, num_subdivisions, shrink_factor, cutoff_radius)
 *         with open(filename, 'w') as output_file:             # <<<<<<<<<<<<<<
 *             for line in output:
 *                 if UI_callback is not None:
*/
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.export_stl", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(10, 696, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 696, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(10, 696, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_13 < 0) __PYX_ERR(10, 696, __pyx_L9_except_error)
          __pyx_t_15 = (!__pyx_t_13);
          if (unlikely(__pyx_t_15)) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3);
            __pyx_t_2 = 0;  __pyx_t_1 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(10, 696, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[23], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 696, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L20;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "cython/core/dirichlet.pyx":666
 *             output.write(self._to_string().encode('ascii'))
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,             # <<<<<<<<<<<<<<
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):
 *         """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CDirichletDomain.export_stl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_output_file);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":742
 * 
 * 
 * def _unpickle_dirichlet_domain(string, name):             # <<<<<<<<<<<<<<
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=name)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_45_unpickle_dirichlet_domain(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_8SnapPyHP_45_unpickle_dirichlet_domain = {"_unpickle_dirichlet_domain", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_45_unpickle_dirichlet_domain, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_45_unpickle_dirichlet_domain(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_string = 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[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_unpickle_dirichlet_domain (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_string,&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(10, 742, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_unpickle_dirichlet_domain", 0) < 0) __PYX_ERR(10, 742, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_unpickle_dirichlet_domain", 1, 2, 2, i); __PYX_ERR(10, 742, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 742, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(10, 742, __pyx_L3_error)
    }
    __pyx_v_string = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_unpickle_dirichlet_domain", 1, 2, 2, __pyx_nargs); __PYX_ERR(10, 742, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP._unpickle_dirichlet_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_44_unpickle_dirichlet_domain(__pyx_self, __pyx_v_string, __pyx_v_name);

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

static PyObject *__pyx_pf_8SnapPyHP_44_unpickle_dirichlet_domain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unpickle_dirichlet_domain", 0);

  /* "cython/core/dirichlet.pyx":743
 * 
 * def _unpickle_dirichlet_domain(string, name):
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=name)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_DirichletDomain); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __pyx_v_string;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ascii};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_generator_bytes, __pyx_t_4, __pyx_t_5, __pyx_callargs+1, 0) < 0) __PYX_ERR(10, 743, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_manifold_name, __pyx_v_name, __pyx_t_5, __pyx_callargs+1, 1) < 0) __PYX_ERR(10, 743, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":742
 * 
 * 
 * def _unpickle_dirichlet_domain(string, name):             # <<<<<<<<<<<<<<
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=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_5);
  __Pyx_AddTraceback("SnapPyHP._unpickle_dirichlet_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":9
 *     cdef original_indices
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_1_number_(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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_1_number_ = {"_number_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_1_number_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_1_number_(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_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("_number_ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 9, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_number_", 0) < 0) __PYX_ERR(11, 9, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, i); __PYX_ERR(11, 9, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 9, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 9, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood._number_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood__number_(__pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood__number_(PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/cusp_neighborhoods.pyx":11
 *     @staticmethod
 *     def _number_(n):
 *         return number.number_to_native_number(n)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Manifold manifold):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_number_to_native_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_n};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 11, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":9
 *     cdef original_indices
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/

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

/* "cython/core/cusp_neighborhoods.pyx":13
 *         return number.number_to_native_number(n)
 * 
 *     def __cinit__(self, Manifold manifold):             # <<<<<<<<<<<<<<
 *         if manifold.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/

/* Python wrapper */
static int __pyx_pw_8SnapPyHP_17CCuspNeighborhood_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8SnapPyHP_17CCuspNeighborhood_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_manifold = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_manifold,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 13, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(11, 13, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(11, 13, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 13, __pyx_L3_error)
    }
    __pyx_v_manifold = ((struct __pyx_obj_8SnapPyHP_Manifold *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 13, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_manifold), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, 1, "manifold", 0))) __PYX_ERR(11, 13, __pyx_L1_error)
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_2__cinit__(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_manifold);

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

static int __pyx_pf_8SnapPyHP_17CCuspNeighborhood_2__cinit__(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_manifold) {
  PyObject *__pyx_v_is_complete = NULL;
  PyObject *__pyx_9genexpr92__pyx_v_n = NULL;
  PyObject *__pyx_9genexpr92__pyx_v_c = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  struct CuspNeighborhoods *__pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cython/core/cusp_neighborhoods.pyx":14
 * 
 *     def __cinit__(self, Manifold manifold):
 *         if manifold.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         is_complete = manifold.cusp_info('is_complete')
*/
  __pyx_t_1 = (__pyx_v_manifold->__pyx_base.c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/cusp_neighborhoods.pyx":15
 *     def __cinit__(self, Manifold manifold):
 *         if manifold.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         is_complete = manifold.cusp_info('is_complete')
 *         self.original_indices = [n for n, c in enumerate(is_complete) if c]
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_Triangulation_is_empty};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(11, 15, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":14
 * 
 *     def __cinit__(self, Manifold manifold):
 *         if manifold.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         is_complete = manifold.cusp_info('is_complete')
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":16
 *         if manifold.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         is_complete = manifold.cusp_info('is_complete')             # <<<<<<<<<<<<<<
 *         self.original_indices = [n for n, c in enumerate(is_complete) if c]
 *         copy_triangulation(manifold.c_triangulation,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_manifold);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_complete};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_is_complete = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":17
 *             raise ValueError('The Triangulation is empty.')
 *         is_complete = manifold.cusp_info('is_complete')
 *         self.original_indices = [n for n, c in enumerate(is_complete) if c]             # <<<<<<<<<<<<<<
 *         copy_triangulation(manifold.c_triangulation,
 *                            &self.c_triangulation)
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 17, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_4 = __pyx_mstate_global->__pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_is_complete)) || PyTuple_CheckExact(__pyx_v_is_complete)) {
      __pyx_t_3 = __pyx_v_is_complete; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_is_complete); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 17, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 17, __pyx_L6_error)
    }
    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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 17, __pyx_L6_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 17, __pyx_L6_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6));
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 17, __pyx_L6_error)
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(11, 17, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_9genexpr92__pyx_v_c, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr92__pyx_v_n, __pyx_t_4);
      __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 17, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_9genexpr92__pyx_v_c); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 17, __pyx_L6_error)
      if (__pyx_t_1) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr92__pyx_v_n))) __PYX_ERR(11, 17, __pyx_L6_error)
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_c); __pyx_9genexpr92__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_n); __pyx_9genexpr92__pyx_v_n = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_c); __pyx_9genexpr92__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_n); __pyx_9genexpr92__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->original_indices);
  __Pyx_DECREF(__pyx_v_self->original_indices);
  __pyx_v_self->original_indices = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":18
 *         is_complete = manifold.cusp_info('is_complete')
 *         self.original_indices = [n for n, c in enumerate(is_complete) if c]
 *         copy_triangulation(manifold.c_triangulation,             # <<<<<<<<<<<<<<
 *                            &self.c_triangulation)
 *         self.c_cusp_neighborhood = initialize_cusp_neighborhoods(
*/
  copy_triangulation(__pyx_v_manifold->__pyx_base.c_triangulation, (&__pyx_v_self->c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 18, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":20
 *         copy_triangulation(manifold.c_triangulation,
 *                            &self.c_triangulation)
 *         self.c_cusp_neighborhood = initialize_cusp_neighborhoods(             # <<<<<<<<<<<<<<
 *             self.c_triangulation)
 *         if self.c_cusp_neighborhood == NULL:
*/
  __pyx_t_9 = initialize_cusp_neighborhoods(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 20, __pyx_L1_error)
  __pyx_v_self->c_cusp_neighborhood = __pyx_t_9;

  /* "cython/core/cusp_neighborhoods.pyx":22
 *         self.c_cusp_neighborhood = initialize_cusp_neighborhoods(
 *             self.c_triangulation)
 *         if self.c_cusp_neighborhood == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The cusp neighborhood construction failed.')
 *         self.manifold_name = manifold.name()
*/
  __pyx_t_1 = (__pyx_v_self->c_cusp_neighborhood == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/cusp_neighborhoods.pyx":23
 *             self.c_triangulation)
 *         if self.c_cusp_neighborhood == NULL:
 *             raise RuntimeError('The cusp neighborhood construction failed.')             # <<<<<<<<<<<<<<
 *         self.manifold_name = manifold.name()
 *         self._num_cusps = get_num_cusp_neighborhoods(self.c_cusp_neighborhood)
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_The_cusp_neighborhood_constructi};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(11, 23, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":22
 *         self.c_cusp_neighborhood = initialize_cusp_neighborhoods(
 *             self.c_triangulation)
 *         if self.c_cusp_neighborhood == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The cusp neighborhood construction failed.')
 *         self.manifold_name = manifold.name()
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":24
 *         if self.c_cusp_neighborhood == NULL:
 *             raise RuntimeError('The cusp neighborhood construction failed.')
 *         self.manifold_name = manifold.name()             # <<<<<<<<<<<<<<
 *         self._num_cusps = get_num_cusp_neighborhoods(self.c_cusp_neighborhood)
 *         self._number_ = manifold._number_
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_manifold);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name, __pyx_t_2) < 0) __PYX_ERR(11, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":25
 *             raise RuntimeError('The cusp neighborhood construction failed.')
 *         self.manifold_name = manifold.name()
 *         self._num_cusps = get_num_cusp_neighborhoods(self.c_cusp_neighborhood)             # <<<<<<<<<<<<<<
 *         self._number_ = manifold._number_
 * 
*/
  __pyx_t_10 = get_num_cusp_neighborhoods(__pyx_v_self->c_cusp_neighborhood); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 25, __pyx_L1_error)
  __pyx_v_self->_num_cusps = __pyx_t_10;

  /* "cython/core/cusp_neighborhoods.pyx":26
 *         self.manifold_name = manifold.name()
 *         self._num_cusps = get_num_cusp_neighborhoods(self.c_cusp_neighborhood)
 *         self._number_ = manifold._number_             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_manifold), __pyx_mstate_global->__pyx_n_u_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_2) < 0) __PYX_ERR(11, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":13
 *         return number.number_to_native_number(n)
 * 
 *     def __cinit__(self, Manifold manifold):             # <<<<<<<<<<<<<<
 *         if manifold.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_is_complete);
  __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_n);
  __Pyx_XDECREF(__pyx_9genexpr92__pyx_v_c);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":28
 *         self._number_ = manifold._number_
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/

/* Python wrapper */
static void __pyx_pw_8SnapPyHP_17CCuspNeighborhood_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8SnapPyHP_17CCuspNeighborhood_5__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_8SnapPyHP_17CCuspNeighborhood_4__dealloc__(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self));

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

static void __pyx_pf_8SnapPyHP_17CCuspNeighborhood_4__dealloc__(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cython/core/cusp_neighborhoods.pyx":29
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         if self.c_cusp_neighborhood != NULL:
*/
  __pyx_t_1 = (__pyx_v_self->c_triangulation != NULL);
  if (__pyx_t_1) {

    /* "cython/core/cusp_neighborhoods.pyx":30
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if self.c_cusp_neighborhood != NULL:
 *             free_cusp_neighborhoods(self.c_cusp_neighborhood)
*/
    free_triangulation(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 30, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":29
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         if self.c_cusp_neighborhood != NULL:
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":31
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
 *         if self.c_cusp_neighborhood != NULL:             # <<<<<<<<<<<<<<
 *             free_cusp_neighborhoods(self.c_cusp_neighborhood)
 * 
*/
  __pyx_t_1 = (__pyx_v_self->c_cusp_neighborhood != NULL);
  if (__pyx_t_1) {

    /* "cython/core/cusp_neighborhoods.pyx":32
 *             free_triangulation(self.c_triangulation)
 *         if self.c_cusp_neighborhood != NULL:
 *             free_cusp_neighborhoods(self.c_cusp_neighborhood)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
    free_cusp_neighborhoods(__pyx_v_self->c_cusp_neighborhood); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 32, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":31
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
 *         if self.c_cusp_neighborhood != NULL:             # <<<<<<<<<<<<<<
 *             free_cusp_neighborhoods(self.c_cusp_neighborhood)
 * 
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":28
 *         self._number_ = manifold._number_
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("SnapPyHP.CCuspNeighborhood.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
}

/* "cython/core/cusp_neighborhoods.pyx":34
 *             free_cusp_neighborhoods(self.c_cusp_neighborhood)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         N = self._num_cusps
 *         return 'Cusp Neighborhood with %d cusp%s' % (
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_7__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_8SnapPyHP_17CCuspNeighborhood_6__repr__(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self));

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

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

  /* "cython/core/cusp_neighborhoods.pyx":35
 * 
 *     def __repr__(self):
 *         N = self._num_cusps             # <<<<<<<<<<<<<<
 *         return 'Cusp Neighborhood with %d cusp%s' % (
 *             N, N != 1 and 's' or '')
*/
  __pyx_t_1 = __pyx_v_self->_num_cusps;
  __pyx_v_N = __pyx_t_1;

  /* "cython/core/cusp_neighborhoods.pyx":36
 *     def __repr__(self):
 *         N = self._num_cusps
 *         return 'Cusp Neighborhood with %d cusp%s' % (             # <<<<<<<<<<<<<<
 *             N, N != 1 and 's' or '')
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/cusp_neighborhoods.pyx":37
 *         N = self._num_cusps
 *         return 'Cusp Neighborhood with %d cusp%s' % (
 *             N, N != 1 and 's' or '')             # <<<<<<<<<<<<<<
 * 
 *     def manifold(self):
*/
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_N, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__pyx_v_N != 1);
  if (!__pyx_t_4) {
    goto __pyx_L4_next_or;
  } else {
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_mstate_global->__pyx_n_u_s); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(11, 37, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_s);
    __pyx_t_3 = __pyx_mstate_global->__pyx_n_u_s;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_L4_next_or:;
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10);
  __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u__10;
  __pyx_L3_bool_binop_done:;
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cusp_Neighborhood_with;
  __pyx_t_6[1] = __pyx_t_2;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_cusp;
  __pyx_t_6[3] = __pyx_t_5;

  /* "cython/core/cusp_neighborhoods.pyx":36
 *     def __repr__(self):
 *         N = self._num_cusps
 *         return 'Cusp Neighborhood with %d cusp%s' % (             # <<<<<<<<<<<<<<
 *             N, N != 1 and 's' or '')
 * 
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":34
 *             free_cusp_neighborhoods(self.c_cusp_neighborhood)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         N = self._num_cusps
 *         return 'Cusp Neighborhood with %d cusp%s' % (
*/

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

/* "cython/core/cusp_neighborhoods.pyx":39
 *             N, N != 1 and 's' or '')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Manifold built from the current canonical triangulation.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_9manifold(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_8SnapPyHP_17CCuspNeighborhood_8manifold, "\n        Return a Manifold built from the current canonical triangulation.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_9manifold = {"manifold", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_9manifold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_8manifold};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_9manifold(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("manifold (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("manifold", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("manifold", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_8manifold(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_8manifold(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_M = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("manifold", 0);

  /* "cython/core/cusp_neighborhoods.pyx":46
 *         cdef Manifold M
 * 
 *         copy_triangulation(self.c_cusp_neighborhood.its_triangulation,             # <<<<<<<<<<<<<<
 *                            &c_triangulation)
 *         M = _manifold_class('empty')
*/
  copy_triangulation(__pyx_v_self->c_cusp_neighborhood->its_triangulation, (&__pyx_v_c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 46, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":48
 *         copy_triangulation(self.c_cusp_neighborhood.its_triangulation,
 *                            &c_triangulation)
 *         M = _manifold_class('empty')             # <<<<<<<<<<<<<<
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name + '_canonical')
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_empty};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(11, 48, __pyx_L1_error)
  __pyx_v_M = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":49
 *                            &c_triangulation)
 *         M = _manifold_class('empty')
 *         M.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         M.set_name(self.manifold_name + '_canonical')
 *         return M
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_M->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_M), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":50
 *         M = _manifold_class('empty')
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name + '_canonical')             # <<<<<<<<<<<<<<
 *         return M
 * 
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_M);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_canonical); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":51
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name + '_canonical')
 *         return M             # <<<<<<<<<<<<<<
 * 
 *     def original_index(self, which_cusp):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_M);
  __pyx_r = ((PyObject *)__pyx_v_M);
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":39
 *             N, N != 1 and 's' or '')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Manifold built from the current canonical triangulation.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.manifold", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_M);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":53
 *         return M
 * 
 *     def original_index(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the index by which the Manifold identifies this cusp.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_11original_index(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_8SnapPyHP_17CCuspNeighborhood_10original_index, "\n        Returns the index by which the Manifold identifies this cusp.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_11original_index = {"original_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_11original_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_10original_index};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_11original_index(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_which_cusp = 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("original_index (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 53, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "original_index", 0) < 0) __PYX_ERR(11, 53, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("original_index", 1, 1, 1, i); __PYX_ERR(11, 53, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 53, __pyx_L3_error)
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("original_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 53, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.original_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_10original_index(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_10original_index(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  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("original_index", 0);

  /* "cython/core/cusp_neighborhoods.pyx":57
 *         Returns the index by which the Manifold identifies this cusp.
 *         """
 *         return self.original_indices[which_cusp]             # <<<<<<<<<<<<<<
 * 
 *     def check_index(self, which_cusp):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->original_indices, __pyx_v_which_cusp); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":53
 *         return M
 * 
 *     def original_index(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the index by which the Manifold identifies this cusp.
*/

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

/* "cython/core/cusp_neighborhoods.pyx":59
 *         return self.original_indices[which_cusp]
 * 
 *     def check_index(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Raises an IndexError if the cusp index is invalid.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_13check_index(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_8SnapPyHP_17CCuspNeighborhood_12check_index, "\n        Raises an IndexError if the cusp index is invalid.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_13check_index = {"check_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_13check_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_12check_index};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_13check_index(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_which_cusp = 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("check_index (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 59, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 59, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "check_index", 0) < 0) __PYX_ERR(11, 59, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("check_index", 1, 1, 1, i); __PYX_ERR(11, 59, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 59, __pyx_L3_error)
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 59, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.check_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_12check_index(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_12check_index(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_index", 0);

  /* "cython/core/cusp_neighborhoods.pyx":63
 *         Raises an IndexError if the cusp index is invalid.
 *         """
 *         N = int(which_cusp)             # <<<<<<<<<<<<<<
 *         if 0 <= N < self._num_cusps:
 *             return N
*/
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_which_cusp); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_N = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":64
 *         """
 *         N = int(which_cusp)
 *         if 0 <= N < self._num_cusps:             # <<<<<<<<<<<<<<
 *             return N
 *         else:
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_N, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 64, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->_num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_N, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 64, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(11, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_3)) {

    /* "cython/core/cusp_neighborhoods.pyx":65
 *         N = int(which_cusp)
 *         if 0 <= N < self._num_cusps:
 *             return N             # <<<<<<<<<<<<<<
 *         else:
 *             raise IndexError('The specified cusp (%s) does not '
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_N);
    __pyx_r = __pyx_v_N;
    goto __pyx_L0;

    /* "cython/core/cusp_neighborhoods.pyx":64
 *         """
 *         N = int(which_cusp)
 *         if 0 <= N < self._num_cusps:             # <<<<<<<<<<<<<<
 *             return N
 *         else:
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":67
 *             return N
 *         else:
 *             raise IndexError('The specified cusp (%s) does not '             # <<<<<<<<<<<<<<
 *                              'exist.' % which_cusp)
 * 
*/
  /*else*/ {
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_IndexError);
    __pyx_t_4 = __pyx_builtin_IndexError; 

    /* "cython/core/cusp_neighborhoods.pyx":68
 *         else:
 *             raise IndexError('The specified cusp (%s) does not '
 *                              'exist.' % which_cusp)             # <<<<<<<<<<<<<<
 * 
 *     def num_cusps(self):
*/
    __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_The_specified_cusp_s_does_not_ex, __pyx_v_which_cusp); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 67, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(11, 67, __pyx_L1_error)
  }

  /* "cython/core/cusp_neighborhoods.pyx":59
 *         return self.original_indices[which_cusp]
 * 
 *     def check_index(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Raises an IndexError if the cusp index is invalid.
*/

  /* 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_AddTraceback("SnapPyHP.CCuspNeighborhood.check_index", __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;
}

/* "cython/core/cusp_neighborhoods.pyx":70
 *                              'exist.' % which_cusp)
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of cusps.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_15num_cusps(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_8SnapPyHP_17CCuspNeighborhood_14num_cusps, "\n        Return the number of cusps.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_15num_cusps = {"num_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_15num_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_14num_cusps};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_15num_cusps(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("num_cusps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_cusps", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_cusps", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_14num_cusps(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_14num_cusps(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__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("num_cusps", 0);

  /* "cython/core/cusp_neighborhoods.pyx":74
 *         Return the number of cusps.
 *         """
 *         return self._num_cusps             # <<<<<<<<<<<<<<
 * 
 *     def topology(self, which_cusp = 0):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->_num_cusps); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":70
 *                              'exist.' % which_cusp)
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of cusps.
*/

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

/* "cython/core/cusp_neighborhoods.pyx":76
 *         return self._num_cusps
 * 
 *     def topology(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the topological type of the specified cusp.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_17topology(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_8SnapPyHP_17CCuspNeighborhood_16topology, "\n        Return the topological type of the specified cusp.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_17topology = {"topology", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_17topology, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_16topology};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_17topology(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_which_cusp = 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("topology (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 76, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "topology", 0) < 0) __PYX_ERR(11, 76, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("topology", 0, 0, 1, __pyx_nargs); __PYX_ERR(11, 76, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.topology", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_16topology(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_16topology(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  CuspTopology __pyx_v_topology;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  CuspTopology __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("topology", 0);

  /* "cython/core/cusp_neighborhoods.pyx":80
 *         Return the topological type of the specified cusp.
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         topology = get_cusp_neighborhood_topology(self.c_cusp_neighborhood, N)
 *         return CuspTopology[topology]
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":81
 *         """
 *         N = self.check_index(which_cusp)
 *         topology = get_cusp_neighborhood_topology(self.c_cusp_neighborhood, N)             # <<<<<<<<<<<<<<
 *         return CuspTopology[topology]
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 81, __pyx_L1_error)
  __pyx_t_5 = get_cusp_neighborhood_topology(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 81, __pyx_L1_error)
  __pyx_v_topology = __pyx_t_5;

  /* "cython/core/cusp_neighborhoods.pyx":82
 *         N = self.check_index(which_cusp)
 *         topology = get_cusp_neighborhood_topology(self.c_cusp_neighborhood, N)
 *         return CuspTopology[topology]             # <<<<<<<<<<<<<<
 * 
 *     def get_displacement(self, which_cusp = 0):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_CuspTopology); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_CuspTopology(__pyx_v_topology); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":76
 *         return self._num_cusps
 * 
 *     def topology(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the topological type of the specified cusp.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.topology", __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;
}

/* "cython/core/cusp_neighborhoods.pyx":84
 *         return CuspTopology[topology]
 * 
 *     def get_displacement(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement of the horospherical boundary of the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_19get_displacement(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_8SnapPyHP_17CCuspNeighborhood_18get_displacement, "\n        Return the displacement of the horospherical boundary of the\n        specified cusp. The displacement is the hyperbolic distance\n        that the horospherical boundary has been displaced from its\n        \"home\" position, at which the area of the boundary is\n        3sqrt(3)/8.  (The translates of all of the horospheres are\n        guaranteed to be pairwise disjoint when each cusp has\n        displacement 0.)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_19get_displacement = {"get_displacement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_19get_displacement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_18get_displacement};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_19get_displacement(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_which_cusp = 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_displacement (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 84, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 84, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_displacement", 0) < 0) __PYX_ERR(11, 84, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 84, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_displacement", 0, 0, 1, __pyx_nargs); __PYX_ERR(11, 84, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.get_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_18get_displacement(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_18get_displacement(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_disp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __pyx_t_8SnapPyHP_Real __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_displacement", 0);

  /* "cython/core/cusp_neighborhoods.pyx":94
 *         displacement 0.)
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         disp = Number(Real2gen(get_cusp_neighborhood_displacement(
 *             self.c_cusp_neighborhood, N)))
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":95
 *         """
 *         N = self.check_index(which_cusp)
 *         disp = Number(Real2gen(get_cusp_neighborhood_displacement(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/cusp_neighborhoods.pyx":96
 *         N = self.check_index(which_cusp)
 *         disp = Number(Real2gen(get_cusp_neighborhood_displacement(
 *             self.c_cusp_neighborhood, N)))             # <<<<<<<<<<<<<<
 *         return self._number_(disp)
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 96, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":95
 *         """
 *         N = self.check_index(which_cusp)
 *         disp = Number(Real2gen(get_cusp_neighborhood_displacement(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)
*/
  __pyx_t_6 = get_cusp_neighborhood_displacement(__pyx_v_self->c_cusp_neighborhood, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 95, __pyx_L1_error)
  __pyx_t_7 = __pyx_v_8SnapPyHP_Real2gen(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_disp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":97
 *         disp = Number(Real2gen(get_cusp_neighborhood_displacement(
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)             # <<<<<<<<<<<<<<
 * 
 *     def set_displacement(self, new_displacement, which_cusp=0):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_disp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":84
 *         return CuspTopology[topology]
 * 
 *     def get_displacement(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement of the horospherical boundary of the
*/

  /* 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("SnapPyHP.CCuspNeighborhood.get_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":99
 *         return self._number_(disp)
 * 
 *     def set_displacement(self, new_displacement, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Set the displacement of the specified cusp.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_21set_displacement(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_8SnapPyHP_17CCuspNeighborhood_20set_displacement, "\n        Set the displacement of the specified cusp.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_21set_displacement = {"set_displacement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_21set_displacement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_20set_displacement};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_21set_displacement(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_new_displacement = 0;
  PyObject *__pyx_v_which_cusp = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_displacement (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_new_displacement,&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 99, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 99, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 99, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_displacement", 0) < 0) __PYX_ERR(11, 99, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_displacement", 0, 1, 2, i); __PYX_ERR(11, 99, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 99, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 99, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_new_displacement = values[0];
    __pyx_v_which_cusp = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_displacement", 0, 1, 2, __pyx_nargs); __PYX_ERR(11, 99, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.set_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_20set_displacement(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_new_displacement, __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_20set_displacement(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_new_displacement, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_8SnapPyHP_Real __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_displacement", 0);

  /* "cython/core/cusp_neighborhoods.pyx":103
 *         Set the displacement of the specified cusp.
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         set_cusp_neighborhood_displacement(self.c_cusp_neighborhood,
 *                                            N, Object2Real(new_displacement))
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":105
 *         N = self.check_index(which_cusp)
 *         set_cusp_neighborhood_displacement(self.c_cusp_neighborhood,
 *                                            N, Object2Real(new_displacement))             # <<<<<<<<<<<<<<
 * 
 *     def stopping_displacement(self, which_cusp=0):
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 105, __pyx_L1_error)
  __pyx_t_5 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_new_displacement); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 105, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":104
 *         """
 *         N = self.check_index(which_cusp)
 *         set_cusp_neighborhood_displacement(self.c_cusp_neighborhood,             # <<<<<<<<<<<<<<
 *                                            N, Object2Real(new_displacement))
 * 
*/
  set_cusp_neighborhood_displacement(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 104, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":99
 *         return self._number_(disp)
 * 
 *     def set_displacement(self, new_displacement, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Set the displacement of the specified cusp.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.set_displacement", __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;
}

/* "cython/core/cusp_neighborhoods.pyx":107
 *                                            N, Object2Real(new_displacement))
 * 
 *     def stopping_displacement(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement at which the specified cusp
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_23stopping_displacement(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_8SnapPyHP_17CCuspNeighborhood_22stopping_displacement, "\n        Return the displacement at which the specified cusp\n        neighborhood bumps into itself or another cusp neighborhood.\n        (Assumes the other displacements are fixed.)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_23stopping_displacement = {"stopping_displacement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_23stopping_displacement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_22stopping_displacement};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_23stopping_displacement(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_which_cusp = 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("stopping_displacement (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 107, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "stopping_displacement", 0) < 0) __PYX_ERR(11, 107, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stopping_displacement", 0, 0, 1, __pyx_nargs); __PYX_ERR(11, 107, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.stopping_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_22stopping_displacement(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_22stopping_displacement(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_disp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __pyx_t_8SnapPyHP_Real __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stopping_displacement", 0);

  /* "cython/core/cusp_neighborhoods.pyx":113
 *         (Assumes the other displacements are fixed.)
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         disp = Number(Real2gen(get_cusp_neighborhood_stopping_displacement(
 *             self.c_cusp_neighborhood, N)))
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":114
 *         """
 *         N = self.check_index(which_cusp)
 *         disp = Number(Real2gen(get_cusp_neighborhood_stopping_displacement(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/cusp_neighborhoods.pyx":115
 *         N = self.check_index(which_cusp)
 *         disp = Number(Real2gen(get_cusp_neighborhood_stopping_displacement(
 *             self.c_cusp_neighborhood, N)))             # <<<<<<<<<<<<<<
 *         return self._number_(disp)
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 115, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":114
 *         """
 *         N = self.check_index(which_cusp)
 *         disp = Number(Real2gen(get_cusp_neighborhood_stopping_displacement(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)
*/
  __pyx_t_6 = get_cusp_neighborhood_stopping_displacement(__pyx_v_self->c_cusp_neighborhood, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 114, __pyx_L1_error)
  __pyx_t_7 = __pyx_v_8SnapPyHP_Real2gen(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_disp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":116
 *         disp = Number(Real2gen(get_cusp_neighborhood_stopping_displacement(
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)             # <<<<<<<<<<<<<<
 * 
 *     def stopper(self, which_cusp):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_disp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":107
 *                                            N, Object2Real(new_displacement))
 * 
 *     def stopping_displacement(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement at which the specified cusp
*/

  /* 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("SnapPyHP.CCuspNeighborhood.stopping_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":118
 *         return self._number_(disp)
 * 
 *     def stopper(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Return the index of the cusp which will be the first one that
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_25stopper(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_8SnapPyHP_17CCuspNeighborhood_24stopper, "\n        Return the index of the cusp which will be the first one that\n        the specified cusp neighborhood bumps into.\n        (Assumes the other displacements are fixed.)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_25stopper = {"stopper", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_25stopper, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_24stopper};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_25stopper(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_which_cusp = 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("stopper (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 118, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "stopper", 0) < 0) __PYX_ERR(11, 118, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("stopper", 1, 1, 1, i); __PYX_ERR(11, 118, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 118, __pyx_L3_error)
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stopper", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 118, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.stopper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_24stopper(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_24stopper(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stopper", 0);

  /* "cython/core/cusp_neighborhoods.pyx":124
 *         (Assumes the other displacements are fixed.)
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         return get_cusp_neighborhood_stopper_cusp_index(
 *             self.c_cusp_neighborhood, N)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":125
 *         """
 *         N = self.check_index(which_cusp)
 *         return get_cusp_neighborhood_stopper_cusp_index(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/cusp_neighborhoods.pyx":126
 *         N = self.check_index(which_cusp)
 *         return get_cusp_neighborhood_stopper_cusp_index(
 *             self.c_cusp_neighborhood, N)             # <<<<<<<<<<<<<<
 * 
 *     def reach(self, which_cusp=0):
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 126, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":125
 *         """
 *         N = self.check_index(which_cusp)
 *         return get_cusp_neighborhood_stopper_cusp_index(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)
 * 
*/
  __pyx_t_5 = get_cusp_neighborhood_stopper_cusp_index(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 125, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":118
 *         return self._number_(disp)
 * 
 *     def stopper(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Return the index of the cusp which will be the first one that
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.stopper", __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;
}

/* "cython/core/cusp_neighborhoods.pyx":128
 *             self.c_cusp_neighborhood, N)
 * 
 *     def reach(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement at which the specified cusp
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_27reach(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_8SnapPyHP_17CCuspNeighborhood_26reach, "\n        Return the displacement at which the specified cusp\n        neighborhood bumps into itself.  (This is twice the\n        distance between nearest horoball lifts.)\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_27reach = {"reach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_27reach, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_26reach};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_27reach(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_which_cusp = 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("reach (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 128, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reach", 0) < 0) __PYX_ERR(11, 128, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reach", 0, 0, 1, __pyx_nargs); __PYX_ERR(11, 128, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.reach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_26reach(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_26reach(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_reach = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __pyx_t_8SnapPyHP_Real __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reach", 0);

  /* "cython/core/cusp_neighborhoods.pyx":134
 *         distance between nearest horoball lifts.)
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         reach = Number(Real2gen(get_cusp_neighborhood_reach(
 *             self.c_cusp_neighborhood, N)))
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":135
 *         """
 *         N = self.check_index(which_cusp)
 *         reach = Number(Real2gen(get_cusp_neighborhood_reach(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(reach)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/cusp_neighborhoods.pyx":136
 *         N = self.check_index(which_cusp)
 *         reach = Number(Real2gen(get_cusp_neighborhood_reach(
 *             self.c_cusp_neighborhood, N)))             # <<<<<<<<<<<<<<
 *         return self._number_(reach)
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 136, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":135
 *         """
 *         N = self.check_index(which_cusp)
 *         reach = Number(Real2gen(get_cusp_neighborhood_reach(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(reach)
*/
  __pyx_t_6 = get_cusp_neighborhood_reach(__pyx_v_self->c_cusp_neighborhood, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 135, __pyx_L1_error)
  __pyx_t_7 = __pyx_v_8SnapPyHP_Real2gen(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_reach = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":137
 *         reach = Number(Real2gen(get_cusp_neighborhood_reach(
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(reach)             # <<<<<<<<<<<<<<
 * 
 *     def max_reach(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_reach};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":128
 *             self.c_cusp_neighborhood, N)
 * 
 *     def reach(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement at which the specified cusp
*/

  /* 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("SnapPyHP.CCuspNeighborhood.reach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_reach);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":139
 *         return self._number_(reach)
 * 
 *     def max_reach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the maximum reach over all cusps.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_29max_reach(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_8SnapPyHP_17CCuspNeighborhood_28max_reach, "\n        Return the maximum reach over all cusps.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_29max_reach = {"max_reach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_29max_reach, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_28max_reach};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_29max_reach(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("max_reach (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("max_reach", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("max_reach", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_28max_reach(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_28max_reach(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self) {
  PyObject *__pyx_v_reach = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_8SnapPyHP_Real __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("max_reach", 0);

  /* "cython/core/cusp_neighborhoods.pyx":143
 *         Return the maximum reach over all cusps.
 *         """
 *         reach = Number(Real2gen(get_cusp_neighborhood_max_reach(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood)))
 *         return self._number_(reach)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/cusp_neighborhoods.pyx":144
 *         """
 *         reach = Number(Real2gen(get_cusp_neighborhood_max_reach(
 *             self.c_cusp_neighborhood)))             # <<<<<<<<<<<<<<
 *         return self._number_(reach)
 * 
*/
  __pyx_t_4 = get_cusp_neighborhood_max_reach(__pyx_v_self->c_cusp_neighborhood); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 143, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":143
 *         Return the maximum reach over all cusps.
 *         """
 *         reach = Number(Real2gen(get_cusp_neighborhood_max_reach(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood)))
 *         return self._number_(reach)
*/
  __pyx_t_5 = __pyx_v_8SnapPyHP_Real2gen(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_reach = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":145
 *         reach = Number(Real2gen(get_cusp_neighborhood_max_reach(
 *             self.c_cusp_neighborhood)))
 *         return self._number_(reach)             # <<<<<<<<<<<<<<
 * 
 *     def get_tie(self, which_cusp):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_reach};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":139
 *         return self._number_(reach)
 * 
 *     def max_reach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the maximum reach over all cusps.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.max_reach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reach);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":147
 *         return self._number_(reach)
 * 
 *     def get_tie(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Return True if the specified cusp is a member of the tied group.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_31get_tie(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_8SnapPyHP_17CCuspNeighborhood_30get_tie, "\n        Return True if the specified cusp is a member of the tied group.\n        The displacements of the tied cusps are all the same.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_31get_tie = {"get_tie", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_31get_tie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_30get_tie};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_31get_tie(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_which_cusp = 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_tie (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 147, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 147, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_tie", 0) < 0) __PYX_ERR(11, 147, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_tie", 1, 1, 1, i); __PYX_ERR(11, 147, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 147, __pyx_L3_error)
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_tie", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 147, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.get_tie", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_30get_tie(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_30get_tie(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  Boolean __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_tie", 0);

  /* "cython/core/cusp_neighborhoods.pyx":152
 *         The displacements of the tied cusps are all the same.
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         return get_cusp_neighborhood_tie(self.c_cusp_neighborhood, N)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":153
 *         """
 *         N = self.check_index(which_cusp)
 *         return get_cusp_neighborhood_tie(self.c_cusp_neighborhood, N)             # <<<<<<<<<<<<<<
 * 
 *     def set_tie(self, which_cusp, new_tie):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 153, __pyx_L1_error)
  __pyx_t_5 = get_cusp_neighborhood_tie(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 153, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyLong_From_Boolean(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":147
 *         return self._number_(reach)
 * 
 *     def get_tie(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Return True if the specified cusp is a member of the tied group.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.get_tie", __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;
}

/* "cython/core/cusp_neighborhoods.pyx":155
 *         return get_cusp_neighborhood_tie(self.c_cusp_neighborhood, N)
 * 
 *     def set_tie(self, which_cusp, new_tie):             # <<<<<<<<<<<<<<
 *         """
 *         Mark the specified cusp as a member of the tied group.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_33set_tie(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_8SnapPyHP_17CCuspNeighborhood_32set_tie, "\n        Mark the specified cusp as a member of the tied group.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_33set_tie = {"set_tie", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_33set_tie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_32set_tie};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_33set_tie(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_which_cusp = 0;
  PyObject *__pyx_v_new_tie = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_tie (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_new_tie,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 155, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 155, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 155, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_tie", 0) < 0) __PYX_ERR(11, 155, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_tie", 1, 2, 2, i); __PYX_ERR(11, 155, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 155, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 155, __pyx_L3_error)
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_new_tie = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_tie", 1, 2, 2, __pyx_nargs); __PYX_ERR(11, 155, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.set_tie", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_32set_tie(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_new_tie);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_32set_tie(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_new_tie) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  Boolean __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_tie", 0);

  /* "cython/core/cusp_neighborhoods.pyx":159
 *         Mark the specified cusp as a member of the tied group.
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         set_cusp_neighborhood_tie(self.c_cusp_neighborhood, N, new_tie)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":160
 *         """
 *         N = self.check_index(which_cusp)
 *         set_cusp_neighborhood_tie(self.c_cusp_neighborhood, N, new_tie)             # <<<<<<<<<<<<<<
 * 
 *     def volume(self, which_cusp=0):
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 160, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyLong_As_Boolean(__pyx_v_new_tie); if (unlikely((__pyx_t_5 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(11, 160, __pyx_L1_error)
  set_cusp_neighborhood_tie(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 160, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":155
 *         return get_cusp_neighborhood_tie(self.c_cusp_neighborhood, N)
 * 
 *     def set_tie(self, which_cusp, new_tie):             # <<<<<<<<<<<<<<
 *         """
 *         Mark the specified cusp as a member of the tied group.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.set_tie", __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;
}

/* "cython/core/cusp_neighborhoods.pyx":162
 *         set_cusp_neighborhood_tie(self.c_cusp_neighborhood, N, new_tie)
 * 
 *     def volume(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the volume of the horoball neighborhood of the specified
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_35volume(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_8SnapPyHP_17CCuspNeighborhood_34volume, "\n        Return the volume of the horoball neighborhood of the specified\n        cusp.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_35volume = {"volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_35volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_34volume};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_35volume(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_which_cusp = 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("volume (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 162, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 162, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "volume", 0) < 0) __PYX_ERR(11, 162, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 162, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("volume", 0, 0, 1, __pyx_nargs); __PYX_ERR(11, 162, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_34volume(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_34volume(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_volume = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __pyx_t_8SnapPyHP_Real __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("volume", 0);

  /* "cython/core/cusp_neighborhoods.pyx":167
 *         cusp.
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         volume = Number(Real2gen(get_cusp_neighborhood_cusp_volume(
 *                 self.c_cusp_neighborhood, N)))
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":168
 *         """
 *         N = self.check_index(which_cusp)
 *         volume = Number(Real2gen(get_cusp_neighborhood_cusp_volume(             # <<<<<<<<<<<<<<
 *                 self.c_cusp_neighborhood, N)))
 *         return self._number_(volume)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/cusp_neighborhoods.pyx":169
 *         N = self.check_index(which_cusp)
 *         volume = Number(Real2gen(get_cusp_neighborhood_cusp_volume(
 *                 self.c_cusp_neighborhood, N)))             # <<<<<<<<<<<<<<
 *         return self._number_(volume)
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 169, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":168
 *         """
 *         N = self.check_index(which_cusp)
 *         volume = Number(Real2gen(get_cusp_neighborhood_cusp_volume(             # <<<<<<<<<<<<<<
 *                 self.c_cusp_neighborhood, N)))
 *         return self._number_(volume)
*/
  __pyx_t_6 = get_cusp_neighborhood_cusp_volume(__pyx_v_self->c_cusp_neighborhood, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 168, __pyx_L1_error)
  __pyx_t_7 = __pyx_v_8SnapPyHP_Real2gen(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_volume = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":170
 *         volume = Number(Real2gen(get_cusp_neighborhood_cusp_volume(
 *                 self.c_cusp_neighborhood, N)))
 *         return self._number_(volume)             # <<<<<<<<<<<<<<
 * 
 *     def translations(self, which_cusp = 0):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_volume};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":162
 *         set_cusp_neighborhood_tie(self.c_cusp_neighborhood, N, new_tie)
 * 
 *     def volume(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the volume of the horoball neighborhood of the specified
*/

  /* 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("SnapPyHP.CCuspNeighborhood.volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_volume);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":172
 *         return self._number_(volume)
 * 
 *     def translations(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the (complex) Euclidean translations of the meridian
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_37translations(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_8SnapPyHP_17CCuspNeighborhood_36translations, "\n        Return the (complex) Euclidean translations of the meridian\n        and longitude of the specified cusp.\n\n        Also see :py:meth:`CuspNeighborhood.all_translations` which supports\n        arbitrary precision and verified results.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_37translations = {"translations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_37translations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_36translations};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_37translations(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_which_cusp = 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("translations (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 172, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "translations", 0) < 0) __PYX_ERR(11, 172, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translations", 0, 0, 1, __pyx_nargs); __PYX_ERR(11, 172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.translations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_36translations(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_36translations(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  Complex __pyx_v_meridian;
  Complex __pyx_v_longitude;
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_L = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("translations", 0);

  /* "cython/core/cusp_neighborhoods.pyx":182
 *         cdef Complex meridian
 *         cdef Complex longitude
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         get_cusp_neighborhood_translations(self.c_cusp_neighborhood,
 *                                            N,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":184
 *         N = self.check_index(which_cusp)
 *         get_cusp_neighborhood_translations(self.c_cusp_neighborhood,
 *                                            N,             # <<<<<<<<<<<<<<
 *                                            &meridian,
 *                                            &longitude)
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 184, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":183
 *         cdef Complex longitude
 *         N = self.check_index(which_cusp)
 *         get_cusp_neighborhood_translations(self.c_cusp_neighborhood,             # <<<<<<<<<<<<<<
 *                                            N,
 *                                            &meridian,
*/
  get_cusp_neighborhood_translations(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4, (&__pyx_v_meridian), (&__pyx_v_longitude)); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 183, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":187
 *                                            &meridian,
 *                                            &longitude)
 *         M, L = Complex2Number(meridian), Complex2Number(longitude)             # <<<<<<<<<<<<<<
 *         return self._number_(M), self._number_(L)
 * 
*/
  __pyx_t_1 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_meridian); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_longitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_M = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_L = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":188
 *                                            &longitude)
 *         M, L = Complex2Number(meridian), Complex2Number(longitude)
 *         return self._number_(M), self._number_(L)             # <<<<<<<<<<<<<<
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_M};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_L};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(11, 188, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(11, 188, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":172
 *         return self._number_(volume)
 * 
 *     def translations(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the (complex) Euclidean translations of the meridian
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.translations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_L);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":190
 *         return self._number_(M), self._number_(L)
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,             # <<<<<<<<<<<<<<
 *                   high_precision=False):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_39horoballs(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_8SnapPyHP_17CCuspNeighborhood_38horoballs, "\n        Return a list of dictionaries describing the horoballs with\n        height at least cutoff.  The keys are 'center', 'radius', 'index'.\n\n        If the high_precision flag is set to the default value False, these\n        are Python complexes and floats.  Otherwise they are SnapPy Numbers.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_39horoballs = {"horoballs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_39horoballs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_38horoballs};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_39horoballs(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_cutoff = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_full_list = 0;
  PyObject *__pyx_v_high_precision = 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("horoballs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cutoff,&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_full_list,&__pyx_mstate_global->__pyx_n_u_high_precision,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 190, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "horoballs", 0) < 0) __PYX_ERR(11, 190, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_1));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/cusp_neighborhoods.pyx":191
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,
 *                   high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of dictionaries describing the horoballs with
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_1));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));

      /* "cython/core/cusp_neighborhoods.pyx":190
 *         return self._number_(M), self._number_(L)
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,             # <<<<<<<<<<<<<<
 *                   high_precision=False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "cython/core/cusp_neighborhoods.pyx":191
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,
 *                   high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of dictionaries describing the horoballs with
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_cutoff = values[0];
    __pyx_v_which_cusp = values[1];
    __pyx_v_full_list = values[2];
    __pyx_v_high_precision = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("horoballs", 0, 0, 4, __pyx_nargs); __PYX_ERR(11, 190, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.horoballs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_38horoballs(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_which_cusp, __pyx_v_full_list, __pyx_v_high_precision);

  /* "cython/core/cusp_neighborhoods.pyx":190
 *         return self._number_(M), self._number_(L)
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,             # <<<<<<<<<<<<<<
 *                   high_precision=False):
 *         """
*/

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_38horoballs(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_full_list, PyObject *__pyx_v_high_precision) {
  CuspNbhdHoroballList *__pyx_v_horoball_list;
  CuspNbhdHoroball __pyx_v_ball;
  PyObject *__pyx_v_result = NULL;
  long __pyx_v_n;
  PyObject *__pyx_v_dict = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  Boolean __pyx_t_5;
  __pyx_t_8SnapPyHP_Real __pyx_t_6;
  CuspNbhdHoroballList *__pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("horoballs", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":201
 *         cdef CuspNbhdHoroballList* horoball_list
 *         cdef CuspNbhdHoroball ball
 *         which_cusp = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         horoball_list = get_cusp_neighborhood_horoballs(
 *             self.c_cusp_neighborhood,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":204
 *         horoball_list = get_cusp_neighborhood_horoballs(
 *             self.c_cusp_neighborhood,
 *             which_cusp,             # <<<<<<<<<<<<<<
 *             full_list,
 *             Object2Real(cutoff))
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 204, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":205
 *             self.c_cusp_neighborhood,
 *             which_cusp,
 *             full_list,             # <<<<<<<<<<<<<<
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:
*/
  __pyx_t_5 = __Pyx_PyLong_As_Boolean(__pyx_v_full_list); if (unlikely((__pyx_t_5 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(11, 205, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":206
 *             which_cusp,
 *             full_list,
 *             Object2Real(cutoff))             # <<<<<<<<<<<<<<
 *         if horoball_list == NULL:
 *             raise RuntimeError('The horoball construction failed.')
*/
  __pyx_t_6 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_cutoff); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 206, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":202
 *         cdef CuspNbhdHoroball ball
 *         which_cusp = self.check_index(which_cusp)
 *         horoball_list = get_cusp_neighborhood_horoballs(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood,
 *             which_cusp,
*/
  __pyx_t_7 = get_cusp_neighborhood_horoballs(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4, __pyx_t_5, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6)); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 202, __pyx_L1_error)
  __pyx_v_horoball_list = __pyx_t_7;

  /* "cython/core/cusp_neighborhoods.pyx":207
 *             full_list,
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The horoball construction failed.')
 *         result = []
*/
  __pyx_t_8 = (__pyx_v_horoball_list == NULL);
  if (unlikely(__pyx_t_8)) {

    /* "cython/core/cusp_neighborhoods.pyx":208
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:
 *             raise RuntimeError('The horoball construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < horoball_list.num_horoballs:
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_9 = __pyx_builtin_RuntimeError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_horoball_construction_failed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(11, 208, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":207
 *             full_list,
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The horoball construction failed.')
 *         result = []
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":209
 *         if horoball_list == NULL:
 *             raise RuntimeError('The horoball construction failed.')
 *         result = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < horoball_list.num_horoballs:
 *             ball = horoball_list.horoball[n]
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":210
 *             raise RuntimeError('The horoball construction failed.')
 *         result = []
 *         for n from 0 <= n < horoball_list.num_horoballs:             # <<<<<<<<<<<<<<
 *             ball = horoball_list.horoball[n]
 *             if high_precision:
*/
  __pyx_t_4 = __pyx_v_horoball_list->num_horoballs;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {

    /* "cython/core/cusp_neighborhoods.pyx":211
 *         result = []
 *         for n from 0 <= n < horoball_list.num_horoballs:
 *             ball = horoball_list.horoball[n]             # <<<<<<<<<<<<<<
 *             if high_precision:
 *                 dict = {
*/
    __pyx_v_ball = (__pyx_v_horoball_list->horoball[__pyx_v_n]);

    /* "cython/core/cusp_neighborhoods.pyx":212
 *         for n from 0 <= n < horoball_list.num_horoballs:
 *             ball = horoball_list.horoball[n]
 *             if high_precision:             # <<<<<<<<<<<<<<
 *                 dict = {
 *                     'center' : self._number_(Complex2Number(ball.center)),
*/
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_high_precision); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(11, 212, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "cython/core/cusp_neighborhoods.pyx":214
 *             if high_precision:
 *                 dict = {
 *                     'center' : self._number_(Complex2Number(ball.center)),             # <<<<<<<<<<<<<<
 *                     'radius' : self._number_(Real2Number(ball.radius)),
 *                     'index'  : ball.cusp_index}
*/
      __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_10 = __pyx_f_8SnapPyHP_Complex2Number(__pyx_v_ball.center); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 214, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_center, __pyx_t_9) < 0) __PYX_ERR(11, 214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":215
 *                 dict = {
 *                     'center' : self._number_(Complex2Number(ball.center)),
 *                     'radius' : self._number_(Real2Number(ball.radius)),             # <<<<<<<<<<<<<<
 *                     'index'  : ball.cusp_index}
 *             else:
*/
      __pyx_t_10 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_2 = __pyx_f_8SnapPyHP_Real2Number(__pyx_v_ball.radius); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_2};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_radius, __pyx_t_9) < 0) __PYX_ERR(11, 214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":216
 *                     'center' : self._number_(Complex2Number(ball.center)),
 *                     'radius' : self._number_(Real2Number(ball.radius)),
 *                     'index'  : ball.cusp_index}             # <<<<<<<<<<<<<<
 *             else:
 *                 dict = {'center' : Complex2complex(ball.center),
*/
      __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_ball.cusp_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_9) < 0) __PYX_ERR(11, 214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dict, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":212
 *         for n from 0 <= n < horoball_list.num_horoballs:
 *             ball = horoball_list.horoball[n]
 *             if high_precision:             # <<<<<<<<<<<<<<
 *                 dict = {
 *                     'center' : self._number_(Complex2Number(ball.center)),
*/
      goto __pyx_L6;
    }

    /* "cython/core/cusp_neighborhoods.pyx":218
 *                     'index'  : ball.cusp_index}
 *             else:
 *                 dict = {'center' : Complex2complex(ball.center),             # <<<<<<<<<<<<<<
 *                         'radius' : Real2float(ball.radius),
 *                         'index'  : ball.cusp_index}
*/
    /*else*/ {
      __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __pyx_f_8SnapPyHP_Complex2complex(__pyx_v_ball.center); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_center, __pyx_t_9) < 0) __PYX_ERR(11, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":219
 *             else:
 *                 dict = {'center' : Complex2complex(ball.center),
 *                         'radius' : Real2float(ball.radius),             # <<<<<<<<<<<<<<
 *                         'index'  : ball.cusp_index}
 *             result.append(dict)
*/
      __pyx_t_9 = __pyx_f_8SnapPyHP_Real2float(__pyx_v_ball.radius); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_radius, __pyx_t_9) < 0) __PYX_ERR(11, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":220
 *                 dict = {'center' : Complex2complex(ball.center),
 *                         'radius' : Real2float(ball.radius),
 *                         'index'  : ball.cusp_index}             # <<<<<<<<<<<<<<
 *             result.append(dict)
 *         free_cusp_neighborhood_horoball_list(horoball_list)
*/
      __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_ball.cusp_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_9) < 0) __PYX_ERR(11, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dict, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;
    }
    __pyx_L6:;

    /* "cython/core/cusp_neighborhoods.pyx":221
 *                         'radius' : Real2float(ball.radius),
 *                         'index'  : ball.cusp_index}
 *             result.append(dict)             # <<<<<<<<<<<<<<
 *         free_cusp_neighborhood_horoball_list(horoball_list)
 *         return result
*/
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_dict); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(11, 221, __pyx_L1_error)
  }

  /* "cython/core/cusp_neighborhoods.pyx":222
 *                         'index'  : ball.cusp_index}
 *             result.append(dict)
 *         free_cusp_neighborhood_horoball_list(horoball_list)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  free_cusp_neighborhood_horoball_list(__pyx_v_horoball_list); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 222, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":223
 *             result.append(dict)
 *         free_cusp_neighborhood_horoball_list(horoball_list)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def Ford_domain(self, which_cusp=0, high_precision=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":190
 *         return self._number_(M), self._number_(L)
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,             # <<<<<<<<<<<<<<
 *                   high_precision=False):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.horoballs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_dict);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":225
 *         return result
 * 
 *     def Ford_domain(self, which_cusp=0, high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of pairs of complex numbers describing the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_41Ford_domain(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_8SnapPyHP_17CCuspNeighborhood_40Ford_domain, "\n        Return a list of pairs of complex numbers describing the\n        endpoints of the segments obtained by projecting the edges of\n        the Ford domain to the xy-plane in the upper half space model.\n\n        If the high_precision flag is set to False (the default), the\n        coordinates are Python complex numbers.  Otherwise they are\n        SnapPy Numbers.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_41Ford_domain = {"Ford_domain", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_41Ford_domain, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_40Ford_domain};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_41Ford_domain(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_which_cusp = 0;
  PyObject *__pyx_v_high_precision = 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("Ford_domain (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_high_precision,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 225, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 225, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 225, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Ford_domain", 0) < 0) __PYX_ERR(11, 225, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 225, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 225, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_high_precision = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Ford_domain", 0, 0, 2, __pyx_nargs); __PYX_ERR(11, 225, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.Ford_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_40Ford_domain(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_high_precision);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_40Ford_domain(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_high_precision) {
  CuspNbhdSegmentList *__pyx_v_segment_list;
  CuspNbhdSegment __pyx_v_segment;
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_n;
  PyObject *__pyx_v_pair = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  CuspNbhdSegmentList *__pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Ford_domain", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":237
 *         cdef CuspNbhdSegmentList* segment_list
 *         cdef CuspNbhdSegment segment
 *         which_cusp = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         segment_list = get_cusp_neighborhood_Ford_domain(
 *             self.c_cusp_neighborhood,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":240
 *         segment_list = get_cusp_neighborhood_Ford_domain(
 *             self.c_cusp_neighborhood,
 *             which_cusp)             # <<<<<<<<<<<<<<
 *         if segment_list == NULL:
 *             raise RuntimeError('The Ford domain construction failed.')
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 240, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":238
 *         cdef CuspNbhdSegment segment
 *         which_cusp = self.check_index(which_cusp)
 *         segment_list = get_cusp_neighborhood_Ford_domain(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood,
 *             which_cusp)
*/
  __pyx_t_5 = get_cusp_neighborhood_Ford_domain(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 238, __pyx_L1_error)
  __pyx_v_segment_list = __pyx_t_5;

  /* "cython/core/cusp_neighborhoods.pyx":241
 *             self.c_cusp_neighborhood,
 *             which_cusp)
 *         if segment_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The Ford domain construction failed.')
 *         result = []
*/
  __pyx_t_6 = (__pyx_v_segment_list == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/cusp_neighborhoods.pyx":242
 *             which_cusp)
 *         if segment_list == NULL:
 *             raise RuntimeError('The Ford domain construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n in range(segment_list.num_segments):
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_7 = __pyx_builtin_RuntimeError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_Ford_domain_construction_fai};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(11, 242, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":241
 *             self.c_cusp_neighborhood,
 *             which_cusp)
 *         if segment_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The Ford domain construction failed.')
 *         result = []
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":243
 *         if segment_list == NULL:
 *             raise RuntimeError('The Ford domain construction failed.')
 *         result = []             # <<<<<<<<<<<<<<
 *         for n in range(segment_list.num_segments):
 *             segment = segment_list.segment[n]
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":244
 *             raise RuntimeError('The Ford domain construction failed.')
 *         result = []
 *         for n in range(segment_list.num_segments):             # <<<<<<<<<<<<<<
 *             segment = segment_list.segment[n]
 *             if high_precision:
*/
  __pyx_t_4 = __pyx_v_segment_list->num_segments;
  __pyx_t_8 = __pyx_t_4;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_n = __pyx_t_9;

    /* "cython/core/cusp_neighborhoods.pyx":245
 *         result = []
 *         for n in range(segment_list.num_segments):
 *             segment = segment_list.segment[n]             # <<<<<<<<<<<<<<
 *             if high_precision:
 *                 pair = (
*/
    __pyx_v_segment = (__pyx_v_segment_list->segment[__pyx_v_n]);

    /* "cython/core/cusp_neighborhoods.pyx":246
 *         for n in range(segment_list.num_segments):
 *             segment = segment_list.segment[n]
 *             if high_precision:             # <<<<<<<<<<<<<<
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_high_precision); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(11, 246, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/cusp_neighborhoods.pyx":248
 *             if high_precision:
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }

      /* "cython/core/cusp_neighborhoods.pyx":249
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
 *                     self._number_(Complex2Number(segment.endpoint[1])))             # <<<<<<<<<<<<<<
 *             else:
 *                 pair = (Complex2complex(segment.endpoint[0]),
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_10 = __pyx_f_8SnapPyHP_Complex2Number((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }

      /* "cython/core/cusp_neighborhoods.pyx":248
 *             if high_precision:
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
*/
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(11, 248, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2) != (0)) __PYX_ERR(11, 248, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_10));
      __pyx_t_10 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":246
 *         for n in range(segment_list.num_segments):
 *             segment = segment_list.segment[n]
 *             if high_precision:             # <<<<<<<<<<<<<<
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
*/
      goto __pyx_L6;
    }

    /* "cython/core/cusp_neighborhoods.pyx":251
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
 *                 pair = (Complex2complex(segment.endpoint[0]),             # <<<<<<<<<<<<<<
 *                         Complex2complex(segment.endpoint[1]))
 *             result.append(pair)
*/
    /*else*/ {
      __pyx_t_10 = __pyx_f_8SnapPyHP_Complex2complex((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "cython/core/cusp_neighborhoods.pyx":252
 *             else:
 *                 pair = (Complex2complex(segment.endpoint[0]),
 *                         Complex2complex(segment.endpoint[1]))             # <<<<<<<<<<<<<<
 *             result.append(pair)
 *         free_cusp_neighborhood_segment_list(segment_list)
*/
      __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2complex((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/cusp_neighborhoods.pyx":251
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
 *                 pair = (Complex2complex(segment.endpoint[0]),             # <<<<<<<<<<<<<<
 *                         Complex2complex(segment.endpoint[1]))
 *             result.append(pair)
*/
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10) != (0)) __PYX_ERR(11, 251, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(11, 251, __pyx_L1_error);
      __pyx_t_10 = 0;
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;
    }
    __pyx_L6:;

    /* "cython/core/cusp_neighborhoods.pyx":253
 *                 pair = (Complex2complex(segment.endpoint[0]),
 *                         Complex2complex(segment.endpoint[1]))
 *             result.append(pair)             # <<<<<<<<<<<<<<
 *         free_cusp_neighborhood_segment_list(segment_list)
 *         return result
*/
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_pair); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(11, 253, __pyx_L1_error)
  }

  /* "cython/core/cusp_neighborhoods.pyx":254
 *                         Complex2complex(segment.endpoint[1]))
 *             result.append(pair)
 *         free_cusp_neighborhood_segment_list(segment_list)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  free_cusp_neighborhood_segment_list(__pyx_v_segment_list); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 254, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":255
 *             result.append(pair)
 *         free_cusp_neighborhood_segment_list(segment_list)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def triangulation(self, which_cusp=0, high_precision=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":225
 *         return result
 * 
 *     def Ford_domain(self, which_cusp=0, high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of pairs of complex numbers describing the
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.Ford_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":257
 *         return result
 * 
 *     def triangulation(self, which_cusp=0, high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of dictionaries describing the endpoints of the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_43triangulation(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_8SnapPyHP_17CCuspNeighborhood_42triangulation, "\n        Return a list of dictionaries describing the endpoints of the\n        segments obtained by projecting the edges of the triangulation\n        dual to the Ford domain into the xy-plane in the upper half\n        space model.  The keys are 'endpoints' and 'indices'.\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_43triangulation = {"triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_43triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_42triangulation};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_43triangulation(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_which_cusp = 0;
  PyObject *__pyx_v_high_precision = 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("triangulation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_high_precision,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 257, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "triangulation", 0) < 0) __PYX_ERR(11, 257, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_high_precision = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("triangulation", 0, 0, 2, __pyx_nargs); __PYX_ERR(11, 257, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_42triangulation(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_high_precision);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_42triangulation(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_high_precision) {
  CuspNbhdSegmentList *__pyx_v_segment_list;
  CuspNbhdSegment __pyx_v_segment;
  PyObject *__pyx_v_result = NULL;
  long __pyx_v_n;
  PyObject *__pyx_v_endpoints = NULL;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  CuspNbhdSegmentList *__pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("triangulation", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":266
 *         cdef CuspNbhdSegmentList* segment_list
 *         cdef CuspNbhdSegment segment
 *         which_cusp = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         segment_list = get_cusp_neighborhood_triangulation(
 *             self.c_cusp_neighborhood,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":269
 *         segment_list = get_cusp_neighborhood_triangulation(
 *             self.c_cusp_neighborhood,
 *             which_cusp)             # <<<<<<<<<<<<<<
 *         if segment_list == NULL:
 *             raise RuntimeError('The triangulation construction failed.')
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 269, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":267
 *         cdef CuspNbhdSegment segment
 *         which_cusp = self.check_index(which_cusp)
 *         segment_list = get_cusp_neighborhood_triangulation(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood,
 *             which_cusp)
*/
  __pyx_t_5 = get_cusp_neighborhood_triangulation(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 267, __pyx_L1_error)
  __pyx_v_segment_list = __pyx_t_5;

  /* "cython/core/cusp_neighborhoods.pyx":270
 *             self.c_cusp_neighborhood,
 *             which_cusp)
 *         if segment_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The triangulation construction failed.')
 *         result = []
*/
  __pyx_t_6 = (__pyx_v_segment_list == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/cusp_neighborhoods.pyx":271
 *             which_cusp)
 *         if segment_list == NULL:
 *             raise RuntimeError('The triangulation construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < segment_list.num_segments:
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_7 = __pyx_builtin_RuntimeError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_triangulation_construction_f};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(11, 271, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":270
 *             self.c_cusp_neighborhood,
 *             which_cusp)
 *         if segment_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The triangulation construction failed.')
 *         result = []
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":272
 *         if segment_list == NULL:
 *             raise RuntimeError('The triangulation construction failed.')
 *         result = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < segment_list.num_segments:
 *             segment = segment_list.segment[n]
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":273
 *             raise RuntimeError('The triangulation construction failed.')
 *         result = []
 *         for n from 0 <= n < segment_list.num_segments:             # <<<<<<<<<<<<<<
 *             segment = segment_list.segment[n]
 *             if high_precision:
*/
  __pyx_t_4 = __pyx_v_segment_list->num_segments;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {

    /* "cython/core/cusp_neighborhoods.pyx":274
 *         result = []
 *         for n from 0 <= n < segment_list.num_segments:
 *             segment = segment_list.segment[n]             # <<<<<<<<<<<<<<
 *             if high_precision:
 *                 endpoints = (
*/
    __pyx_v_segment = (__pyx_v_segment_list->segment[__pyx_v_n]);

    /* "cython/core/cusp_neighborhoods.pyx":275
 *         for n from 0 <= n < segment_list.num_segments:
 *             segment = segment_list.segment[n]
 *             if high_precision:             # <<<<<<<<<<<<<<
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_high_precision); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(11, 275, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/cusp_neighborhoods.pyx":277
 *             if high_precision:
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2Number((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }

      /* "cython/core/cusp_neighborhoods.pyx":278
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
 *                     self._number_(Complex2Number(segment.endpoint[1])))             # <<<<<<<<<<<<<<
 *             else:
 *                 endpoints = (Complex2complex(segment.endpoint[0]),
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = __pyx_f_8SnapPyHP_Complex2Number((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_number_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 278, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }

      /* "cython/core/cusp_neighborhoods.pyx":277
 *             if high_precision:
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
*/
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(11, 277, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(11, 277, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_endpoints, ((PyObject*)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":275
 *         for n from 0 <= n < segment_list.num_segments:
 *             segment = segment_list.segment[n]
 *             if high_precision:             # <<<<<<<<<<<<<<
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
*/
      goto __pyx_L6;
    }

    /* "cython/core/cusp_neighborhoods.pyx":280
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
 *                 endpoints = (Complex2complex(segment.endpoint[0]),             # <<<<<<<<<<<<<<
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,
*/
    /*else*/ {
      __pyx_t_8 = __pyx_f_8SnapPyHP_Complex2complex((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);

      /* "cython/core/cusp_neighborhoods.pyx":281
 *             else:
 *                 endpoints = (Complex2complex(segment.endpoint[0]),
 *                              Complex2complex(segment.endpoint[1]))             # <<<<<<<<<<<<<<
 *             indices = (segment.start_index,
 *                        segment.middle_index,
*/
      __pyx_t_2 = __pyx_f_8SnapPyHP_Complex2complex((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/cusp_neighborhoods.pyx":280
 *                     self._number_(Complex2Number(segment.endpoint[1])))
 *             else:
 *                 endpoints = (Complex2complex(segment.endpoint[0]),             # <<<<<<<<<<<<<<
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,
*/
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_8);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(11, 280, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(11, 280, __pyx_L1_error);
      __pyx_t_8 = 0;
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_endpoints, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;
    }
    __pyx_L6:;

    /* "cython/core/cusp_neighborhoods.pyx":282
 *                 endpoints = (Complex2complex(segment.endpoint[0]),
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,             # <<<<<<<<<<<<<<
 *                        segment.middle_index,
 *                        segment.end_index)
*/
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_segment.start_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/cusp_neighborhoods.pyx":283
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,
 *                        segment.middle_index,             # <<<<<<<<<<<<<<
 *                        segment.end_index)
 *             result.append({'endpoints' : endpoints, 'indices' : indices})
*/
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_segment.middle_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/cusp_neighborhoods.pyx":284
 *             indices = (segment.start_index,
 *                        segment.middle_index,
 *                        segment.end_index)             # <<<<<<<<<<<<<<
 *             result.append({'endpoints' : endpoints, 'indices' : indices})
 *         free_cusp_neighborhood_segment_list(segment_list)
*/
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_segment.end_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "cython/core/cusp_neighborhoods.pyx":282
 *                 endpoints = (Complex2complex(segment.endpoint[0]),
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,             # <<<<<<<<<<<<<<
 *                        segment.middle_index,
 *                        segment.end_index)
*/
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1) != (0)) __PYX_ERR(11, 282, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2) != (0)) __PYX_ERR(11, 282, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(11, 282, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_indices, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/cusp_neighborhoods.pyx":285
 *                        segment.middle_index,
 *                        segment.end_index)
 *             result.append({'endpoints' : endpoints, 'indices' : indices})             # <<<<<<<<<<<<<<
 *         free_cusp_neighborhood_segment_list(segment_list)
 *         return result
*/
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_endpoints, __pyx_v_endpoints) < 0) __PYX_ERR(11, 285, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_indices, __pyx_v_indices) < 0) __PYX_ERR(11, 285, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(11, 285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "cython/core/cusp_neighborhoods.pyx":286
 *                        segment.end_index)
 *             result.append({'endpoints' : endpoints, 'indices' : indices})
 *         free_cusp_neighborhood_segment_list(segment_list)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  free_cusp_neighborhood_segment_list(__pyx_v_segment_list); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 286, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":287
 *             result.append({'endpoints' : endpoints, 'indices' : indices})
 *         free_cusp_neighborhood_segment_list(segment_list)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def view(self, which_cusp=0, cutoff=None):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":257
 *         return result
 * 
 *     def triangulation(self, which_cusp=0, high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of dictionaries describing the endpoints of the
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_endpoints);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":289
 *         return result
 * 
 *     def view(self, which_cusp=0, cutoff=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a 3D picture of the horoball packing.  One can specify
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_45view(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_8SnapPyHP_17CCuspNeighborhood_44view, "\n        Create a 3D picture of the horoball packing.  One can specify\n        which cusp to put at infinity and how large of horoballs to\n        look at, e.g.\n\n        >>> M = Manifold('m125')\n        >>> C = M.cusp_neighborhood()\n        >>> C.view(which_cusp = 1, cutoff=0.2)   #doctest: +CYOPENGL\n        ");
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_45view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_45view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_44view};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_45view(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_which_cusp = 0;
  PyObject *__pyx_v_cutoff = 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("view (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_cutoff,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(11, 289, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < 0) __PYX_ERR(11, 289, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(11, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_cutoff = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("view", 0, 0, 2, __pyx_nargs); __PYX_ERR(11, 289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_44view(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_cutoff);

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

static PyObject *__pyx_pf_8SnapPyHP_17CCuspNeighborhood_44view(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_cutoff) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("view", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":299
 *         >>> C.view(which_cusp = 1, cutoff=0.2)   #doctest: +CYOPENGL
 *         """
 *         which_cusp = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         if HoroballViewer:
 *             return ViewerWindow(HoroballViewer, self, which_cusp=which_cusp,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_check_index, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":300
 *         """
 *         which_cusp = self.check_index(which_cusp)
 *         if HoroballViewer:             # <<<<<<<<<<<<<<
 *             return ViewerWindow(HoroballViewer, self, which_cusp=which_cusp,
 *                                 cutoff=cutoff,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_HoroballViewer); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(11, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cython/core/cusp_neighborhoods.pyx":301
 *         which_cusp = self.check_index(which_cusp)
 *         if HoroballViewer:
 *             return ViewerWindow(HoroballViewer, self, which_cusp=which_cusp,             # <<<<<<<<<<<<<<
 *                                 cutoff=cutoff,
 *                                 title='Cusp neighborhood%s of %s' % (
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ViewerWindow); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_HoroballViewer); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "cython/core/cusp_neighborhoods.pyx":304
 *                                 cutoff=cutoff,
 *                                 title='Cusp neighborhood%s of %s' % (
 *                                     's' if self.num_cusps() > 1 else '',             # <<<<<<<<<<<<<<
 *                                     self.manifold_name))
 *         raise RuntimeError('The HoroballViewer class was not imported.')
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_cusps); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(11, 304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_s);
      __pyx_t_7 = __pyx_mstate_global->__pyx_n_u_s;
    } else {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10);
      __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u__10;
    }
    __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/cusp_neighborhoods.pyx":305
 *                                 title='Cusp neighborhood%s of %s' % (
 *                                     's' if self.num_cusps() > 1 else '',
 *                                     self.manifold_name))             # <<<<<<<<<<<<<<
 *         raise RuntimeError('The HoroballViewer class was not imported.')
 * 
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_manifold_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_7), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Cusp_neighborhood;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_of;
    __pyx_t_10[3] = __pyx_t_9;

    /* "cython/core/cusp_neighborhoods.pyx":303
 *             return ViewerWindow(HoroballViewer, self, which_cusp=which_cusp,
 *                                 cutoff=cutoff,
 *                                 title='Cusp neighborhood%s of %s' % (             # <<<<<<<<<<<<<<
 *                                     's' if self.num_cusps() > 1 else '',
 *                                     self.manifold_name))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_2, __pyx_t_6, ((PyObject *)__pyx_v_self)};
      __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_which_cusp, __pyx_v_which_cusp, __pyx_t_9, __pyx_callargs+3, 0) < 0) __PYX_ERR(11, 301, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cutoff, __pyx_v_cutoff, __pyx_t_9, __pyx_callargs+3, 1) < 0) __PYX_ERR(11, 301, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_title, __pyx_t_7, __pyx_t_9, __pyx_callargs+3, 2) < 0) __PYX_ERR(11, 301, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/cusp_neighborhoods.pyx":300
 *         """
 *         which_cusp = self.check_index(which_cusp)
 *         if HoroballViewer:             # <<<<<<<<<<<<<<
 *             return ViewerWindow(HoroballViewer, self, which_cusp=which_cusp,
 *                                 cutoff=cutoff,
*/
  }

  /* "cython/core/cusp_neighborhoods.pyx":306
 *                                     's' if self.num_cusps() > 1 else '',
 *                                     self.manifold_name))
 *         raise RuntimeError('The HoroballViewer class was not imported.')             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_RuntimeError);
  __pyx_t_9 = __pyx_builtin_RuntimeError; 
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_The_HoroballViewer_class_was_not};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(11, 306, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":289
 *         return result
 * 
 *     def view(self, which_cusp=0, cutoff=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a 3D picture of the horoball packing.  One can specify
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_47__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_47__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_47__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_46__reduce_cython__(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self));

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_49__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*/
static PyMethodDef __pyx_mdef_8SnapPyHP_17CCuspNeighborhood_49__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_17CCuspNeighborhood_49__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
) {
  CYTHON_UNUSED 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(7, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CCuspNeighborhood.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_17CCuspNeighborhood_48__setstate_cython__(((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)__pyx_v_self), __pyx_v___pyx_state);

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

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

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

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

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

/* "cython/core/pickle.pyx":31
 * cdef IS_COMPLETE = <unsigned char> 1 << 5
 * 
 * cdef pickle_triangulation(c_Triangulation *tri):             # <<<<<<<<<<<<<<
 *     """
 *     Pickle a Triangulation by constructing a TriangulationData structure
*/

static PyObject *__pyx_f_8SnapPyHP_pickle_triangulation(Triangulation *__pyx_v_tri) {
  TriangulationData *__pyx_v_tri_data;
  int __pyx_v_i;
  int __pyx_v_flag;
  int __pyx_v_is_complete;
  int __pyx_v_num_cusps;
  unsigned char __pyx_v_buf[7];
  signed char __pyx_v_filling[2];
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_j;
  double __pyx_v_M;
  double __pyx_v_L;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned char __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  double __pyx_t_9;
  double __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pickle_triangulation", 0);

  /* "cython/core/pickle.pyx":41
 *     cdef signed char filling[2]
 * 
 *     triangulation_to_data(tri, &tri_data)             # <<<<<<<<<<<<<<
 * 
 *     # Every pickle starts with b'pickle:'
*/
  triangulation_to_data(__pyx_v_tri, (&__pyx_v_tri_data)); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 41, __pyx_L1_error)

  /* "cython/core/pickle.pyx":44
 * 
 *     # Every pickle starts with b'pickle:'
 *     result = b'pickle:'             # <<<<<<<<<<<<<<
 * 
 *     # The first byte uses the two least significant bits to indicate the
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_pickle);
  __pyx_v_result = __pyx_mstate_global->__pyx_kp_b_pickle;

  /* "cython/core/pickle.pyx":48
 *     # The first byte uses the two least significant bits to indicate the
 *     # orientability type and other bits as flags.
 *     buf[0] = <unsigned char>tri_data.orientability             # <<<<<<<<<<<<<<
 *     # NOTE: tri_data.num_tetrahedra is a positive signed int.
 *     if tri_data.num_tetrahedra > 65535:
*/
  (__pyx_v_buf[0]) = ((unsigned char)__pyx_v_tri_data->orientability);

  /* "cython/core/pickle.pyx":50
 *     buf[0] = <unsigned char>tri_data.orientability
 *     # NOTE: tri_data.num_tetrahedra is a positive signed int.
 *     if tri_data.num_tetrahedra > 65535:             # <<<<<<<<<<<<<<
 *         flag = IS_HUGE
 *         buf[0] |= IS_HUGE
*/
  __pyx_t_1 = (__pyx_v_tri_data->num_tetrahedra > 0xFFFF);
  if (__pyx_t_1) {

    /* "cython/core/pickle.pyx":51
 *     # NOTE: tri_data.num_tetrahedra is a positive signed int.
 *     if tri_data.num_tetrahedra > 65535:
 *         flag = IS_HUGE             # <<<<<<<<<<<<<<
 *         buf[0] |= IS_HUGE
 *         buf[1] = tri_data.num_tetrahedra >> 24
*/
    __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_8SnapPyHP_IS_HUGE); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 51, __pyx_L1_error)
    __pyx_v_flag = __pyx_t_2;

    /* "cython/core/pickle.pyx":52
 *     if tri_data.num_tetrahedra > 65535:
 *         flag = IS_HUGE
 *         buf[0] |= IS_HUGE             # <<<<<<<<<<<<<<
 *         buf[1] = tri_data.num_tetrahedra >> 24
 *         buf[2] = (tri_data.num_tetrahedra >> 16) & 0xff
*/
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyLong_From_unsigned_char((__pyx_v_buf[__pyx_t_3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_InPlaceOr(__pyx_t_4, __pyx_v_8SnapPyHP_IS_HUGE); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyLong_As_unsigned_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(12, 52, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    (__pyx_v_buf[__pyx_t_3]) = __pyx_t_6;

    /* "cython/core/pickle.pyx":53
 *         flag = IS_HUGE
 *         buf[0] |= IS_HUGE
 *         buf[1] = tri_data.num_tetrahedra >> 24             # <<<<<<<<<<<<<<
 *         buf[2] = (tri_data.num_tetrahedra >> 16) & 0xff
 *         buf[3] = (tri_data.num_tetrahedra >> 8) & 0xff
*/
    (__pyx_v_buf[1]) = (__pyx_v_tri_data->num_tetrahedra >> 24);

    /* "cython/core/pickle.pyx":54
 *         buf[0] |= IS_HUGE
 *         buf[1] = tri_data.num_tetrahedra >> 24
 *         buf[2] = (tri_data.num_tetrahedra >> 16) & 0xff             # <<<<<<<<<<<<<<
 *         buf[3] = (tri_data.num_tetrahedra >> 8) & 0xff
 *         buf[4] = tri_data.num_tetrahedra & 0xff
*/
    (__pyx_v_buf[2]) = ((__pyx_v_tri_data->num_tetrahedra >> 16) & 0xff);

    /* "cython/core/pickle.pyx":55
 *         buf[1] = tri_data.num_tetrahedra >> 24
 *         buf[2] = (tri_data.num_tetrahedra >> 16) & 0xff
 *         buf[3] = (tri_data.num_tetrahedra >> 8) & 0xff             # <<<<<<<<<<<<<<
 *         buf[4] = tri_data.num_tetrahedra & 0xff
 *         i = 5
*/
    (__pyx_v_buf[3]) = ((__pyx_v_tri_data->num_tetrahedra >> 8) & 0xff);

    /* "cython/core/pickle.pyx":56
 *         buf[2] = (tri_data.num_tetrahedra >> 16) & 0xff
 *         buf[3] = (tri_data.num_tetrahedra >> 8) & 0xff
 *         buf[4] = tri_data.num_tetrahedra & 0xff             # <<<<<<<<<<<<<<
 *         i = 5
 *     elif tri_data.num_tetrahedra > 255:
*/
    (__pyx_v_buf[4]) = (__pyx_v_tri_data->num_tetrahedra & 0xff);

    /* "cython/core/pickle.pyx":57
 *         buf[3] = (tri_data.num_tetrahedra >> 8) & 0xff
 *         buf[4] = tri_data.num_tetrahedra & 0xff
 *         i = 5             # <<<<<<<<<<<<<<
 *     elif tri_data.num_tetrahedra > 255:
 *         flag = IS_BIG
*/
    __pyx_v_i = 5;

    /* "cython/core/pickle.pyx":50
 *     buf[0] = <unsigned char>tri_data.orientability
 *     # NOTE: tri_data.num_tetrahedra is a positive signed int.
 *     if tri_data.num_tetrahedra > 65535:             # <<<<<<<<<<<<<<
 *         flag = IS_HUGE
 *         buf[0] |= IS_HUGE
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":58
 *         buf[4] = tri_data.num_tetrahedra & 0xff
 *         i = 5
 *     elif tri_data.num_tetrahedra > 255:             # <<<<<<<<<<<<<<
 *         flag = IS_BIG
 *         buf[0] |= IS_BIG
*/
  __pyx_t_1 = (__pyx_v_tri_data->num_tetrahedra > 0xFF);
  if (__pyx_t_1) {

    /* "cython/core/pickle.pyx":59
 *         i = 5
 *     elif tri_data.num_tetrahedra > 255:
 *         flag = IS_BIG             # <<<<<<<<<<<<<<
 *         buf[0] |= IS_BIG
 *         buf[1] = tri_data.num_tetrahedra >> 8
*/
    __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_8SnapPyHP_IS_BIG); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 59, __pyx_L1_error)
    __pyx_v_flag = __pyx_t_2;

    /* "cython/core/pickle.pyx":60
 *     elif tri_data.num_tetrahedra > 255:
 *         flag = IS_BIG
 *         buf[0] |= IS_BIG             # <<<<<<<<<<<<<<
 *         buf[1] = tri_data.num_tetrahedra >> 8
 *         buf[2] = tri_data.num_tetrahedra & 0xff
*/
    __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyLong_From_unsigned_char((__pyx_v_buf[__pyx_t_3])); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_InPlaceOr(__pyx_t_5, __pyx_v_8SnapPyHP_IS_BIG); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyLong_As_unsigned_char(__pyx_t_4); if (unlikely((__pyx_t_6 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(12, 60, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_buf[__pyx_t_3]) = __pyx_t_6;

    /* "cython/core/pickle.pyx":61
 *         flag = IS_BIG
 *         buf[0] |= IS_BIG
 *         buf[1] = tri_data.num_tetrahedra >> 8             # <<<<<<<<<<<<<<
 *         buf[2] = tri_data.num_tetrahedra & 0xff
 *         i = 3
*/
    (__pyx_v_buf[1]) = (__pyx_v_tri_data->num_tetrahedra >> 8);

    /* "cython/core/pickle.pyx":62
 *         buf[0] |= IS_BIG
 *         buf[1] = tri_data.num_tetrahedra >> 8
 *         buf[2] = tri_data.num_tetrahedra & 0xff             # <<<<<<<<<<<<<<
 *         i = 3
 *     else:
*/
    (__pyx_v_buf[2]) = (__pyx_v_tri_data->num_tetrahedra & 0xff);

    /* "cython/core/pickle.pyx":63
 *         buf[1] = tri_data.num_tetrahedra >> 8
 *         buf[2] = tri_data.num_tetrahedra & 0xff
 *         i = 3             # <<<<<<<<<<<<<<
 *     else:
 *         flag = 0
*/
    __pyx_v_i = 3;

    /* "cython/core/pickle.pyx":58
 *         buf[4] = tri_data.num_tetrahedra & 0xff
 *         i = 5
 *     elif tri_data.num_tetrahedra > 255:             # <<<<<<<<<<<<<<
 *         flag = IS_BIG
 *         buf[0] |= IS_BIG
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":65
 *         i = 3
 *     else:
 *         flag = 0             # <<<<<<<<<<<<<<
 *         buf[1] = tri_data.num_tetrahedra &0xff
 *         i = 2
*/
  /*else*/ {
    __pyx_v_flag = 0;

    /* "cython/core/pickle.pyx":66
 *     else:
 *         flag = 0
 *         buf[1] = tri_data.num_tetrahedra &0xff             # <<<<<<<<<<<<<<
 *         i = 2
 *     buf[i] = tri_data.num_or_cusps
*/
    (__pyx_v_buf[1]) = (__pyx_v_tri_data->num_tetrahedra & 0xff);

    /* "cython/core/pickle.pyx":67
 *         flag = 0
 *         buf[1] = tri_data.num_tetrahedra &0xff
 *         i = 2             # <<<<<<<<<<<<<<
 *     buf[i] = tri_data.num_or_cusps
 *     buf[i+1] = tri_data.num_nonor_cusps
*/
    __pyx_v_i = 2;
  }
  __pyx_L3:;

  /* "cython/core/pickle.pyx":68
 *         buf[1] = tri_data.num_tetrahedra &0xff
 *         i = 2
 *     buf[i] = tri_data.num_or_cusps             # <<<<<<<<<<<<<<
 *     buf[i+1] = tri_data.num_nonor_cusps
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
*/
  __pyx_t_2 = __pyx_v_tri_data->num_or_cusps;
  (__pyx_v_buf[__pyx_v_i]) = __pyx_t_2;

  /* "cython/core/pickle.pyx":69
 *         i = 2
 *     buf[i] = tri_data.num_or_cusps
 *     buf[i+1] = tri_data.num_nonor_cusps             # <<<<<<<<<<<<<<
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
 *     is_complete = IS_COMPLETE
*/
  __pyx_t_2 = __pyx_v_tri_data->num_nonor_cusps;
  (__pyx_v_buf[(__pyx_v_i + 1)]) = __pyx_t_2;

  /* "cython/core/pickle.pyx":70
 *     buf[i] = tri_data.num_or_cusps
 *     buf[i+1] = tri_data.num_nonor_cusps
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps             # <<<<<<<<<<<<<<
 *     is_complete = IS_COMPLETE
 *     for j in range(num_cusps):
*/
  __pyx_v_num_cusps = (__pyx_v_tri_data->num_or_cusps + __pyx_v_tri_data->num_nonor_cusps);

  /* "cython/core/pickle.pyx":71
 *     buf[i+1] = tri_data.num_nonor_cusps
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
 *     is_complete = IS_COMPLETE             # <<<<<<<<<<<<<<
 *     for j in range(num_cusps):
 *         M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
*/
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_8SnapPyHP_IS_COMPLETE); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 71, __pyx_L1_error)
  __pyx_v_is_complete = __pyx_t_2;

  /* "cython/core/pickle.pyx":72
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
 *     is_complete = IS_COMPLETE
 *     for j in range(num_cusps):             # <<<<<<<<<<<<<<
 *         M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
 *         if M != 0.0 or L != 0.0:
*/
  __pyx_t_2 = __pyx_v_num_cusps;
  __pyx_t_7 = __pyx_t_2;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_j = __pyx_t_8;

    /* "cython/core/pickle.pyx":73
 *     is_complete = IS_COMPLETE
 *     for j in range(num_cusps):
 *         M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l             # <<<<<<<<<<<<<<
 *         if M != 0.0 or L != 0.0:
 *             is_complete = 0
*/
    __pyx_t_9 = ((double)(__pyx_v_tri_data->cusp_data[__pyx_v_j]).m);
    __pyx_t_10 = ((double)(__pyx_v_tri_data->cusp_data[__pyx_v_j]).l);
    __pyx_v_M = __pyx_t_9;
    __pyx_v_L = __pyx_t_10;

    /* "cython/core/pickle.pyx":74
 *     for j in range(num_cusps):
 *         M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
 *         if M != 0.0 or L != 0.0:             # <<<<<<<<<<<<<<
 *             is_complete = 0
 *         if M != floor(M) or L != floor(L):
*/
    __pyx_t_11 = (__pyx_v_M != 0.0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_L != 0.0);
    __pyx_t_1 = __pyx_t_11;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/pickle.pyx":75
 *         M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
 *         if M != 0.0 or L != 0.0:
 *             is_complete = 0             # <<<<<<<<<<<<<<
 *         if M != floor(M) or L != floor(L):
 *             raise ValueError('Manifold must be pickled with _to_string.')
*/
      __pyx_v_is_complete = 0;

      /* "cython/core/pickle.pyx":74
 *     for j in range(num_cusps):
 *         M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
 *         if M != 0.0 or L != 0.0:             # <<<<<<<<<<<<<<
 *             is_complete = 0
 *         if M != floor(M) or L != floor(L):
*/
    }

    /* "cython/core/pickle.pyx":76
 *         if M != 0.0 or L != 0.0:
 *             is_complete = 0
 *         if M != floor(M) or L != floor(L):             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *         if M < -128 or M > 127 or L < -128 or L > 127:
*/
    __pyx_t_11 = (__pyx_v_M != floor(__pyx_v_M));
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_L != floor(__pyx_v_L));
    __pyx_t_1 = __pyx_t_11;
    __pyx_L10_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/pickle.pyx":77
 *             is_complete = 0
 *         if M != floor(M) or L != floor(L):
 *             raise ValueError('Manifold must be pickled with _to_string.')             # <<<<<<<<<<<<<<
 *         if M < -128 or M > 127 or L < -128 or L > 127:
 *             raise ValueError('Manifold must be pickled with _to_string.')
*/
      __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_12 = __pyx_builtin_ValueError; 
      __pyx_t_13 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Manifold_must_be_pickled_with__t};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 77, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(12, 77, __pyx_L1_error)

      /* "cython/core/pickle.pyx":76
 *         if M != 0.0 or L != 0.0:
 *             is_complete = 0
 *         if M != floor(M) or L != floor(L):             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *         if M < -128 or M > 127 or L < -128 or L > 127:
*/
    }

    /* "cython/core/pickle.pyx":78
 *         if M != floor(M) or L != floor(L):
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *         if M < -128 or M > 127 or L < -128 or L > 127:             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *     buf[0] |= is_complete
*/
    __pyx_t_11 = (__pyx_v_M < -128.0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_M > 127.0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_L < -128.0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_L > 127.0);
    __pyx_t_1 = __pyx_t_11;
    __pyx_L13_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/pickle.pyx":79
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *         if M < -128 or M > 127 or L < -128 or L > 127:
 *             raise ValueError('Manifold must be pickled with _to_string.')             # <<<<<<<<<<<<<<
 *     buf[0] |= is_complete
 *     result += buf[:i+2]
*/
      __pyx_t_12 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_5 = __pyx_builtin_ValueError; 
      __pyx_t_13 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Manifold_must_be_pickled_with__t};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 79, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(12, 79, __pyx_L1_error)

      /* "cython/core/pickle.pyx":78
 *         if M != floor(M) or L != floor(L):
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *         if M < -128 or M > 127 or L < -128 or L > 127:             # <<<<<<<<<<<<<<
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *     buf[0] |= is_complete
*/
    }
  }

  /* "cython/core/pickle.pyx":80
 *         if M < -128 or M > 127 or L < -128 or L > 127:
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *     buf[0] |= is_complete             # <<<<<<<<<<<<<<
 *     result += buf[:i+2]
 *     if not is_complete:
*/
  __pyx_t_3 = 0;
  (__pyx_v_buf[__pyx_t_3]) = ((__pyx_v_buf[__pyx_t_3]) | __pyx_v_is_complete);

  /* "cython/core/pickle.pyx":81
 *             raise ValueError('Manifold must be pickled with _to_string.')
 *     buf[0] |= is_complete
 *     result += buf[:i+2]             # <<<<<<<<<<<<<<
 *     if not is_complete:
 *         # Add the Dehn filling coefficients
*/
  __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_buf) + 0, (__pyx_v_i + 2) - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/pickle.pyx":82
 *     buf[0] |= is_complete
 *     result += buf[:i+2]
 *     if not is_complete:             # <<<<<<<<<<<<<<
 *         # Add the Dehn filling coefficients
 *         for j in range(num_cusps):
*/
  __pyx_t_1 = (!(__pyx_v_is_complete != 0));
  if (__pyx_t_1) {

    /* "cython/core/pickle.pyx":84
 *     if not is_complete:
 *         # Add the Dehn filling coefficients
 *         for j in range(num_cusps):             # <<<<<<<<<<<<<<
 *             # The quad double library doesn't support casting qd_real to char.
 *             M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
*/
    __pyx_t_2 = __pyx_v_num_cusps;
    __pyx_t_7 = __pyx_t_2;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_j = __pyx_t_8;

      /* "cython/core/pickle.pyx":86
 *         for j in range(num_cusps):
 *             # The quad double library doesn't support casting qd_real to char.
 *             M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l             # <<<<<<<<<<<<<<
 *             filling[0] = <signed char>M
 *             filling[1] = <signed char>L
*/
      __pyx_t_10 = ((double)(__pyx_v_tri_data->cusp_data[__pyx_v_j]).m);
      __pyx_t_9 = ((double)(__pyx_v_tri_data->cusp_data[__pyx_v_j]).l);
      __pyx_v_M = __pyx_t_10;
      __pyx_v_L = __pyx_t_9;

      /* "cython/core/pickle.pyx":87
 *             # The quad double library doesn't support casting qd_real to char.
 *             M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
 *             filling[0] = <signed char>M             # <<<<<<<<<<<<<<
 *             filling[1] = <signed char>L
 *             result += filling[:2]
*/
      (__pyx_v_filling[0]) = ((signed char)__pyx_v_M);

      /* "cython/core/pickle.pyx":88
 *             M, L = <double>tri_data.cusp_data[j].m, <double>tri_data.cusp_data[j].l
 *             filling[0] = <signed char>M
 *             filling[1] = <signed char>L             # <<<<<<<<<<<<<<
 *             result += filling[:2]
 *     for j in range(tri_data.num_tetrahedra):
*/
      (__pyx_v_filling[1]) = ((signed char)__pyx_v_L);

      /* "cython/core/pickle.pyx":89
 *             filling[0] = <signed char>M
 *             filling[1] = <signed char>L
 *             result += filling[:2]             # <<<<<<<<<<<<<<
 *     for j in range(tri_data.num_tetrahedra):
 *         result += pickle_tetrahedron_data(&tri_data.tetrahedron_data[j], flag)
*/
      __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_filling) + 0, 2 - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
    }

    /* "cython/core/pickle.pyx":82
 *     buf[0] |= is_complete
 *     result += buf[:i+2]
 *     if not is_complete:             # <<<<<<<<<<<<<<
 *         # Add the Dehn filling coefficients
 *         for j in range(num_cusps):
*/
  }

  /* "cython/core/pickle.pyx":90
 *             filling[1] = <signed char>L
 *             result += filling[:2]
 *     for j in range(tri_data.num_tetrahedra):             # <<<<<<<<<<<<<<
 *         result += pickle_tetrahedron_data(&tri_data.tetrahedron_data[j], flag)
 *     return result + bytes(tri_data.name)
*/
  __pyx_t_2 = __pyx_v_tri_data->num_tetrahedra;
  __pyx_t_7 = __pyx_t_2;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_j = __pyx_t_8;

    /* "cython/core/pickle.pyx":91
 *             result += filling[:2]
 *     for j in range(tri_data.num_tetrahedra):
 *         result += pickle_tetrahedron_data(&tri_data.tetrahedron_data[j], flag)             # <<<<<<<<<<<<<<
 *     return result + bytes(tri_data.name)
 * 
*/
    __pyx_t_4 = __pyx_f_8SnapPyHP_pickle_tetrahedron_data((&(__pyx_v_tri_data->tetrahedron_data[__pyx_v_j])), __pyx_v_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
    __pyx_t_5 = 0;
  }

  /* "cython/core/pickle.pyx":92
 *     for j in range(tri_data.num_tetrahedra):
 *         result += pickle_tetrahedron_data(&tri_data.tetrahedron_data[j], flag)
 *     return result + bytes(tri_data.name)             # <<<<<<<<<<<<<<
 * 
 * cdef pickle_tetrahedron_data(c_TetrahedronData* data, int flag):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)(&PyBytes_Type));
  __pyx_t_12 = ((PyObject *)(&PyBytes_Type)); 
  __pyx_t_14 = __Pyx_PyBytes_FromString(__pyx_v_tri_data->name); if (unlikely(!__pyx_t_14)) __PYX_ERR(12, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_14};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_12 = PyNumber_Add(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_12;
  __pyx_t_12 = 0;
  goto __pyx_L0;

  /* "cython/core/pickle.pyx":31
 * cdef IS_COMPLETE = <unsigned char> 1 << 5
 * 
 * cdef pickle_triangulation(c_Triangulation *tri):             # <<<<<<<<<<<<<<
 *     """
 *     Pickle a Triangulation by constructing a TriangulationData structure
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.pickle_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/pickle.pyx":94
 *     return result + bytes(tri_data.name)
 * 
 * cdef pickle_tetrahedron_data(c_TetrahedronData* data, int flag):             # <<<<<<<<<<<<<<
 *     cdef int i, j, v, f
 *     cdef Py_ssize_t n = 0
*/

static PyObject *__pyx_f_8SnapPyHP_pickle_tetrahedron_data(TetrahedronData *__pyx_v_data, int __pyx_v_flag) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_v;
  int __pyx_v_f;
  Py_ssize_t __pyx_v_n;
  unsigned short __pyx_v_mask;
  unsigned short __pyx_v_bit;
  int __pyx_v_x;
  int __pyx_v_count;
  int __pyx_v_curve;
  signed char __pyx_v_curve_buf[16];
  unsigned char __pyx_v_buffer[16];
  PyObject *__pyx_v_result = NULL;
  int *__pyx_v_perm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pickle_tetrahedron_data", 0);

  /* "cython/core/pickle.pyx":96
 * cdef pickle_tetrahedron_data(c_TetrahedronData* data, int flag):
 *     cdef int i, j, v, f
 *     cdef Py_ssize_t n = 0             # <<<<<<<<<<<<<<
 *     cdef unsigned short mask, bit
 *     cdef int x, count, curve
*/
  __pyx_v_n = 0;

  /* "cython/core/pickle.pyx":102
 *     cdef unsigned char buffer[16]
 * 
 *     result = bytes()             # <<<<<<<<<<<<<<
 *     # If this tet is in a huge or big triangulation then we use 4 or 2
 *     # bytes in network order to represent the indices of neighbors.
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)(&PyBytes_Type));
  __pyx_t_3 = ((PyObject *)(&PyBytes_Type)); 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/pickle.pyx":105
 *     # If this tet is in a huge or big triangulation then we use 4 or 2
 *     # bytes in network order to represent the indices of neighbors.
 *     if flag & IS_HUGE:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             x = data.neighbor_index[i]
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_v_8SnapPyHP_IS_HUGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 105, __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(12, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "cython/core/pickle.pyx":106
 *     # bytes in network order to represent the indices of neighbors.
 *     if flag & IS_HUGE:
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             x = data.neighbor_index[i]
 *             buffer[n] = (x >> 24)
*/
    for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cython/core/pickle.pyx":107
 *     if flag & IS_HUGE:
 *         for i in range(4):
 *             x = data.neighbor_index[i]             # <<<<<<<<<<<<<<
 *             buffer[n] = (x >> 24)
 *             buffer[n + 1] = (x >> 16) & 0xff
*/
      __pyx_v_x = (__pyx_v_data->neighbor_index[__pyx_v_i]);

      /* "cython/core/pickle.pyx":108
 *         for i in range(4):
 *             x = data.neighbor_index[i]
 *             buffer[n] = (x >> 24)             # <<<<<<<<<<<<<<
 *             buffer[n + 1] = (x >> 16) & 0xff
 *             buffer[n + 2] = (x >> 8) & 0xff
*/
      (__pyx_v_buffer[__pyx_v_n]) = (__pyx_v_x >> 24);

      /* "cython/core/pickle.pyx":109
 *             x = data.neighbor_index[i]
 *             buffer[n] = (x >> 24)
 *             buffer[n + 1] = (x >> 16) & 0xff             # <<<<<<<<<<<<<<
 *             buffer[n + 2] = (x >> 8) & 0xff
 *             buffer[n + 3] = x & 0xff
*/
      (__pyx_v_buffer[(__pyx_v_n + 1)]) = ((__pyx_v_x >> 16) & 0xff);

      /* "cython/core/pickle.pyx":110
 *             buffer[n] = (x >> 24)
 *             buffer[n + 1] = (x >> 16) & 0xff
 *             buffer[n + 2] = (x >> 8) & 0xff             # <<<<<<<<<<<<<<
 *             buffer[n + 3] = x & 0xff
 *             n += 4
*/
      (__pyx_v_buffer[(__pyx_v_n + 2)]) = ((__pyx_v_x >> 8) & 0xff);

      /* "cython/core/pickle.pyx":111
 *             buffer[n + 1] = (x >> 16) & 0xff
 *             buffer[n + 2] = (x >> 8) & 0xff
 *             buffer[n + 3] = x & 0xff             # <<<<<<<<<<<<<<
 *             n += 4
 *     elif flag & IS_BIG:
*/
      (__pyx_v_buffer[(__pyx_v_n + 3)]) = (__pyx_v_x & 0xff);

      /* "cython/core/pickle.pyx":112
 *             buffer[n + 2] = (x >> 8) & 0xff
 *             buffer[n + 3] = x & 0xff
 *             n += 4             # <<<<<<<<<<<<<<
 *     elif flag & IS_BIG:
 *         for i in range(4):
*/
      __pyx_v_n = (__pyx_v_n + 4);
    }

    /* "cython/core/pickle.pyx":105
 *     # If this tet is in a huge or big triangulation then we use 4 or 2
 *     # bytes in network order to represent the indices of neighbors.
 *     if flag & IS_HUGE:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             x = data.neighbor_index[i]
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":113
 *             buffer[n + 3] = x & 0xff
 *             n += 4
 *     elif flag & IS_BIG:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             x = data.neighbor_index[i]
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_v_8SnapPyHP_IS_BIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(12, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "cython/core/pickle.pyx":114
 *             n += 4
 *     elif flag & IS_BIG:
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             x = data.neighbor_index[i]
 *             buffer[n] = (x >> 8)
*/
    for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cython/core/pickle.pyx":115
 *     elif flag & IS_BIG:
 *         for i in range(4):
 *             x = data.neighbor_index[i]             # <<<<<<<<<<<<<<
 *             buffer[n] = (x >> 8)
 *             buffer[n + 1] = x & 0xff
*/
      __pyx_v_x = (__pyx_v_data->neighbor_index[__pyx_v_i]);

      /* "cython/core/pickle.pyx":116
 *         for i in range(4):
 *             x = data.neighbor_index[i]
 *             buffer[n] = (x >> 8)             # <<<<<<<<<<<<<<
 *             buffer[n + 1] = x & 0xff
 *             n += 2
*/
      (__pyx_v_buffer[__pyx_v_n]) = (__pyx_v_x >> 8);

      /* "cython/core/pickle.pyx":117
 *             x = data.neighbor_index[i]
 *             buffer[n] = (x >> 8)
 *             buffer[n + 1] = x & 0xff             # <<<<<<<<<<<<<<
 *             n += 2
 *     else:
*/
      (__pyx_v_buffer[(__pyx_v_n + 1)]) = (__pyx_v_x & 0xff);

      /* "cython/core/pickle.pyx":118
 *             buffer[n] = (x >> 8)
 *             buffer[n + 1] = x & 0xff
 *             n += 2             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(4):
*/
      __pyx_v_n = (__pyx_v_n + 2);
    }

    /* "cython/core/pickle.pyx":113
 *             buffer[n + 3] = x & 0xff
 *             n += 4
 *     elif flag & IS_BIG:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             x = data.neighbor_index[i]
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":120
 *             n += 2
 *     else:
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             buffer[n] = data.neighbor_index[i]
 *             n += 1
*/
  /*else*/ {
    for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cython/core/pickle.pyx":121
 *     else:
 *         for i in range(4):
 *             buffer[n] = data.neighbor_index[i]             # <<<<<<<<<<<<<<
 *             n += 1
 * 
*/
      (__pyx_v_buffer[__pyx_v_n]) = (__pyx_v_data->neighbor_index[__pyx_v_i]);

      /* "cython/core/pickle.pyx":122
 *         for i in range(4):
 *             buffer[n] = data.neighbor_index[i]
 *             n += 1             # <<<<<<<<<<<<<<
 * 
 *     # Pack each permutation into a byte, like SnapPea does.
*/
      __pyx_v_n = (__pyx_v_n + 1);
    }
  }
  __pyx_L3:;

  /* "cython/core/pickle.pyx":126
 *     # Pack each permutation into a byte, like SnapPea does.
 *     cdef int *perm
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         perm = &data.gluing[i][0]
 *         buffer[n] = perm[0] | perm[1]<<2 | perm[2]<<4 | perm[3]<<6
*/
  for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cython/core/pickle.pyx":127
 *     cdef int *perm
 *     for i in range(4):
 *         perm = &data.gluing[i][0]             # <<<<<<<<<<<<<<
 *         buffer[n] = perm[0] | perm[1]<<2 | perm[2]<<4 | perm[3]<<6
 *         n += 1
*/
    __pyx_v_perm = (&((__pyx_v_data->gluing[__pyx_v_i])[0]));

    /* "cython/core/pickle.pyx":128
 *     for i in range(4):
 *         perm = &data.gluing[i][0]
 *         buffer[n] = perm[0] | perm[1]<<2 | perm[2]<<4 | perm[3]<<6             # <<<<<<<<<<<<<<
 *         n += 1
 * 
*/
    (__pyx_v_buffer[__pyx_v_n]) = ((((__pyx_v_perm[0]) | ((__pyx_v_perm[1]) << 2)) | ((__pyx_v_perm[2]) << 4)) | ((__pyx_v_perm[3]) << 6));

    /* "cython/core/pickle.pyx":129
 *         perm = &data.gluing[i][0]
 *         buffer[n] = perm[0] | perm[1]<<2 | perm[2]<<4 | perm[3]<<6
 *         n += 1             # <<<<<<<<<<<<<<
 * 
 *     # Use 1 byte per cusp index.  This assumes < 256 cusps.
*/
    __pyx_v_n = (__pyx_v_n + 1);
  }

  /* "cython/core/pickle.pyx":132
 * 
 *     # Use 1 byte per cusp index.  This assumes < 256 cusps.
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         buffer[n] = <unsigned char>data.cusp_index[i]
 *         n += 1
*/
  for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cython/core/pickle.pyx":133
 *     # Use 1 byte per cusp index.  This assumes < 256 cusps.
 *     for i in range(4):
 *         buffer[n] = <unsigned char>data.cusp_index[i]             # <<<<<<<<<<<<<<
 *         n += 1
 *     result += buffer[:n]
*/
    (__pyx_v_buffer[__pyx_v_n]) = ((unsigned char)(__pyx_v_data->cusp_index[__pyx_v_i]));

    /* "cython/core/pickle.pyx":134
 *     for i in range(4):
 *         buffer[n] = <unsigned char>data.cusp_index[i]
 *         n += 1             # <<<<<<<<<<<<<<
 *     result += buffer[:n]
 * 
*/
    __pyx_v_n = (__pyx_v_n + 1);
  }

  /* "cython/core/pickle.pyx":135
 *         buffer[n] = <unsigned char>data.cusp_index[i]
 *         n += 1
 *     result += buffer[:n]             # <<<<<<<<<<<<<<
 * 
 *     # The curve data consists of 64 integers, which are often mostly
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_buffer) + 0, __pyx_v_n - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cython/core/pickle.pyx":143
 *     # network order, followed by one byte for each nonzero bit in the
 *     # mask.
 *     for i in range(2):             # <<<<<<<<<<<<<<
 *         for j in range(2):
 *             mask = 0
*/
  for (__pyx_t_6 = 0; __pyx_t_6 < 2; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cython/core/pickle.pyx":144
 *     # mask.
 *     for i in range(2):
 *         for j in range(2):             # <<<<<<<<<<<<<<
 *             mask = 0
 *             count = 0
*/
    for (__pyx_t_7 = 0; __pyx_t_7 < 2; __pyx_t_7+=1) {
      __pyx_v_j = __pyx_t_7;

      /* "cython/core/pickle.pyx":145
 *     for i in range(2):
 *         for j in range(2):
 *             mask = 0             # <<<<<<<<<<<<<<
 *             count = 0
 *             bit = 1
*/
      __pyx_v_mask = 0;

      /* "cython/core/pickle.pyx":146
 *         for j in range(2):
 *             mask = 0
 *             count = 0             # <<<<<<<<<<<<<<
 *             bit = 1
 *             for v in range(4):
*/
      __pyx_v_count = 0;

      /* "cython/core/pickle.pyx":147
 *             mask = 0
 *             count = 0
 *             bit = 1             # <<<<<<<<<<<<<<
 *             for v in range(4):
 *                 for f in range(4):
*/
      __pyx_v_bit = 1;

      /* "cython/core/pickle.pyx":148
 *             count = 0
 *             bit = 1
 *             for v in range(4):             # <<<<<<<<<<<<<<
 *                 for f in range(4):
 *                     curve = data.curve[i][j][v][f]
*/
      for (__pyx_t_8 = 0; __pyx_t_8 < 4; __pyx_t_8+=1) {
        __pyx_v_v = __pyx_t_8;

        /* "cython/core/pickle.pyx":149
 *             bit = 1
 *             for v in range(4):
 *                 for f in range(4):             # <<<<<<<<<<<<<<
 *                     curve = data.curve[i][j][v][f]
 *                     if curve != 0:
*/
        for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) {
          __pyx_v_f = __pyx_t_9;

          /* "cython/core/pickle.pyx":150
 *             for v in range(4):
 *                 for f in range(4):
 *                     curve = data.curve[i][j][v][f]             # <<<<<<<<<<<<<<
 *                     if curve != 0:
 *                         mask |= bit
*/
          __pyx_v_curve = ((((__pyx_v_data->curve[__pyx_v_i])[__pyx_v_j])[__pyx_v_v])[__pyx_v_f]);

          /* "cython/core/pickle.pyx":151
 *                 for f in range(4):
 *                     curve = data.curve[i][j][v][f]
 *                     if curve != 0:             # <<<<<<<<<<<<<<
 *                         mask |= bit
 *                         curve_buf[count] = <signed char>curve
*/
          __pyx_t_5 = (__pyx_v_curve != 0);
          if (__pyx_t_5) {

            /* "cython/core/pickle.pyx":152
 *                     curve = data.curve[i][j][v][f]
 *                     if curve != 0:
 *                         mask |= bit             # <<<<<<<<<<<<<<
 *                         curve_buf[count] = <signed char>curve
 *                         count += 1
*/
            __pyx_v_mask = (__pyx_v_mask | __pyx_v_bit);

            /* "cython/core/pickle.pyx":153
 *                     if curve != 0:
 *                         mask |= bit
 *                         curve_buf[count] = <signed char>curve             # <<<<<<<<<<<<<<
 *                         count += 1
 *                     bit = bit << 1
*/
            (__pyx_v_curve_buf[__pyx_v_count]) = ((signed char)__pyx_v_curve);

            /* "cython/core/pickle.pyx":154
 *                         mask |= bit
 *                         curve_buf[count] = <signed char>curve
 *                         count += 1             # <<<<<<<<<<<<<<
 *                     bit = bit << 1
 *             buffer[0] = mask >> 8
*/
            __pyx_v_count = (__pyx_v_count + 1);

            /* "cython/core/pickle.pyx":151
 *                 for f in range(4):
 *                     curve = data.curve[i][j][v][f]
 *                     if curve != 0:             # <<<<<<<<<<<<<<
 *                         mask |= bit
 *                         curve_buf[count] = <signed char>curve
*/
          }

          /* "cython/core/pickle.pyx":155
 *                         curve_buf[count] = <signed char>curve
 *                         count += 1
 *                     bit = bit << 1             # <<<<<<<<<<<<<<
 *             buffer[0] = mask >> 8
 *             buffer[1] = mask & 0xff
*/
          __pyx_v_bit = (__pyx_v_bit << 1);
        }
      }

      /* "cython/core/pickle.pyx":156
 *                         count += 1
 *                     bit = bit << 1
 *             buffer[0] = mask >> 8             # <<<<<<<<<<<<<<
 *             buffer[1] = mask & 0xff
 *             # Trust Cython to copy both chars and unsigned chars into our
*/
      (__pyx_v_buffer[0]) = (__pyx_v_mask >> 8);

      /* "cython/core/pickle.pyx":157
 *                     bit = bit << 1
 *             buffer[0] = mask >> 8
 *             buffer[1] = mask & 0xff             # <<<<<<<<<<<<<<
 *             # Trust Cython to copy both chars and unsigned chars into our
 *             # bytes object without changing any bits.
*/
      (__pyx_v_buffer[1]) = (__pyx_v_mask & 0xff);

      /* "cython/core/pickle.pyx":160
 *             # Trust Cython to copy both chars and unsigned chars into our
 *             # bytes object without changing any bits.
 *             result += buffer[:2]             # <<<<<<<<<<<<<<
 *             result += curve_buf[:count]
 *     return result
*/
      __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_buffer) + 0, 2 - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cython/core/pickle.pyx":161
 *             # bytes object without changing any bits.
 *             result += buffer[:2]
 *             result += curve_buf[:count]             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
      __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_curve_buf) + 0, __pyx_v_count - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;
    }
  }

  /* "cython/core/pickle.pyx":162
 *             result += buffer[:2]
 *             result += curve_buf[:count]
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef c_Triangulation* unpickle_triangulation(bytes pickle) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/pickle.pyx":94
 *     return result + bytes(tri_data.name)
 * 
 * cdef pickle_tetrahedron_data(c_TetrahedronData* data, int flag):             # <<<<<<<<<<<<<<
 *     cdef int i, j, v, f
 *     cdef Py_ssize_t n = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.pickle_tetrahedron_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/pickle.pyx":164
 *     return result
 * 
 * cdef c_Triangulation* unpickle_triangulation(bytes pickle) except *:             # <<<<<<<<<<<<<<
 *     """
 *     Unpickle a Triangulation by deserializing a TriangulationData structure
*/

static Triangulation *__pyx_f_8SnapPyHP_unpickle_triangulation(PyObject *__pyx_v_pickle) {
  TetrahedronData *__pyx_v_tets;
  CuspData *__pyx_v_cusps;
  Triangulation *__pyx_v_tri;
  unsigned char *__pyx_v_p;
  TriangulationData __pyx_v_tri_data;
  int __pyx_v_i;
  int __pyx_v_num_tets;
  int __pyx_v_num_cusps;
  int __pyx_v_M;
  int __pyx_v_L;
  int __pyx_v_n;
  PyObject *__pyx_v_header = NULL;
  PyObject *__pyx_v_tri_pickle = NULL;
  PyObject *__pyx_v_py_name = NULL;
  Triangulation *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  unsigned char __pyx_t_9;
  unsigned char __pyx_t_10;
  long __pyx_t_11;
  size_t __pyx_t_12;
  int __pyx_t_13;
  char *__pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unpickle_triangulation", 0);

  /* "cython/core/pickle.pyx":169
 *     and then converting it to a Triangulation.
 *     """
 *     cdef c_TetrahedronData* tets = NULL             # <<<<<<<<<<<<<<
 *     cdef c_CuspData* cusps = NULL
 *     cdef c_Triangulation *tri
*/
  __pyx_v_tets = NULL;

  /* "cython/core/pickle.pyx":170
 *     """
 *     cdef c_TetrahedronData* tets = NULL
 *     cdef c_CuspData* cusps = NULL             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *tri
 *     cdef unsigned char* p
*/
  __pyx_v_cusps = NULL;

  /* "cython/core/pickle.pyx":175
 *     cdef TriangulationData tri_data
 *     cdef int i, num_tets, num_cusps, M, L
 *     cdef int n = 0             # <<<<<<<<<<<<<<
 * 
 *     header, tri_pickle = pickle.split(b':', 1)
*/
  __pyx_v_n = 0;

  /* "cython/core/pickle.pyx":177
 *     cdef int n = 0
 * 
 *     header, tri_pickle = pickle.split(b':', 1)             # <<<<<<<<<<<<<<
 *     assert header == b'pickle', 'Invalid pickle byte sequence'
 *     p = tri_pickle
*/
  __pyx_t_1 = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyBytes_Type__split, __pyx_v_pickle, __pyx_mstate_global->__pyx_kp_b__39, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (1) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PyList_GET_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(12, 177, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
    if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 177, __pyx_L1_error)
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
    if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 177, __pyx_L1_error)
    __Pyx_XGOTREF(__pyx_t_3);
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_header = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_tri_pickle = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/pickle.pyx":178
 * 
 *     header, tri_pickle = pickle.split(b':', 1)
 *     assert header == b'pickle', 'Invalid pickle byte sequence'             # <<<<<<<<<<<<<<
 *     p = tri_pickle
 *     tri_data.solution_type = not_attempted
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__Pyx_PyBytes_Equals(__pyx_v_header, __pyx_mstate_global->__pyx_n_b_pickle_2, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(12, 178, __pyx_L1_error)
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Invalid_pickle_byte_sequence, 0, 0);
      __PYX_ERR(12, 178, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(12, 178, __pyx_L1_error)
  #endif

  /* "cython/core/pickle.pyx":179
 *     header, tri_pickle = pickle.split(b':', 1)
 *     assert header == b'pickle', 'Invalid pickle byte sequence'
 *     p = tri_pickle             # <<<<<<<<<<<<<<
 *     tri_data.solution_type = not_attempted
 *     tri_data.volume = <Real> 0.0
*/
  __pyx_t_5 = __Pyx_PyObject_AsWritableUString(__pyx_v_tri_pickle); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(12, 179, __pyx_L1_error)
  __pyx_v_p = __pyx_t_5;

  /* "cython/core/pickle.pyx":180
 *     assert header == b'pickle', 'Invalid pickle byte sequence'
 *     p = tri_pickle
 *     tri_data.solution_type = not_attempted             # <<<<<<<<<<<<<<
 *     tri_data.volume = <Real> 0.0
 *     tri_data.orientability = <c_Orientability>(p[0] & 0x3)
*/
  __pyx_v_tri_data.solution_type = not_attempted;

  /* "cython/core/pickle.pyx":181
 *     p = tri_pickle
 *     tri_data.solution_type = not_attempted
 *     tri_data.volume = <Real> 0.0             # <<<<<<<<<<<<<<
 *     tri_data.orientability = <c_Orientability>(p[0] & 0x3)
 *     n = 1
*/
  __pyx_v_tri_data.volume = ((__pyx_t_8SnapPyHP_Real)0.0);

  /* "cython/core/pickle.pyx":182
 *     tri_data.solution_type = not_attempted
 *     tri_data.volume = <Real> 0.0
 *     tri_data.orientability = <c_Orientability>(p[0] & 0x3)             # <<<<<<<<<<<<<<
 *     n = 1
 *     if p[0] & IS_HUGE:
*/
  __pyx_v_tri_data.orientability = ((Orientability)((__pyx_v_p[0]) & 0x3));

  /* "cython/core/pickle.pyx":183
 *     tri_data.volume = <Real> 0.0
 *     tri_data.orientability = <c_Orientability>(p[0] & 0x3)
 *     n = 1             # <<<<<<<<<<<<<<
 *     if p[0] & IS_HUGE:
 *         num_tets = (<int>p[n]) << 24 | (<int>p[n+1]) << 16 | (<int>p[n+2]) << 8 | (<int>p[n+3])
*/
  __pyx_v_n = 1;

  /* "cython/core/pickle.pyx":184
 *     tri_data.orientability = <c_Orientability>(p[0] & 0x3)
 *     n = 1
 *     if p[0] & IS_HUGE:             # <<<<<<<<<<<<<<
 *         num_tets = (<int>p[n]) << 24 | (<int>p[n+1]) << 16 | (<int>p[n+2]) << 8 | (<int>p[n+3])
 *         n += 4
*/
  __pyx_t_1 = __Pyx_PyLong_From_unsigned_char((__pyx_v_p[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_v_8SnapPyHP_IS_HUGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(12, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "cython/core/pickle.pyx":185
 *     n = 1
 *     if p[0] & IS_HUGE:
 *         num_tets = (<int>p[n]) << 24 | (<int>p[n+1]) << 16 | (<int>p[n+2]) << 8 | (<int>p[n+3])             # <<<<<<<<<<<<<<
 *         n += 4
 *     elif p[0] & IS_BIG:
*/
    __pyx_v_num_tets = ((((((int)(__pyx_v_p[__pyx_v_n])) << 24) | (((int)(__pyx_v_p[(__pyx_v_n + 1)])) << 16)) | (((int)(__pyx_v_p[(__pyx_v_n + 2)])) << 8)) | ((int)(__pyx_v_p[(__pyx_v_n + 3)])));

    /* "cython/core/pickle.pyx":186
 *     if p[0] & IS_HUGE:
 *         num_tets = (<int>p[n]) << 24 | (<int>p[n+1]) << 16 | (<int>p[n+2]) << 8 | (<int>p[n+3])
 *         n += 4             # <<<<<<<<<<<<<<
 *     elif p[0] & IS_BIG:
 *         num_tets = (<int>p[n]) << 8 | (<int>p[n+1])
*/
    __pyx_v_n = (__pyx_v_n + 4);

    /* "cython/core/pickle.pyx":184
 *     tri_data.orientability = <c_Orientability>(p[0] & 0x3)
 *     n = 1
 *     if p[0] & IS_HUGE:             # <<<<<<<<<<<<<<
 *         num_tets = (<int>p[n]) << 24 | (<int>p[n+1]) << 16 | (<int>p[n+2]) << 8 | (<int>p[n+3])
 *         n += 4
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":187
 *         num_tets = (<int>p[n]) << 24 | (<int>p[n+1]) << 16 | (<int>p[n+2]) << 8 | (<int>p[n+3])
 *         n += 4
 *     elif p[0] & IS_BIG:             # <<<<<<<<<<<<<<
 *         num_tets = (<int>p[n]) << 8 | (<int>p[n+1])
 *         n += 2
*/
  __pyx_t_3 = __Pyx_PyLong_From_unsigned_char((__pyx_v_p[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_v_8SnapPyHP_IS_BIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(12, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cython/core/pickle.pyx":188
 *         n += 4
 *     elif p[0] & IS_BIG:
 *         num_tets = (<int>p[n]) << 8 | (<int>p[n+1])             # <<<<<<<<<<<<<<
 *         n += 2
 *     else:
*/
    __pyx_v_num_tets = ((((int)(__pyx_v_p[__pyx_v_n])) << 8) | ((int)(__pyx_v_p[(__pyx_v_n + 1)])));

    /* "cython/core/pickle.pyx":189
 *     elif p[0] & IS_BIG:
 *         num_tets = (<int>p[n]) << 8 | (<int>p[n+1])
 *         n += 2             # <<<<<<<<<<<<<<
 *     else:
 *         num_tets = p[n]
*/
    __pyx_v_n = (__pyx_v_n + 2);

    /* "cython/core/pickle.pyx":187
 *         num_tets = (<int>p[n]) << 24 | (<int>p[n+1]) << 16 | (<int>p[n+2]) << 8 | (<int>p[n+3])
 *         n += 4
 *     elif p[0] & IS_BIG:             # <<<<<<<<<<<<<<
 *         num_tets = (<int>p[n]) << 8 | (<int>p[n+1])
 *         n += 2
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":191
 *         n += 2
 *     else:
 *         num_tets = p[n]             # <<<<<<<<<<<<<<
 *         n += 1
 *     tri_data.num_tetrahedra = num_tets
*/
  /*else*/ {
    __pyx_v_num_tets = (__pyx_v_p[__pyx_v_n]);

    /* "cython/core/pickle.pyx":192
 *     else:
 *         num_tets = p[n]
 *         n += 1             # <<<<<<<<<<<<<<
 *     tri_data.num_tetrahedra = num_tets
 *     tri_data.num_or_cusps = p[n]
*/
    __pyx_v_n = (__pyx_v_n + 1);
  }
  __pyx_L3:;

  /* "cython/core/pickle.pyx":193
 *         num_tets = p[n]
 *         n += 1
 *     tri_data.num_tetrahedra = num_tets             # <<<<<<<<<<<<<<
 *     tri_data.num_or_cusps = p[n]
 *     tri_data.num_nonor_cusps = p[n+1]
*/
  __pyx_v_tri_data.num_tetrahedra = __pyx_v_num_tets;

  /* "cython/core/pickle.pyx":194
 *         n += 1
 *     tri_data.num_tetrahedra = num_tets
 *     tri_data.num_or_cusps = p[n]             # <<<<<<<<<<<<<<
 *     tri_data.num_nonor_cusps = p[n+1]
 *     tri_data.CS_value_is_known = 0
*/
  __pyx_v_tri_data.num_or_cusps = (__pyx_v_p[__pyx_v_n]);

  /* "cython/core/pickle.pyx":195
 *     tri_data.num_tetrahedra = num_tets
 *     tri_data.num_or_cusps = p[n]
 *     tri_data.num_nonor_cusps = p[n+1]             # <<<<<<<<<<<<<<
 *     tri_data.CS_value_is_known = 0
 *     tri_data.CS_value = <Real>0.0
*/
  __pyx_v_tri_data.num_nonor_cusps = (__pyx_v_p[(__pyx_v_n + 1)]);

  /* "cython/core/pickle.pyx":196
 *     tri_data.num_or_cusps = p[n]
 *     tri_data.num_nonor_cusps = p[n+1]
 *     tri_data.CS_value_is_known = 0             # <<<<<<<<<<<<<<
 *     tri_data.CS_value = <Real>0.0
 *     n += 2
*/
  __pyx_v_tri_data.CS_value_is_known = 0;

  /* "cython/core/pickle.pyx":197
 *     tri_data.num_nonor_cusps = p[n+1]
 *     tri_data.CS_value_is_known = 0
 *     tri_data.CS_value = <Real>0.0             # <<<<<<<<<<<<<<
 *     n += 2
 * 
*/
  __pyx_v_tri_data.CS_value = ((__pyx_t_8SnapPyHP_Real)0.0);

  /* "cython/core/pickle.pyx":198
 *     tri_data.CS_value_is_known = 0
 *     tri_data.CS_value = <Real>0.0
 *     n += 2             # <<<<<<<<<<<<<<
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
*/
  __pyx_v_n = (__pyx_v_n + 2);

  /* "cython/core/pickle.pyx":200
 *     n += 2
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps             # <<<<<<<<<<<<<<
 *     if num_cusps > 0:
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
*/
  __pyx_v_num_cusps = (__pyx_v_tri_data.num_or_cusps + __pyx_v_tri_data.num_nonor_cusps);

  /* "cython/core/pickle.pyx":201
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
 *     if num_cusps > 0:             # <<<<<<<<<<<<<<
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
 *         # data.  We free the memory before returning.
*/
  __pyx_t_4 = (__pyx_v_num_cusps > 0);
  if (__pyx_t_4) {

    /* "cython/core/pickle.pyx":204
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
 *         # data.  We free the memory before returning.
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))             # <<<<<<<<<<<<<<
 *         if cusps:
 *             if p[0] & IS_COMPLETE:
*/
    __pyx_v_cusps = ((CuspData *)malloc((__pyx_v_num_cusps * (sizeof(CuspData)))));

    /* "cython/core/pickle.pyx":205
 *         # data.  We free the memory before returning.
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))
 *         if cusps:             # <<<<<<<<<<<<<<
 *             if p[0] & IS_COMPLETE:
 *                 for i in range(tri_data.num_or_cusps):
*/
    __pyx_t_4 = (__pyx_v_cusps != 0);
    if (likely(__pyx_t_4)) {

      /* "cython/core/pickle.pyx":206
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))
 *         if cusps:
 *             if p[0] & IS_COMPLETE:             # <<<<<<<<<<<<<<
 *                 for i in range(tri_data.num_or_cusps):
 *                     cusps[i].topology = torus_cusp
*/
      __pyx_t_1 = __Pyx_PyLong_From_unsigned_char((__pyx_v_p[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_v_8SnapPyHP_IS_COMPLETE); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(12, 206, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {

        /* "cython/core/pickle.pyx":207
 *         if cusps:
 *             if p[0] & IS_COMPLETE:
 *                 for i in range(tri_data.num_or_cusps):             # <<<<<<<<<<<<<<
 *                     cusps[i].topology = torus_cusp
 *                     cusps[i].m = <Real>0.0
*/
        __pyx_t_6 = __pyx_v_tri_data.num_or_cusps;
        __pyx_t_7 = __pyx_t_6;
        for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
          __pyx_v_i = __pyx_t_8;

          /* "cython/core/pickle.pyx":208
 *             if p[0] & IS_COMPLETE:
 *                 for i in range(tri_data.num_or_cusps):
 *                     cusps[i].topology = torus_cusp             # <<<<<<<<<<<<<<
 *                     cusps[i].m = <Real>0.0
 *                     cusps[i].l = <Real>0.0
*/
          (__pyx_v_cusps[__pyx_v_i]).topology = torus_cusp;

          /* "cython/core/pickle.pyx":209
 *                 for i in range(tri_data.num_or_cusps):
 *                     cusps[i].topology = torus_cusp
 *                     cusps[i].m = <Real>0.0             # <<<<<<<<<<<<<<
 *                     cusps[i].l = <Real>0.0
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
*/
          (__pyx_v_cusps[__pyx_v_i]).m = ((__pyx_t_8SnapPyHP_Real)0.0);

          /* "cython/core/pickle.pyx":210
 *                     cusps[i].topology = torus_cusp
 *                     cusps[i].m = <Real>0.0
 *                     cusps[i].l = <Real>0.0             # <<<<<<<<<<<<<<
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
 *                     cusps[i].topology = Klein_cusp
*/
          (__pyx_v_cusps[__pyx_v_i]).l = ((__pyx_t_8SnapPyHP_Real)0.0);
        }

        /* "cython/core/pickle.pyx":211
 *                     cusps[i].m = <Real>0.0
 *                     cusps[i].l = <Real>0.0
 *                 for i in range(tri_data.num_or_cusps, num_cusps):             # <<<<<<<<<<<<<<
 *                     cusps[i].topology = Klein_cusp
 *                     cusps[i].m = <Real>0.0
*/
        __pyx_t_6 = __pyx_v_num_cusps;
        __pyx_t_7 = __pyx_t_6;
        for (__pyx_t_8 = __pyx_v_tri_data.num_or_cusps; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
          __pyx_v_i = __pyx_t_8;

          /* "cython/core/pickle.pyx":212
 *                     cusps[i].l = <Real>0.0
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
 *                     cusps[i].topology = Klein_cusp             # <<<<<<<<<<<<<<
 *                     cusps[i].m = <Real>0.0
 *                     cusps[i].l = <Real>0.0
*/
          (__pyx_v_cusps[__pyx_v_i]).topology = Klein_cusp;

          /* "cython/core/pickle.pyx":213
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
 *                     cusps[i].topology = Klein_cusp
 *                     cusps[i].m = <Real>0.0             # <<<<<<<<<<<<<<
 *                     cusps[i].l = <Real>0.0
 *             else:
*/
          (__pyx_v_cusps[__pyx_v_i]).m = ((__pyx_t_8SnapPyHP_Real)0.0);

          /* "cython/core/pickle.pyx":214
 *                     cusps[i].topology = Klein_cusp
 *                     cusps[i].m = <Real>0.0
 *                     cusps[i].l = <Real>0.0             # <<<<<<<<<<<<<<
 *             else:
 *                 for i in range(tri_data.num_or_cusps):
*/
          (__pyx_v_cusps[__pyx_v_i]).l = ((__pyx_t_8SnapPyHP_Real)0.0);
        }

        /* "cython/core/pickle.pyx":206
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))
 *         if cusps:
 *             if p[0] & IS_COMPLETE:             # <<<<<<<<<<<<<<
 *                 for i in range(tri_data.num_or_cusps):
 *                     cusps[i].topology = torus_cusp
*/
        goto __pyx_L6;
      }

      /* "cython/core/pickle.pyx":216
 *                     cusps[i].l = <Real>0.0
 *             else:
 *                 for i in range(tri_data.num_or_cusps):             # <<<<<<<<<<<<<<
 *                     M, L, n = p[n], p[n+1], n + 2
 *                     cusps[i].topology = torus_cusp
*/
      /*else*/ {
        __pyx_t_6 = __pyx_v_tri_data.num_or_cusps;
        __pyx_t_7 = __pyx_t_6;
        for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
          __pyx_v_i = __pyx_t_8;

          /* "cython/core/pickle.pyx":217
 *             else:
 *                 for i in range(tri_data.num_or_cusps):
 *                     M, L, n = p[n], p[n+1], n + 2             # <<<<<<<<<<<<<<
 *                     cusps[i].topology = torus_cusp
 *                     cusps[i].m = <Real>M
*/
          __pyx_t_9 = (__pyx_v_p[__pyx_v_n]);
          __pyx_t_10 = (__pyx_v_p[(__pyx_v_n + 1)]);
          __pyx_t_11 = (__pyx_v_n + 2);
          __pyx_v_M = __pyx_t_9;
          __pyx_v_L = __pyx_t_10;
          __pyx_v_n = __pyx_t_11;

          /* "cython/core/pickle.pyx":218
 *                 for i in range(tri_data.num_or_cusps):
 *                     M, L, n = p[n], p[n+1], n + 2
 *                     cusps[i].topology = torus_cusp             # <<<<<<<<<<<<<<
 *                     cusps[i].m = <Real>M
 *                     cusps[i].l = <Real>L
*/
          (__pyx_v_cusps[__pyx_v_i]).topology = torus_cusp;

          /* "cython/core/pickle.pyx":219
 *                     M, L, n = p[n], p[n+1], n + 2
 *                     cusps[i].topology = torus_cusp
 *                     cusps[i].m = <Real>M             # <<<<<<<<<<<<<<
 *                     cusps[i].l = <Real>L
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
*/
          (__pyx_v_cusps[__pyx_v_i]).m = ((__pyx_t_8SnapPyHP_Real)__pyx_v_M);

          /* "cython/core/pickle.pyx":220
 *                     cusps[i].topology = torus_cusp
 *                     cusps[i].m = <Real>M
 *                     cusps[i].l = <Real>L             # <<<<<<<<<<<<<<
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
 *                     M, L, n = p[n], p[n+1], n + 2
*/
          (__pyx_v_cusps[__pyx_v_i]).l = ((__pyx_t_8SnapPyHP_Real)__pyx_v_L);
        }

        /* "cython/core/pickle.pyx":221
 *                     cusps[i].m = <Real>M
 *                     cusps[i].l = <Real>L
 *                 for i in range(tri_data.num_or_cusps, num_cusps):             # <<<<<<<<<<<<<<
 *                     M, L, n = p[n], p[n+1], n + 2
 *                     cusps[i].topology = Klein_cusp
*/
        __pyx_t_6 = __pyx_v_num_cusps;
        __pyx_t_7 = __pyx_t_6;
        for (__pyx_t_8 = __pyx_v_tri_data.num_or_cusps; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
          __pyx_v_i = __pyx_t_8;

          /* "cython/core/pickle.pyx":222
 *                     cusps[i].l = <Real>L
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
 *                     M, L, n = p[n], p[n+1], n + 2             # <<<<<<<<<<<<<<
 *                     cusps[i].topology = Klein_cusp
 *                     cusps[i].m = <Real>M
*/
          __pyx_t_10 = (__pyx_v_p[__pyx_v_n]);
          __pyx_t_9 = (__pyx_v_p[(__pyx_v_n + 1)]);
          __pyx_t_11 = (__pyx_v_n + 2);
          __pyx_v_M = __pyx_t_10;
          __pyx_v_L = __pyx_t_9;
          __pyx_v_n = __pyx_t_11;

          /* "cython/core/pickle.pyx":223
 *                 for i in range(tri_data.num_or_cusps, num_cusps):
 *                     M, L, n = p[n], p[n+1], n + 2
 *                     cusps[i].topology = Klein_cusp             # <<<<<<<<<<<<<<
 *                     cusps[i].m = <Real>M
 *                     cusps[i].l = <Real>L
*/
          (__pyx_v_cusps[__pyx_v_i]).topology = Klein_cusp;

          /* "cython/core/pickle.pyx":224
 *                     M, L, n = p[n], p[n+1], n + 2
 *                     cusps[i].topology = Klein_cusp
 *                     cusps[i].m = <Real>M             # <<<<<<<<<<<<<<
 *                     cusps[i].l = <Real>L
 *         else:
*/
          (__pyx_v_cusps[__pyx_v_i]).m = ((__pyx_t_8SnapPyHP_Real)__pyx_v_M);

          /* "cython/core/pickle.pyx":225
 *                     cusps[i].topology = Klein_cusp
 *                     cusps[i].m = <Real>M
 *                     cusps[i].l = <Real>L             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError('Failed to allocate memory for cusps')
*/
          (__pyx_v_cusps[__pyx_v_i]).l = ((__pyx_t_8SnapPyHP_Real)__pyx_v_L);
        }
      }
      __pyx_L6:;

      /* "cython/core/pickle.pyx":205
 *         # data.  We free the memory before returning.
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))
 *         if cusps:             # <<<<<<<<<<<<<<
 *             if p[0] & IS_COMPLETE:
 *                 for i in range(tri_data.num_or_cusps):
*/
      goto __pyx_L5;
    }

    /* "cython/core/pickle.pyx":227
 *                     cusps[i].l = <Real>L
 *         else:
 *             raise RuntimeError('Failed to allocate memory for cusps')             # <<<<<<<<<<<<<<
 *     tri_data.cusp_data = cusps
 * 
*/
    /*else*/ {
      __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_builtin_RuntimeError);
      __pyx_t_2 = __pyx_builtin_RuntimeError; 
      __pyx_t_12 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Failed_to_allocate_memory_for_cu};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 227, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(12, 227, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "cython/core/pickle.pyx":201
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
 *     if num_cusps > 0:             # <<<<<<<<<<<<<<
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
 *         # data.  We free the memory before returning.
*/
  }

  /* "cython/core/pickle.pyx":228
 *         else:
 *             raise RuntimeError('Failed to allocate memory for cusps')
 *     tri_data.cusp_data = cusps             # <<<<<<<<<<<<<<
 * 
 *     # Use malloc (not mymalloc) to allocate memory for the tetrahedra
*/
  __pyx_v_tri_data.cusp_data = __pyx_v_cusps;

  /* "cython/core/pickle.pyx":232
 *     # Use malloc (not mymalloc) to allocate memory for the tetrahedra
 *     # data.  We free the memory before returning.
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))             # <<<<<<<<<<<<<<
 *     if tets == NULL:
 *         free(cusps)
*/
  __pyx_v_tets = ((TetrahedronData *)malloc((__pyx_v_num_tets * (sizeof(TetrahedronData)))));

  /* "cython/core/pickle.pyx":233
 *     # data.  We free the memory before returning.
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))
 *     if tets == NULL:             # <<<<<<<<<<<<<<
 *         free(cusps)
 *         raise RuntimeError('Failed to allocate memory for tets.')
*/
  __pyx_t_4 = (__pyx_v_tets == NULL);
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/pickle.pyx":234
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))
 *     if tets == NULL:
 *         free(cusps)             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Failed to allocate memory for tets.')
 *     for i in range(tri_data.num_tetrahedra):
*/
    free(__pyx_v_cusps);

    /* "cython/core/pickle.pyx":235
 *     if tets == NULL:
 *         free(cusps)
 *         raise RuntimeError('Failed to allocate memory for tets.')             # <<<<<<<<<<<<<<
 *     for i in range(tri_data.num_tetrahedra):
 *         n = unpickle_tetrahedron_data(&tets[i], tri_pickle, n, p[0])
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_1 = __pyx_builtin_RuntimeError; 
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Failed_to_allocate_memory_for_te};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(12, 235, __pyx_L1_error)

    /* "cython/core/pickle.pyx":233
 *     # data.  We free the memory before returning.
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))
 *     if tets == NULL:             # <<<<<<<<<<<<<<
 *         free(cusps)
 *         raise RuntimeError('Failed to allocate memory for tets.')
*/
  }

  /* "cython/core/pickle.pyx":236
 *         free(cusps)
 *         raise RuntimeError('Failed to allocate memory for tets.')
 *     for i in range(tri_data.num_tetrahedra):             # <<<<<<<<<<<<<<
 *         n = unpickle_tetrahedron_data(&tets[i], tri_pickle, n, p[0])
 *     tri_data.tetrahedron_data = tets
*/
  __pyx_t_6 = __pyx_v_tri_data.num_tetrahedra;
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "cython/core/pickle.pyx":237
 *         raise RuntimeError('Failed to allocate memory for tets.')
 *     for i in range(tri_data.num_tetrahedra):
 *         n = unpickle_tetrahedron_data(&tets[i], tri_pickle, n, p[0])             # <<<<<<<<<<<<<<
 *     tri_data.tetrahedron_data = tets
 * 
*/
    if (!(likely(PyBytes_CheckExact(__pyx_v_tri_pickle))||((__pyx_v_tri_pickle) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_tri_pickle))) __PYX_ERR(12, 237, __pyx_L1_error)
    __pyx_t_13 = __pyx_f_8SnapPyHP_unpickle_tetrahedron_data((&(__pyx_v_tets[__pyx_v_i])), ((PyObject*)__pyx_v_tri_pickle), __pyx_v_n, (__pyx_v_p[0])); if (unlikely(__pyx_t_13 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(12, 237, __pyx_L1_error)
    __pyx_v_n = __pyx_t_13;
  }

  /* "cython/core/pickle.pyx":238
 *     for i in range(tri_data.num_tetrahedra):
 *         n = unpickle_tetrahedron_data(&tets[i], tri_pickle, n, p[0])
 *     tri_data.tetrahedron_data = tets             # <<<<<<<<<<<<<<
 * 
 *     # Create a new bytes object py_name containing the triangulation name,
*/
  __pyx_v_tri_data.tetrahedron_data = __pyx_v_tets;

  /* "cython/core/pickle.pyx":241
 * 
 *     # Create a new bytes object py_name containing the triangulation name,
 *     py_name = tri_pickle[n:]             # <<<<<<<<<<<<<<
 *     # then set tri_data.name to point to the internal buffer of py_name.
 *     tri_data.name = py_name
*/
  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_tri_pickle, __pyx_v_n, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_py_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/pickle.pyx":243
 *     py_name = tri_pickle[n:]
 *     # then set tri_data.name to point to the internal buffer of py_name.
 *     tri_data.name = py_name             # <<<<<<<<<<<<<<
 *     # Hopefully, Cython takes care of the details.
 * 
*/
  __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_py_name); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(12, 243, __pyx_L1_error)
  __pyx_v_tri_data.name = __pyx_t_14;

  /* "cython/core/pickle.pyx":246
 *     # Hopefully, Cython takes care of the details.
 * 
 *     data_to_triangulation(&tri_data, &tri)             # <<<<<<<<<<<<<<
 *     free(tets)
 *     free(cusps)
*/
  data_to_triangulation((&__pyx_v_tri_data), (&__pyx_v_tri)); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 246, __pyx_L1_error)

  /* "cython/core/pickle.pyx":247
 * 
 *     data_to_triangulation(&tri_data, &tri)
 *     free(tets)             # <<<<<<<<<<<<<<
 *     free(cusps)
 *     return tri
*/
  free(__pyx_v_tets);

  /* "cython/core/pickle.pyx":248
 *     data_to_triangulation(&tri_data, &tri)
 *     free(tets)
 *     free(cusps)             # <<<<<<<<<<<<<<
 *     return tri
 * 
*/
  free(__pyx_v_cusps);

  /* "cython/core/pickle.pyx":249
 *     free(tets)
 *     free(cusps)
 *     return tri             # <<<<<<<<<<<<<<
 * 
 * cdef int unpickle_tetrahedron_data(c_TetrahedronData *data, bytes pickle,
*/
  __pyx_r = __pyx_v_tri;
  goto __pyx_L0;

  /* "cython/core/pickle.pyx":164
 *     return result
 * 
 * cdef c_Triangulation* unpickle_triangulation(bytes pickle) except *:             # <<<<<<<<<<<<<<
 *     """
 *     Unpickle a Triangulation by deserializing a TriangulationData structure
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.unpickle_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_header);
  __Pyx_XDECREF(__pyx_v_tri_pickle);
  __Pyx_XDECREF(__pyx_v_py_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/pickle.pyx":251
 *     return tri
 * 
 * cdef int unpickle_tetrahedron_data(c_TetrahedronData *data, bytes pickle,             # <<<<<<<<<<<<<<
 *                                    int start, int flag) except *:
 *     cdef int i, j, v, f
*/

static int __pyx_f_8SnapPyHP_unpickle_tetrahedron_data(TetrahedronData *__pyx_v_data, PyObject *__pyx_v_pickle, int __pyx_v_start, int __pyx_v_flag) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_v;
  int __pyx_v_f;
  int __pyx_v_n;
  unsigned char __pyx_v_perm;
  unsigned short __pyx_v_mask;
  unsigned short __pyx_v_bit;
  unsigned char *__pyx_v_p;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unpickle_tetrahedron_data", 0);

  /* "cython/core/pickle.pyx":254
 *                                    int start, int flag) except *:
 *     cdef int i, j, v, f
 *     cdef int n = start             # <<<<<<<<<<<<<<
 *     cdef unsigned char perm
 *     cdef unsigned short mask, bit
*/
  __pyx_v_n = __pyx_v_start;

  /* "cython/core/pickle.pyx":258
 *     cdef unsigned short mask, bit
 *     # Cython magic to allow using the internal buffer of the bytes object.
 *     cdef unsigned char* p = pickle             # <<<<<<<<<<<<<<
 * 
 *     # Get the neighbors.
*/
  if (unlikely(__pyx_v_pickle == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(12, 258, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_AsWritableUString(__pyx_v_pickle); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(12, 258, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;

  /* "cython/core/pickle.pyx":261
 * 
 *     # Get the neighbors.
 *     if flag & IS_HUGE:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             data.neighbor_index[i] = ((<int>p[n]) << 24 | (<int>p[n+1]) << 16 |
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_And(__pyx_t_2, __pyx_v_8SnapPyHP_IS_HUGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(12, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "cython/core/pickle.pyx":262
 *     # Get the neighbors.
 *     if flag & IS_HUGE:
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             data.neighbor_index[i] = ((<int>p[n]) << 24 | (<int>p[n+1]) << 16 |
 *                                       (<int>p[n+2]) << 8 | (<int>p[n+3]))
*/
    for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "cython/core/pickle.pyx":263
 *     if flag & IS_HUGE:
 *         for i in range(4):
 *             data.neighbor_index[i] = ((<int>p[n]) << 24 | (<int>p[n+1]) << 16 |             # <<<<<<<<<<<<<<
 *                                       (<int>p[n+2]) << 8 | (<int>p[n+3]))
 *             n += 4
*/
      (__pyx_v_data->neighbor_index[__pyx_v_i]) = ((((((int)(__pyx_v_p[__pyx_v_n])) << 24) | (((int)(__pyx_v_p[(__pyx_v_n + 1)])) << 16)) | (((int)(__pyx_v_p[(__pyx_v_n + 2)])) << 8)) | ((int)(__pyx_v_p[(__pyx_v_n + 3)])));

      /* "cython/core/pickle.pyx":265
 *             data.neighbor_index[i] = ((<int>p[n]) << 24 | (<int>p[n+1]) << 16 |
 *                                       (<int>p[n+2]) << 8 | (<int>p[n+3]))
 *             n += 4             # <<<<<<<<<<<<<<
 *     elif flag & IS_BIG:
 *         for i in range(4):
*/
      __pyx_v_n = (__pyx_v_n + 4);
    }

    /* "cython/core/pickle.pyx":261
 * 
 *     # Get the neighbors.
 *     if flag & IS_HUGE:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             data.neighbor_index[i] = ((<int>p[n]) << 24 | (<int>p[n+1]) << 16 |
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":266
 *                                       (<int>p[n+2]) << 8 | (<int>p[n+3]))
 *             n += 4
 *     elif flag & IS_BIG:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             data.neighbor_index[i] = (<int>p[n] << 8) | (<int>p[n+1])
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_And(__pyx_t_3, __pyx_v_8SnapPyHP_IS_BIG); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(12, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "cython/core/pickle.pyx":267
 *             n += 4
 *     elif flag & IS_BIG:
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             data.neighbor_index[i] = (<int>p[n] << 8) | (<int>p[n+1])
 *             n += 2
*/
    for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "cython/core/pickle.pyx":268
 *     elif flag & IS_BIG:
 *         for i in range(4):
 *             data.neighbor_index[i] = (<int>p[n] << 8) | (<int>p[n+1])             # <<<<<<<<<<<<<<
 *             n += 2
 *     else:
*/
      (__pyx_v_data->neighbor_index[__pyx_v_i]) = ((((int)(__pyx_v_p[__pyx_v_n])) << 8) | ((int)(__pyx_v_p[(__pyx_v_n + 1)])));

      /* "cython/core/pickle.pyx":269
 *         for i in range(4):
 *             data.neighbor_index[i] = (<int>p[n] << 8) | (<int>p[n+1])
 *             n += 2             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(4):
*/
      __pyx_v_n = (__pyx_v_n + 2);
    }

    /* "cython/core/pickle.pyx":266
 *                                       (<int>p[n+2]) << 8 | (<int>p[n+3]))
 *             n += 4
 *     elif flag & IS_BIG:             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             data.neighbor_index[i] = (<int>p[n] << 8) | (<int>p[n+1])
*/
    goto __pyx_L3;
  }

  /* "cython/core/pickle.pyx":271
 *             n += 2
 *     else:
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             data.neighbor_index[i] = <int>p[n]
 *             n += 1
*/
  /*else*/ {
    for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "cython/core/pickle.pyx":272
 *     else:
 *         for i in range(4):
 *             data.neighbor_index[i] = <int>p[n]             # <<<<<<<<<<<<<<
 *             n += 1
 * 
*/
      (__pyx_v_data->neighbor_index[__pyx_v_i]) = ((int)(__pyx_v_p[__pyx_v_n]));

      /* "cython/core/pickle.pyx":273
 *         for i in range(4):
 *             data.neighbor_index[i] = <int>p[n]
 *             n += 1             # <<<<<<<<<<<<<<
 * 
 *     # Get the gluing permutations.
*/
      __pyx_v_n = (__pyx_v_n + 1);
    }
  }
  __pyx_L3:;

  /* "cython/core/pickle.pyx":276
 * 
 *     # Get the gluing permutations.
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         perm = <unsigned char>p[n]
 *         for j in range(4):
*/
  for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cython/core/pickle.pyx":277
 *     # Get the gluing permutations.
 *     for i in range(4):
 *         perm = <unsigned char>p[n]             # <<<<<<<<<<<<<<
 *         for j in range(4):
 *             data.gluing[i][j] = <int>(perm & 0x3)
*/
    __pyx_v_perm = ((unsigned char)(__pyx_v_p[__pyx_v_n]));

    /* "cython/core/pickle.pyx":278
 *     for i in range(4):
 *         perm = <unsigned char>p[n]
 *         for j in range(4):             # <<<<<<<<<<<<<<
 *             data.gluing[i][j] = <int>(perm & 0x3)
 *             perm = perm >> 2
*/
    for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
      __pyx_v_j = __pyx_t_6;

      /* "cython/core/pickle.pyx":279
 *         perm = <unsigned char>p[n]
 *         for j in range(4):
 *             data.gluing[i][j] = <int>(perm & 0x3)             # <<<<<<<<<<<<<<
 *             perm = perm >> 2
 *         n += 1
*/
      ((__pyx_v_data->gluing[__pyx_v_i])[__pyx_v_j]) = ((int)(__pyx_v_perm & 0x3));

      /* "cython/core/pickle.pyx":280
 *         for j in range(4):
 *             data.gluing[i][j] = <int>(perm & 0x3)
 *             perm = perm >> 2             # <<<<<<<<<<<<<<
 *         n += 1
 * 
*/
      __pyx_v_perm = (__pyx_v_perm >> 2);
    }

    /* "cython/core/pickle.pyx":281
 *             data.gluing[i][j] = <int>(perm & 0x3)
 *             perm = perm >> 2
 *         n += 1             # <<<<<<<<<<<<<<
 * 
 *     # Get the cusp indices.
*/
    __pyx_v_n = (__pyx_v_n + 1);
  }

  /* "cython/core/pickle.pyx":284
 * 
 *     # Get the cusp indices.
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         data.cusp_index[i] = <int>p[n]
 *         n += 1
*/
  for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cython/core/pickle.pyx":285
 *     # Get the cusp indices.
 *     for i in range(4):
 *         data.cusp_index[i] = <int>p[n]             # <<<<<<<<<<<<<<
 *         n += 1
 * 
*/
    (__pyx_v_data->cusp_index[__pyx_v_i]) = ((int)(__pyx_v_p[__pyx_v_n]));

    /* "cython/core/pickle.pyx":286
 *     for i in range(4):
 *         data.cusp_index[i] = <int>p[n]
 *         n += 1             # <<<<<<<<<<<<<<
 * 
 *     # Get the curve data
*/
    __pyx_v_n = (__pyx_v_n + 1);
  }

  /* "cython/core/pickle.pyx":289
 * 
 *     # Get the curve data
 *     for i in range(2):             # <<<<<<<<<<<<<<
 *         for j in range(2):
 *             bit = 1
*/
  for (__pyx_t_5 = 0; __pyx_t_5 < 2; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cython/core/pickle.pyx":290
 *     # Get the curve data
 *     for i in range(2):
 *         for j in range(2):             # <<<<<<<<<<<<<<
 *             bit = 1
 *             mask = <unsigned char>p[n] << 8 | <unsigned char>p[n+1]
*/
    for (__pyx_t_6 = 0; __pyx_t_6 < 2; __pyx_t_6+=1) {
      __pyx_v_j = __pyx_t_6;

      /* "cython/core/pickle.pyx":291
 *     for i in range(2):
 *         for j in range(2):
 *             bit = 1             # <<<<<<<<<<<<<<
 *             mask = <unsigned char>p[n] << 8 | <unsigned char>p[n+1]
 *             n += 2
*/
      __pyx_v_bit = 1;

      /* "cython/core/pickle.pyx":292
 *         for j in range(2):
 *             bit = 1
 *             mask = <unsigned char>p[n] << 8 | <unsigned char>p[n+1]             # <<<<<<<<<<<<<<
 *             n += 2
 *             for v in range(4):
*/
      __pyx_v_mask = ((((unsigned char)(__pyx_v_p[__pyx_v_n])) << 8) | ((unsigned char)(__pyx_v_p[(__pyx_v_n + 1)])));

      /* "cython/core/pickle.pyx":293
 *             bit = 1
 *             mask = <unsigned char>p[n] << 8 | <unsigned char>p[n+1]
 *             n += 2             # <<<<<<<<<<<<<<
 *             for v in range(4):
 *                 for f in range(4):
*/
      __pyx_v_n = (__pyx_v_n + 2);

      /* "cython/core/pickle.pyx":294
 *             mask = <unsigned char>p[n] << 8 | <unsigned char>p[n+1]
 *             n += 2
 *             for v in range(4):             # <<<<<<<<<<<<<<
 *                 for f in range(4):
 *                     if mask & bit:
*/
      for (__pyx_t_7 = 0; __pyx_t_7 < 4; __pyx_t_7+=1) {
        __pyx_v_v = __pyx_t_7;

        /* "cython/core/pickle.pyx":295
 *             n += 2
 *             for v in range(4):
 *                 for f in range(4):             # <<<<<<<<<<<<<<
 *                     if mask & bit:
 *                         # Curve weights are signed.  The effect of
*/
        for (__pyx_t_8 = 0; __pyx_t_8 < 4; __pyx_t_8+=1) {
          __pyx_v_f = __pyx_t_8;

          /* "cython/core/pickle.pyx":296
 *             for v in range(4):
 *                 for f in range(4):
 *                     if mask & bit:             # <<<<<<<<<<<<<<
 *                         # Curve weights are signed.  The effect of
 *                         # casting an unsigned char to a signed char is
*/
          __pyx_t_4 = ((__pyx_v_mask & __pyx_v_bit) != 0);
          if (__pyx_t_4) {

            /* "cython/core/pickle.pyx":302
 *                         # will break if any bits are changed by the
 *                         # cast.
 *                         data.curve[i][j][v][f] = <signed char>p[n]             # <<<<<<<<<<<<<<
 *                         n += 1
 *                     else:
*/
            ((((__pyx_v_data->curve[__pyx_v_i])[__pyx_v_j])[__pyx_v_v])[__pyx_v_f]) = ((signed char)(__pyx_v_p[__pyx_v_n]));

            /* "cython/core/pickle.pyx":303
 *                         # cast.
 *                         data.curve[i][j][v][f] = <signed char>p[n]
 *                         n += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         data.curve[i][j][v][f] = 0
*/
            __pyx_v_n = (__pyx_v_n + 1);

            /* "cython/core/pickle.pyx":296
 *             for v in range(4):
 *                 for f in range(4):
 *                     if mask & bit:             # <<<<<<<<<<<<<<
 *                         # Curve weights are signed.  The effect of
 *                         # casting an unsigned char to a signed char is
*/
            goto __pyx_L24;
          }

          /* "cython/core/pickle.pyx":305
 *                         n += 1
 *                     else:
 *                         data.curve[i][j][v][f] = 0             # <<<<<<<<<<<<<<
 *                     bit = bit << 1
 * 
*/
          /*else*/ {
            ((((__pyx_v_data->curve[__pyx_v_i])[__pyx_v_j])[__pyx_v_v])[__pyx_v_f]) = 0;
          }
          __pyx_L24:;

          /* "cython/core/pickle.pyx":306
 *                     else:
 *                         data.curve[i][j][v][f] = 0
 *                     bit = bit << 1             # <<<<<<<<<<<<<<
 * 
 *     # Return the position of the next char.
*/
          __pyx_v_bit = (__pyx_v_bit << 1);
        }
      }
    }
  }

  /* "cython/core/pickle.pyx":309
 * 
 *     # Return the position of the next char.
 *     return n             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_n;
  goto __pyx_L0;

  /* "cython/core/pickle.pyx":251
 *     return tri
 * 
 * cdef int unpickle_tetrahedron_data(c_TetrahedronData *data, bytes pickle,             # <<<<<<<<<<<<<<
 *                                    int start, int flag) except *:
 *     cdef int i, j, v, f
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.unpickle_tetrahedron_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/pickle.pyx":312
 * 
 * 
 * cdef c_Triangulation* listlike_to_triangulation(listlike,             # <<<<<<<<<<<<<<
 *                                                 num_or_cusps=0,
 *                                                 num_nonor_cusps=0,
*/

static Triangulation *__pyx_f_8SnapPyHP_listlike_to_triangulation(PyObject *__pyx_v_listlike, struct __pyx_opt_args_8SnapPyHP_listlike_to_triangulation *__pyx_optional_args) {
  PyObject *__pyx_v_num_or_cusps = ((PyObject *)__pyx_mstate_global->__pyx_int_0);
  PyObject *__pyx_v_num_nonor_cusps = ((PyObject *)__pyx_mstate_global->__pyx_int_0);

  /* "cython/core/pickle.pyx":315
 *                                                 num_or_cusps=0,
 *                                                 num_nonor_cusps=0,
 *                                                 cusp_indices=None,             # <<<<<<<<<<<<<<
 *                                                 peripheral_curves=None) except *:
 *     cdef c_TetrahedronData* tets = NULL
*/
  PyObject *__pyx_v_cusp_indices = ((PyObject *)Py_None);

  /* "cython/core/pickle.pyx":316
 *                                                 num_nonor_cusps=0,
 *                                                 cusp_indices=None,
 *                                                 peripheral_curves=None) except *:             # <<<<<<<<<<<<<<
 *     cdef c_TetrahedronData* tets = NULL
 *     cdef c_CuspData* cusps = NULL
*/
  PyObject *__pyx_v_peripheral_curves = ((PyObject *)Py_None);
  TetrahedronData *__pyx_v_tets;
  CuspData *__pyx_v_cusps;
  Triangulation *__pyx_v_tri;
  TriangulationData __pyx_v_tri_data;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_t;
  int __pyx_v_a;
  int __pyx_v_b;
  int __pyx_v_v;
  int __pyx_v_f;
  int __pyx_v_num_tets;
  int __pyx_v_num_cusps;
  PyObject *__pyx_v_first0 = NULL;
  PyObject *__pyx_v_first1 = NULL;
  PyObject *__pyx_v_py_name = NULL;
  PyObject *__pyx_v_neighbors = NULL;
  PyObject *__pyx_v_gluings = NULL;
  PyObject *__pyx_9genexpr93__pyx_v_x = NULL;
  Triangulation *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  char *__pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  long __pyx_t_21;
  int __pyx_t_22;
  int __pyx_t_23;
  int __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("listlike_to_triangulation", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_num_or_cusps = __pyx_optional_args->num_or_cusps;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_num_nonor_cusps = __pyx_optional_args->num_nonor_cusps;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_cusp_indices = __pyx_optional_args->cusp_indices;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_peripheral_curves = __pyx_optional_args->peripheral_curves;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_peripheral_curves);

  /* "cython/core/pickle.pyx":317
 *                                                 cusp_indices=None,
 *                                                 peripheral_curves=None) except *:
 *     cdef c_TetrahedronData* tets = NULL             # <<<<<<<<<<<<<<
 *     cdef c_CuspData* cusps = NULL
 *     cdef c_Triangulation *tri
*/
  __pyx_v_tets = NULL;

  /* "cython/core/pickle.pyx":318
 *                                                 peripheral_curves=None) except *:
 *     cdef c_TetrahedronData* tets = NULL
 *     cdef c_CuspData* cusps = NULL             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *tri
 *     cdef TriangulationData tri_data
*/
  __pyx_v_cusps = NULL;

  /* "cython/core/pickle.pyx":323
 *     cdef int i, j, t, a, b, v, f, num_tets, num_cusps
 * 
 *     num_tets = len(listlike)             # <<<<<<<<<<<<<<
 *     if num_tets == 0:
 *         raise ValueError('No tetrahedra data provided')
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_listlike); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 323, __pyx_L1_error)
  __pyx_v_num_tets = __pyx_t_1;

  /* "cython/core/pickle.pyx":324
 * 
 *     num_tets = len(listlike)
 *     if num_tets == 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('No tetrahedra data provided')
 * 
*/
  __pyx_t_2 = (__pyx_v_num_tets == 0);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/pickle.pyx":325
 *     num_tets = len(listlike)
 *     if num_tets == 0:
 *         raise ValueError('No tetrahedra data provided')             # <<<<<<<<<<<<<<
 * 
 *     try:
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_No_tetrahedra_data_provided};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(12, 325, __pyx_L1_error)

    /* "cython/core/pickle.pyx":324
 * 
 *     num_tets = len(listlike)
 *     if num_tets == 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('No tetrahedra data provided')
 * 
*/
  }

  /* "cython/core/pickle.pyx":327
 *         raise ValueError('No tetrahedra data provided')
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         first0, first1 = listlike[0]
 *     except ValueError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "cython/core/pickle.pyx":328
 * 
 *     try:
 *         first0, first1 = listlike[0]             # <<<<<<<<<<<<<<
 *     except ValueError:
 *         raise ValueError('Tetrahedra data appears invalid')
*/
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_listlike, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 328, __pyx_L4_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 != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(12, 328, __pyx_L4_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_5);
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_4);
        } else {
          __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 328, __pyx_L4_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 328, __pyx_L4_error)
          __Pyx_XGOTREF(__pyx_t_4);
        }
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 328, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 328, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 328, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
        index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(12, 328, __pyx_L4_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L11_unpacking_done;
        __pyx_L10_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(12, 328, __pyx_L4_error)
        __pyx_L11_unpacking_done:;
      }
      __pyx_v_first0 = __pyx_t_5;
      __pyx_t_5 = 0;
      __pyx_v_first1 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/pickle.pyx":327
 *         raise ValueError('No tetrahedra data provided')
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         first0, first1 = listlike[0]
 *     except ValueError:
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/pickle.pyx":329
 *     try:
 *         first0, first1 = listlike[0]
 *     except ValueError:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tetrahedra data appears invalid')
 *     if len(first0) != 4 or [len(x) for x in first1] != [4, 4, 4, 4]:
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("SnapPyHP.listlike_to_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(12, 329, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "cython/core/pickle.pyx":330
 *         first0, first1 = listlike[0]
 *     except ValueError:
 *         raise ValueError('Tetrahedra data appears invalid')             # <<<<<<<<<<<<<<
 *     if len(first0) != 4 or [len(x) for x in first1] != [4, 4, 4, 4]:
 *         raise ValueError('Tetrahedra data appears invalid')
*/
      __pyx_t_13 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_14 = __pyx_builtin_ValueError; 
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_Tetrahedra_data_appears_invalid};
        __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 330, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_ERR(12, 330, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;

    /* "cython/core/pickle.pyx":327
 *         raise ValueError('No tetrahedra data provided')
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         first0, first1 = listlike[0]
 *     except ValueError:
*/
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "cython/core/pickle.pyx":331
 *     except ValueError:
 *         raise ValueError('Tetrahedra data appears invalid')
 *     if len(first0) != 4 or [len(x) for x in first1] != [4, 4, 4, 4]:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tetrahedra data appears invalid')
 * 
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_first0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 331, __pyx_L1_error)
  __pyx_t_15 = (__pyx_t_1 != 4);
  if (!__pyx_t_15) {
  } else {
    __pyx_t_2 = __pyx_t_15;
    goto __pyx_L15_bool_binop_done;
  }
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 331, __pyx_L19_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_v_first1)) || PyTuple_CheckExact(__pyx_v_first1)) {
      __pyx_t_4 = __pyx_v_first1; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_1 = 0;
      __pyx_t_16 = NULL;
    } else {
      __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_first1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 331, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(12, 331, __pyx_L19_error)
    }
    for (;;) {
      if (likely(!__pyx_t_16)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 331, __pyx_L19_error)
            #endif
            if (__pyx_t_1 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_1);
          ++__pyx_t_1;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 331, __pyx_L19_error)
            #endif
            if (__pyx_t_1 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1);
          #endif
          ++__pyx_t_1;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 331, __pyx_L19_error)
      } else {
        __pyx_t_3 = __pyx_t_16(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(12, 331, __pyx_L19_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_9genexpr93__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_17 = PyObject_Length(__pyx_9genexpr93__pyx_v_x); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(12, 331, __pyx_L19_error)
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 331, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) __PYX_ERR(12, 331, __pyx_L19_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr93__pyx_v_x); __pyx_9genexpr93__pyx_v_x = 0;
    goto __pyx_L23_exit_scope;
    __pyx_L19_error:;
    __Pyx_XDECREF(__pyx_9genexpr93__pyx_v_x); __pyx_9genexpr93__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L23_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_int_4) != (0)) __PYX_ERR(12, 331, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_4) != (0)) __PYX_ERR(12, 331, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_mstate_global->__pyx_int_4) != (0)) __PYX_ERR(12, 331, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_mstate_global->__pyx_int_4) != (0)) __PYX_ERR(12, 331, __pyx_L1_error);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(12, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_15;
  __pyx_L15_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/pickle.pyx":332
 *         raise ValueError('Tetrahedra data appears invalid')
 *     if len(first0) != 4 or [len(x) for x in first1] != [4, 4, 4, 4]:
 *         raise ValueError('Tetrahedra data appears invalid')             # <<<<<<<<<<<<<<
 * 
 *     py_name = b'from_data'
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Tetrahedra_data_appears_invalid};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(12, 332, __pyx_L1_error)

    /* "cython/core/pickle.pyx":331
 *     except ValueError:
 *         raise ValueError('Tetrahedra data appears invalid')
 *     if len(first0) != 4 or [len(x) for x in first1] != [4, 4, 4, 4]:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tetrahedra data appears invalid')
 * 
*/
  }

  /* "cython/core/pickle.pyx":334
 *         raise ValueError('Tetrahedra data appears invalid')
 * 
 *     py_name = b'from_data'             # <<<<<<<<<<<<<<
 *     tri_data.name = py_name
 *     tri_data.solution_type = not_attempted
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_b_from_data);
  __pyx_v_py_name = __pyx_mstate_global->__pyx_n_b_from_data;

  /* "cython/core/pickle.pyx":335
 * 
 *     py_name = b'from_data'
 *     tri_data.name = py_name             # <<<<<<<<<<<<<<
 *     tri_data.solution_type = not_attempted
 *     tri_data.volume = <Real> 0.0
*/
  __pyx_t_18 = __Pyx_PyBytes_AsWritableString(__pyx_v_py_name); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(12, 335, __pyx_L1_error)
  __pyx_v_tri_data.name = __pyx_t_18;

  /* "cython/core/pickle.pyx":336
 *     py_name = b'from_data'
 *     tri_data.name = py_name
 *     tri_data.solution_type = not_attempted             # <<<<<<<<<<<<<<
 *     tri_data.volume = <Real> 0.0
 *     tri_data.orientability = unknown_orientability
*/
  __pyx_v_tri_data.solution_type = not_attempted;

  /* "cython/core/pickle.pyx":337
 *     tri_data.name = py_name
 *     tri_data.solution_type = not_attempted
 *     tri_data.volume = <Real> 0.0             # <<<<<<<<<<<<<<
 *     tri_data.orientability = unknown_orientability
 *     tri_data.num_tetrahedra = num_tets
*/
  __pyx_v_tri_data.volume = ((__pyx_t_8SnapPyHP_Real)0.0);

  /* "cython/core/pickle.pyx":338
 *     tri_data.solution_type = not_attempted
 *     tri_data.volume = <Real> 0.0
 *     tri_data.orientability = unknown_orientability             # <<<<<<<<<<<<<<
 *     tri_data.num_tetrahedra = num_tets
 *     tri_data.num_or_cusps = num_or_cusps
*/
  __pyx_v_tri_data.orientability = unknown_orientability;

  /* "cython/core/pickle.pyx":339
 *     tri_data.volume = <Real> 0.0
 *     tri_data.orientability = unknown_orientability
 *     tri_data.num_tetrahedra = num_tets             # <<<<<<<<<<<<<<
 *     tri_data.num_or_cusps = num_or_cusps
 *     tri_data.num_nonor_cusps = num_nonor_cusps
*/
  __pyx_v_tri_data.num_tetrahedra = __pyx_v_num_tets;

  /* "cython/core/pickle.pyx":340
 *     tri_data.orientability = unknown_orientability
 *     tri_data.num_tetrahedra = num_tets
 *     tri_data.num_or_cusps = num_or_cusps             # <<<<<<<<<<<<<<
 *     tri_data.num_nonor_cusps = num_nonor_cusps
 *     tri_data.cusp_data = NULL
*/
  __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_v_num_or_cusps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 340, __pyx_L1_error)
  __pyx_v_tri_data.num_or_cusps = __pyx_t_12;

  /* "cython/core/pickle.pyx":341
 *     tri_data.num_tetrahedra = num_tets
 *     tri_data.num_or_cusps = num_or_cusps
 *     tri_data.num_nonor_cusps = num_nonor_cusps             # <<<<<<<<<<<<<<
 *     tri_data.cusp_data = NULL
 *     tri_data.CS_value_is_known = 0
*/
  __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_v_num_nonor_cusps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 341, __pyx_L1_error)
  __pyx_v_tri_data.num_nonor_cusps = __pyx_t_12;

  /* "cython/core/pickle.pyx":342
 *     tri_data.num_or_cusps = num_or_cusps
 *     tri_data.num_nonor_cusps = num_nonor_cusps
 *     tri_data.cusp_data = NULL             # <<<<<<<<<<<<<<
 *     tri_data.CS_value_is_known = 0
 *     tri_data.CS_value = <Real>0.0
*/
  __pyx_v_tri_data.cusp_data = NULL;

  /* "cython/core/pickle.pyx":343
 *     tri_data.num_nonor_cusps = num_nonor_cusps
 *     tri_data.cusp_data = NULL
 *     tri_data.CS_value_is_known = 0             # <<<<<<<<<<<<<<
 *     tri_data.CS_value = <Real>0.0
 * 
*/
  __pyx_v_tri_data.CS_value_is_known = 0;

  /* "cython/core/pickle.pyx":344
 *     tri_data.cusp_data = NULL
 *     tri_data.CS_value_is_known = 0
 *     tri_data.CS_value = <Real>0.0             # <<<<<<<<<<<<<<
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
*/
  __pyx_v_tri_data.CS_value = ((__pyx_t_8SnapPyHP_Real)0.0);

  /* "cython/core/pickle.pyx":346
 *     tri_data.CS_value = <Real>0.0
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps             # <<<<<<<<<<<<<<
 *     if num_cusps > 0:
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
*/
  __pyx_v_num_cusps = (__pyx_v_tri_data.num_or_cusps + __pyx_v_tri_data.num_nonor_cusps);

  /* "cython/core/pickle.pyx":347
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
 *     if num_cusps > 0:             # <<<<<<<<<<<<<<
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
 *         # data.  We free the memory before returning.
*/
  __pyx_t_2 = (__pyx_v_num_cusps > 0);
  if (__pyx_t_2) {

    /* "cython/core/pickle.pyx":350
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
 *         # data.  We free the memory before returning.
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))             # <<<<<<<<<<<<<<
 *         if cusps:
 *             for i in range(tri_data.num_or_cusps):
*/
    __pyx_v_cusps = ((CuspData *)malloc((__pyx_v_num_cusps * (sizeof(CuspData)))));

    /* "cython/core/pickle.pyx":351
 *         # data.  We free the memory before returning.
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))
 *         if cusps:             # <<<<<<<<<<<<<<
 *             for i in range(tri_data.num_or_cusps):
 *                 cusps[i].topology = torus_cusp
*/
    __pyx_t_2 = (__pyx_v_cusps != 0);
    if (likely(__pyx_t_2)) {

      /* "cython/core/pickle.pyx":352
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))
 *         if cusps:
 *             for i in range(tri_data.num_or_cusps):             # <<<<<<<<<<<<<<
 *                 cusps[i].topology = torus_cusp
 *                 cusps[i].m = <Real>0.0
*/
      __pyx_t_12 = __pyx_v_tri_data.num_or_cusps;
      __pyx_t_19 = __pyx_t_12;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_i = __pyx_t_20;

        /* "cython/core/pickle.pyx":353
 *         if cusps:
 *             for i in range(tri_data.num_or_cusps):
 *                 cusps[i].topology = torus_cusp             # <<<<<<<<<<<<<<
 *                 cusps[i].m = <Real>0.0
 *                 cusps[i].l = <Real>0.0
*/
        (__pyx_v_cusps[__pyx_v_i]).topology = torus_cusp;

        /* "cython/core/pickle.pyx":354
 *             for i in range(tri_data.num_or_cusps):
 *                 cusps[i].topology = torus_cusp
 *                 cusps[i].m = <Real>0.0             # <<<<<<<<<<<<<<
 *                 cusps[i].l = <Real>0.0
 *             for i in range(tri_data.num_or_cusps, num_cusps):
*/
        (__pyx_v_cusps[__pyx_v_i]).m = ((__pyx_t_8SnapPyHP_Real)0.0);

        /* "cython/core/pickle.pyx":355
 *                 cusps[i].topology = torus_cusp
 *                 cusps[i].m = <Real>0.0
 *                 cusps[i].l = <Real>0.0             # <<<<<<<<<<<<<<
 *             for i in range(tri_data.num_or_cusps, num_cusps):
 *                 cusps[i].topology = Klein_cusp
*/
        (__pyx_v_cusps[__pyx_v_i]).l = ((__pyx_t_8SnapPyHP_Real)0.0);
      }

      /* "cython/core/pickle.pyx":356
 *                 cusps[i].m = <Real>0.0
 *                 cusps[i].l = <Real>0.0
 *             for i in range(tri_data.num_or_cusps, num_cusps):             # <<<<<<<<<<<<<<
 *                 cusps[i].topology = Klein_cusp
 *                 cusps[i].m = <Real>0.0
*/
      __pyx_t_12 = __pyx_v_num_cusps;
      __pyx_t_19 = __pyx_t_12;
      for (__pyx_t_20 = __pyx_v_tri_data.num_or_cusps; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_i = __pyx_t_20;

        /* "cython/core/pickle.pyx":357
 *                 cusps[i].l = <Real>0.0
 *             for i in range(tri_data.num_or_cusps, num_cusps):
 *                 cusps[i].topology = Klein_cusp             # <<<<<<<<<<<<<<
 *                 cusps[i].m = <Real>0.0
 *                 cusps[i].l = <Real>0.0
*/
        (__pyx_v_cusps[__pyx_v_i]).topology = Klein_cusp;

        /* "cython/core/pickle.pyx":358
 *             for i in range(tri_data.num_or_cusps, num_cusps):
 *                 cusps[i].topology = Klein_cusp
 *                 cusps[i].m = <Real>0.0             # <<<<<<<<<<<<<<
 *                 cusps[i].l = <Real>0.0
 *         else:
*/
        (__pyx_v_cusps[__pyx_v_i]).m = ((__pyx_t_8SnapPyHP_Real)0.0);

        /* "cython/core/pickle.pyx":359
 *                 cusps[i].topology = Klein_cusp
 *                 cusps[i].m = <Real>0.0
 *                 cusps[i].l = <Real>0.0             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError('Failed to allocate memory for cusps')
*/
        (__pyx_v_cusps[__pyx_v_i]).l = ((__pyx_t_8SnapPyHP_Real)0.0);
      }

      /* "cython/core/pickle.pyx":351
 *         # data.  We free the memory before returning.
 *         cusps = <c_CuspData*>malloc(num_cusps*sizeof(c_CuspData))
 *         if cusps:             # <<<<<<<<<<<<<<
 *             for i in range(tri_data.num_or_cusps):
 *                 cusps[i].topology = torus_cusp
*/
      goto __pyx_L25;
    }

    /* "cython/core/pickle.pyx":361
 *                 cusps[i].l = <Real>0.0
 *         else:
 *             raise RuntimeError('Failed to allocate memory for cusps')             # <<<<<<<<<<<<<<
 *     tri_data.cusp_data = cusps
 * 
*/
    /*else*/ {
      __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_builtin_RuntimeError);
      __pyx_t_4 = __pyx_builtin_RuntimeError; 
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Failed_to_allocate_memory_for_cu};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(12, 361, __pyx_L1_error)
    }
    __pyx_L25:;

    /* "cython/core/pickle.pyx":347
 * 
 *     num_cusps = tri_data.num_or_cusps + tri_data.num_nonor_cusps
 *     if num_cusps > 0:             # <<<<<<<<<<<<<<
 *         # Use malloc (not mymalloc) to allocate memory for the cusp
 *         # data.  We free the memory before returning.
*/
  }

  /* "cython/core/pickle.pyx":362
 *         else:
 *             raise RuntimeError('Failed to allocate memory for cusps')
 *     tri_data.cusp_data = cusps             # <<<<<<<<<<<<<<
 * 
 *     if peripheral_curves is None:
*/
  __pyx_v_tri_data.cusp_data = __pyx_v_cusps;

  /* "cython/core/pickle.pyx":364
 *     tri_data.cusp_data = cusps
 * 
 *     if peripheral_curves is None:             # <<<<<<<<<<<<<<
 *         peripheral_curves = (4*num_tets)*[16*[0]]
 * 
*/
  __pyx_t_2 = (__pyx_v_peripheral_curves == Py_None);
  if (__pyx_t_2) {

    /* "cython/core/pickle.pyx":365
 * 
 *     if peripheral_curves is None:
 *         peripheral_curves = (4*num_tets)*[16*[0]]             # <<<<<<<<<<<<<<
 * 
 *     # Use malloc (not mymalloc) to allocate memory for the tetrahedra
*/
    __pyx_t_3 = PyList_New(1 * 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < 16; __pyx_temp++) {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(12, 365, __pyx_L1_error);
      }
    }
    __pyx_t_21 = (4 * __pyx_v_num_tets);
    __pyx_t_4 = PyList_New(1 * ((__pyx_t_21<0) ? 0:__pyx_t_21)); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_t_21; __pyx_temp++) {
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_3) != (0)) __PYX_ERR(12, 365, __pyx_L1_error);
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_peripheral_curves, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/pickle.pyx":364
 *     tri_data.cusp_data = cusps
 * 
 *     if peripheral_curves is None:             # <<<<<<<<<<<<<<
 *         peripheral_curves = (4*num_tets)*[16*[0]]
 * 
*/
  }

  /* "cython/core/pickle.pyx":369
 *     # Use malloc (not mymalloc) to allocate memory for the tetrahedra
 *     # data.  We free the memory before returning.
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))             # <<<<<<<<<<<<<<
 *     if tets == NULL:
 *         raise RuntimeError('Failed to allocate memory for tets.')
*/
  __pyx_v_tets = ((TetrahedronData *)malloc((__pyx_v_num_tets * (sizeof(TetrahedronData)))));

  /* "cython/core/pickle.pyx":370
 *     # data.  We free the memory before returning.
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))
 *     if tets == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Failed to allocate memory for tets.')
 *     tri_data.tetrahedron_data = tets
*/
  __pyx_t_2 = (__pyx_v_tets == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/pickle.pyx":371
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))
 *     if tets == NULL:
 *         raise RuntimeError('Failed to allocate memory for tets.')             # <<<<<<<<<<<<<<
 *     tri_data.tetrahedron_data = tets
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_5 = __pyx_builtin_RuntimeError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Failed_to_allocate_memory_for_te};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(12, 371, __pyx_L1_error)

    /* "cython/core/pickle.pyx":370
 *     # data.  We free the memory before returning.
 *     tets = <c_TetrahedronData*>malloc(num_tets*sizeof(c_TetrahedronData))
 *     if tets == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Failed to allocate memory for tets.')
 *     tri_data.tetrahedron_data = tets
*/
  }

  /* "cython/core/pickle.pyx":372
 *     if tets == NULL:
 *         raise RuntimeError('Failed to allocate memory for tets.')
 *     tri_data.tetrahedron_data = tets             # <<<<<<<<<<<<<<
 * 
 *     for t, (neighbors, gluings) in enumerate(listlike):
*/
  __pyx_v_tri_data.tetrahedron_data = __pyx_v_tets;

  /* "cython/core/pickle.pyx":374
 *     tri_data.tetrahedron_data = tets
 * 
 *     for t, (neighbors, gluings) in enumerate(listlike):             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             tets[t].neighbor_index[i] = neighbors[i]
*/
  __pyx_t_12 = 0;
  if (likely(PyList_CheckExact(__pyx_v_listlike)) || PyTuple_CheckExact(__pyx_v_listlike)) {
    __pyx_t_4 = __pyx_v_listlike; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_16 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_listlike); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(12, 374, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_16)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 374, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 374, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 374, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_16(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(12, 374, __pyx_L1_error)
          PyErr_Clear();
        }
        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(12, 374, __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_INCREF(__pyx_t_3);
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_10);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 374, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 374, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_10);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 374, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 374, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_14 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(12, 374, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14);
      index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L34_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L34_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_14), 2) < 0) __PYX_ERR(12, 374, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L35_unpacking_done;
      __pyx_L34_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(12, 374, __pyx_L1_error)
      __pyx_L35_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_neighbors, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_gluings, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_v_t = __pyx_t_12;
    __pyx_t_12 = (__pyx_t_12 + 1);

    /* "cython/core/pickle.pyx":375
 * 
 *     for t, (neighbors, gluings) in enumerate(listlike):
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             tets[t].neighbor_index[i] = neighbors[i]
 *             for j in range(4):
*/
    for (__pyx_t_19 = 0; __pyx_t_19 < 4; __pyx_t_19+=1) {
      __pyx_v_i = __pyx_t_19;

      /* "cython/core/pickle.pyx":376
 *     for t, (neighbors, gluings) in enumerate(listlike):
 *         for i in range(4):
 *             tets[t].neighbor_index[i] = neighbors[i]             # <<<<<<<<<<<<<<
 *             for j in range(4):
 *                 tets[t].gluing[i][j] = gluings[i][j]
*/
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_neighbors, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 376, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_20 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 376, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      ((__pyx_v_tets[__pyx_v_t]).neighbor_index[__pyx_v_i]) = __pyx_t_20;

      /* "cython/core/pickle.pyx":377
 *         for i in range(4):
 *             tets[t].neighbor_index[i] = neighbors[i]
 *             for j in range(4):             # <<<<<<<<<<<<<<
 *                 tets[t].gluing[i][j] = gluings[i][j]
 *             if cusp_indices:
*/
      for (__pyx_t_20 = 0; __pyx_t_20 < 4; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "cython/core/pickle.pyx":378
 *             tets[t].neighbor_index[i] = neighbors[i]
 *             for j in range(4):
 *                 tets[t].gluing[i][j] = gluings[i][j]             # <<<<<<<<<<<<<<
 *             if cusp_indices:
 *                 tets[t].cusp_index[i] = cusp_indices[t][i]
*/
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_gluings, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_j, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_22 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 378, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        (((__pyx_v_tets[__pyx_v_t]).gluing[__pyx_v_i])[__pyx_v_j]) = __pyx_t_22;
      }

      /* "cython/core/pickle.pyx":379
 *             for j in range(4):
 *                 tets[t].gluing[i][j] = gluings[i][j]
 *             if cusp_indices:             # <<<<<<<<<<<<<<
 *                 tets[t].cusp_index[i] = cusp_indices[t][i]
 * 
*/
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_cusp_indices); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(12, 379, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "cython/core/pickle.pyx":380
 *                 tets[t].gluing[i][j] = gluings[i][j]
 *             if cusp_indices:
 *                 tets[t].cusp_index[i] = cusp_indices[t][i]             # <<<<<<<<<<<<<<
 * 
 *         if cusp_indices:
*/
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cusp_indices, __pyx_v_t, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_10, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_20 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 380, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        ((__pyx_v_tets[__pyx_v_t]).cusp_index[__pyx_v_i]) = __pyx_t_20;

        /* "cython/core/pickle.pyx":379
 *             for j in range(4):
 *                 tets[t].gluing[i][j] = gluings[i][j]
 *             if cusp_indices:             # <<<<<<<<<<<<<<
 *                 tets[t].cusp_index[i] = cusp_indices[t][i]
 * 
*/
      }
    }

    /* "cython/core/pickle.pyx":382
 *                 tets[t].cusp_index[i] = cusp_indices[t][i]
 * 
 *         if cusp_indices:             # <<<<<<<<<<<<<<
 *             for a in range(2):
 *                 for b in range(2):
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_cusp_indices); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(12, 382, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "cython/core/pickle.pyx":383
 * 
 *         if cusp_indices:
 *             for a in range(2):             # <<<<<<<<<<<<<<
 *                 for b in range(2):
 *                     for v in range(4):
*/
      for (__pyx_t_19 = 0; __pyx_t_19 < 2; __pyx_t_19+=1) {
        __pyx_v_a = __pyx_t_19;

        /* "cython/core/pickle.pyx":384
 *         if cusp_indices:
 *             for a in range(2):
 *                 for b in range(2):             # <<<<<<<<<<<<<<
 *                     for v in range(4):
 *                         for f in range(4):
*/
        for (__pyx_t_20 = 0; __pyx_t_20 < 2; __pyx_t_20+=1) {
          __pyx_v_b = __pyx_t_20;

          /* "cython/core/pickle.pyx":385
 *             for a in range(2):
 *                 for b in range(2):
 *                     for v in range(4):             # <<<<<<<<<<<<<<
 *                         for f in range(4):
 *                             tets[t].curve[a][b][v][f] = peripheral_curves[4*t + 2*a + b][4*v + f]
*/
          for (__pyx_t_22 = 0; __pyx_t_22 < 4; __pyx_t_22+=1) {
            __pyx_v_v = __pyx_t_22;

            /* "cython/core/pickle.pyx":386
 *                 for b in range(2):
 *                     for v in range(4):
 *                         for f in range(4):             # <<<<<<<<<<<<<<
 *                             tets[t].curve[a][b][v][f] = peripheral_curves[4*t + 2*a + b][4*v + f]
 * 
*/
            for (__pyx_t_23 = 0; __pyx_t_23 < 4; __pyx_t_23+=1) {
              __pyx_v_f = __pyx_t_23;

              /* "cython/core/pickle.pyx":387
 *                     for v in range(4):
 *                         for f in range(4):
 *                             tets[t].curve[a][b][v][f] = peripheral_curves[4*t + 2*a + b][4*v + f]             # <<<<<<<<<<<<<<
 * 
 *     data_to_triangulation(&tri_data, &tri)
*/
              __pyx_t_21 = (((4 * __pyx_v_t) + (2 * __pyx_v_a)) + __pyx_v_b);
              __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peripheral_curves, __pyx_t_21, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 387, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_21 = ((4 * __pyx_v_v) + __pyx_v_f);
              __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_5, __pyx_t_21, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 387, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_24 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 387, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              (((((__pyx_v_tets[__pyx_v_t]).curve[__pyx_v_a])[__pyx_v_b])[__pyx_v_v])[__pyx_v_f]) = __pyx_t_24;
            }
          }
        }
      }

      /* "cython/core/pickle.pyx":382
 *                 tets[t].cusp_index[i] = cusp_indices[t][i]
 * 
 *         if cusp_indices:             # <<<<<<<<<<<<<<
 *             for a in range(2):
 *                 for b in range(2):
*/
    }

    /* "cython/core/pickle.pyx":374
 *     tri_data.tetrahedron_data = tets
 * 
 *     for t, (neighbors, gluings) in enumerate(listlike):             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             tets[t].neighbor_index[i] = neighbors[i]
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/pickle.pyx":389
 *                             tets[t].curve[a][b][v][f] = peripheral_curves[4*t + 2*a + b][4*v + f]
 * 
 *     data_to_triangulation(&tri_data, &tri)             # <<<<<<<<<<<<<<
 *     free(tets)
 *     if cusps:
*/
  data_to_triangulation((&__pyx_v_tri_data), (&__pyx_v_tri)); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 389, __pyx_L1_error)

  /* "cython/core/pickle.pyx":390
 * 
 *     data_to_triangulation(&tri_data, &tri)
 *     free(tets)             # <<<<<<<<<<<<<<
 *     if cusps:
 *         free(cusps)
*/
  free(__pyx_v_tets);

  /* "cython/core/pickle.pyx":391
 *     data_to_triangulation(&tri_data, &tri)
 *     free(tets)
 *     if cusps:             # <<<<<<<<<<<<<<
 *         free(cusps)
 *     return tri
*/
  __pyx_t_2 = (__pyx_v_cusps != 0);
  if (__pyx_t_2) {

    /* "cython/core/pickle.pyx":392
 *     free(tets)
 *     if cusps:
 *         free(cusps)             # <<<<<<<<<<<<<<
 *     return tri
*/
    free(__pyx_v_cusps);

    /* "cython/core/pickle.pyx":391
 *     data_to_triangulation(&tri_data, &tri)
 *     free(tets)
 *     if cusps:             # <<<<<<<<<<<<<<
 *         free(cusps)
 *     return tri
*/
  }

  /* "cython/core/pickle.pyx":393
 *     if cusps:
 *         free(cusps)
 *     return tri             # <<<<<<<<<<<<<<
*/
  __pyx_r = __pyx_v_tri;
  goto __pyx_L0;

  /* "cython/core/pickle.pyx":312
 * 
 * 
 * cdef c_Triangulation* listlike_to_triangulation(listlike,             # <<<<<<<<<<<<<<
 *                                                 num_or_cusps=0,
 *                                                 num_nonor_cusps=0,
*/

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.listlike_to_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_first0);
  __Pyx_XDECREF(__pyx_v_first1);
  __Pyx_XDECREF(__pyx_v_py_name);
  __Pyx_XDECREF(__pyx_v_neighbors);
  __Pyx_XDECREF(__pyx_v_gluings);
  __Pyx_XDECREF(__pyx_9genexpr93__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_peripheral_curves);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":29
 * 
 * 
 * def bundle_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_47bundle_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_47bundle_from_string = {"bundle_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_47bundle_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_47bundle_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_desc = 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("bundle_from_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 29, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 29, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bundle_from_string", 0) < 0) __PYX_ERR(3, 29, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bundle_from_string", 1, 1, 1, i); __PYX_ERR(3, 29, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 29, __pyx_L3_error)
    }
    __pyx_v_desc = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bundle_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 29, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.bundle_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_46bundle_from_string(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_8SnapPyHP_46bundle_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_desc) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_monodromy = NULL;
  PyObject *__pyx_v_surface = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bundle_from_string", 0);
  __Pyx_INCREF(__pyx_v_desc);

  /* "cython/core/tail.pyx":30
 * 
 * def bundle_from_string(desc):
 *     desc = desc.replace(' ', '')             # <<<<<<<<<<<<<<
 *     m = is_twister_bundle.match(desc)
 *     if m:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_desc, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_desc, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":31
 * def bundle_from_string(desc):
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)             # <<<<<<<<<<<<<<
 *     if m:
 *         g, n, monodromy = m.groups()
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_twister_bundle); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_desc};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_m = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":32
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
 *     if m:             # <<<<<<<<<<<<<<
 *         g, n, monodromy = m.groups()
 *         g, n = int(g), int(n)
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 32, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/tail.pyx":33
 *     m = is_twister_bundle.match(desc)
 *     if m:
 *         g, n, monodromy = m.groups()             # <<<<<<<<<<<<<<
 *         g, n = int(g), int(n)
 *         monodromy = monodromy.replace(',', '*').replace('_', '')
*/
    __pyx_t_4 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_groups, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(3, 33, __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_INCREF(__pyx_t_4);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 33, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 33, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(3, 33, __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(3, 33, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_g = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_n = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_monodromy = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":34
 *     if m:
 *         g, n, monodromy = m.groups()
 *         g, n = int(g), int(n)             # <<<<<<<<<<<<<<
 *         monodromy = monodromy.replace(',', '*').replace('_', '')
 *         surface = twister.Surface((g, n))
*/
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_g, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":35
 *         g, n, monodromy = m.groups()
 *         g, n = int(g), int(n)
 *         monodromy = monodromy.replace(',', '*').replace('_', '')             # <<<<<<<<<<<<<<
 *         surface = twister.Surface((g, n))
 *         return surface.bundle(monodromy, return_type='string')
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_monodromy, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[24], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 35, __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_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[25], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_monodromy, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":36
 *         g, n = int(g), int(n)
 *         monodromy = monodromy.replace(',', '*').replace('_', '')
 *         surface = twister.Surface((g, n))             # <<<<<<<<<<<<<<
 *         return surface.bundle(monodromy, return_type='string')
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_twister); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_g);
    __Pyx_GIVEREF(__pyx_v_g);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_g) != (0)) __PYX_ERR(3, 36, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_n);
    __Pyx_GIVEREF(__pyx_v_n);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_n) != (0)) __PYX_ERR(3, 36, __pyx_L1_error);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_surface = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":37
 *         monodromy = monodromy.replace(',', '*').replace('_', '')
 *         surface = twister.Surface((g, n))
 *         return surface.bundle(monodromy, return_type='string')             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_v_surface;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_monodromy};
      __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_return_type, __pyx_mstate_global->__pyx_n_u_string, __pyx_t_1, __pyx_callargs+2, 0) < 0) __PYX_ERR(3, 37, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_bundle, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":32
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
 *     if m:             # <<<<<<<<<<<<<<
 *         g, n, monodromy = m.groups()
 *         g, n = int(g), int(n)
*/
  }

  /* "cython/core/tail.pyx":29
 * 
 * 
 * def bundle_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
*/

  /* 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_AddTraceback("SnapPyHP.bundle_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_monodromy);
  __Pyx_XDECREF(__pyx_v_surface);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":40
 * 
 * 
 * def splitting_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_49splitting_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_49splitting_from_string = {"splitting_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_49splitting_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_49splitting_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_desc = 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("splitting_from_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 40, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 40, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "splitting_from_string", 0) < 0) __PYX_ERR(3, 40, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("splitting_from_string", 1, 1, 1, i); __PYX_ERR(3, 40, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 40, __pyx_L3_error)
    }
    __pyx_v_desc = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("splitting_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 40, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.splitting_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_48splitting_from_string(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_8SnapPyHP_48splitting_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_desc) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_gluing = NULL;
  PyObject *__pyx_v_handles = NULL;
  PyObject *__pyx_v_surface = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("splitting_from_string", 0);
  __Pyx_INCREF(__pyx_v_desc);

  /* "cython/core/tail.pyx":41
 * 
 * def splitting_from_string(desc):
 *     desc = desc.replace(' ', '')             # <<<<<<<<<<<<<<
 *     m = is_twister_splitting.match(desc)
 *     if m:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_desc, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_desc, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":42
 * def splitting_from_string(desc):
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)             # <<<<<<<<<<<<<<
 *     if m:
 *         g, n, gluing, handles = m.groups()
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_twister_splitting); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_desc};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_m = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":43
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
 *     if m:             # <<<<<<<<<<<<<<
 *         g, n, gluing, handles = m.groups()
 *         g, n = int(g), int(n)
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 43, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/tail.pyx":44
 *     m = is_twister_splitting.match(desc)
 *     if m:
 *         g, n, gluing, handles = m.groups()             # <<<<<<<<<<<<<<
 *         g, n = int(g), int(n)
 *         gluing = gluing.replace(',', '*').replace('_', '')
*/
    __pyx_t_4 = __pyx_v_m;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_groups, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 44, __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 != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(3, 44, __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_INCREF(__pyx_t_4);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 44, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 44, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 44, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 3);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 44, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
      }
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_1,&__pyx_t_3,&__pyx_t_7};
        for (i=0; i < 4; i++) {
          PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(3, 44, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_1,&__pyx_t_3,&__pyx_t_7};
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 4) < 0) __PYX_ERR(3, 44, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 44, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_g = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_n = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_gluing = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_handles = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cython/core/tail.pyx":45
 *     if m:
 *         g, n, gluing, handles = m.groups()
 *         g, n = int(g), int(n)             # <<<<<<<<<<<<<<
 *         gluing = gluing.replace(',', '*').replace('_', '')
 *         handles = handles.replace(',', '*').replace('_', '')
*/
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF_SET(__pyx_v_g, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/tail.pyx":46
 *         g, n, gluing, handles = m.groups()
 *         g, n = int(g), int(n)
 *         gluing = gluing.replace(',', '*').replace('_', '')             # <<<<<<<<<<<<<<
 *         handles = handles.replace(',', '*').replace('_', '')
 *         surface = twister.Surface((g, n))
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gluing, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[24], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[25], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_gluing, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":47
 *         g, n = int(g), int(n)
 *         gluing = gluing.replace(',', '*').replace('_', '')
 *         handles = handles.replace(',', '*').replace('_', '')             # <<<<<<<<<<<<<<
 *         surface = twister.Surface((g, n))
 *         return surface.splitting(gluing, handles, return_type='string')
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_handles, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[24], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[25], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_handles, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/tail.pyx":48
 *         gluing = gluing.replace(',', '*').replace('_', '')
 *         handles = handles.replace(',', '*').replace('_', '')
 *         surface = twister.Surface((g, n))             # <<<<<<<<<<<<<<
 *         return surface.splitting(gluing, handles, return_type='string')
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_twister); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Surface); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_g);
    __Pyx_GIVEREF(__pyx_v_g);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_g) != (0)) __PYX_ERR(3, 48, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_n);
    __Pyx_GIVEREF(__pyx_v_n);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_n) != (0)) __PYX_ERR(3, 48, __pyx_L1_error);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_v_surface = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cython/core/tail.pyx":49
 *         handles = handles.replace(',', '*').replace('_', '')
 *         surface = twister.Surface((g, n))
 *         return surface.splitting(gluing, handles, return_type='string')             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_surface;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_gluing, __pyx_v_handles};
      __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_return_type, __pyx_mstate_global->__pyx_n_u_string, __pyx_t_3, __pyx_callargs+3, 0) < 0) __PYX_ERR(3, 49, __pyx_L1_error)
      __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_splitting, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":43
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
 *     if m:             # <<<<<<<<<<<<<<
 *         g, n, gluing, handles = m.groups()
 *         g, n = int(g), int(n)
*/
  }

  /* "cython/core/tail.pyx":40
 * 
 * 
 * def splitting_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
*/

  /* 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_AddTraceback("SnapPyHP.splitting_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_gluing);
  __Pyx_XDECREF(__pyx_v_handles);
  __Pyx_XDECREF(__pyx_v_surface);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":65
 *     """
 * 
 * cdef c_Triangulation* triangulation_from_bytes(bytestring) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation* c_triangulation = NULL
 *     cdef TerseTriangulation c_terse
*/

static Triangulation *__pyx_f_8SnapPyHP_triangulation_from_bytes(PyObject *__pyx_v_bytestring) {
  Triangulation *__pyx_v_c_triangulation;
  TerseTriangulation __pyx_v_c_terse;
  int __pyx_v_N;
  int __pyx_v_n;
  int __pyx_v_m;
  PyObject *__pyx_v_byteseq = NULL;
  PyObject *__pyx_v_bit = NULL;
  Triangulation *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  int __pyx_t_7;
  Triangulation *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("triangulation_from_bytes", 0);

  /* "cython/core/tail.pyx":66
 * 
 * cdef c_Triangulation* triangulation_from_bytes(bytestring) except ? NULL:
 *     cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *     cdef TerseTriangulation c_terse
 *     cdef int N=0, n=0, m=1
*/
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/tail.pyx":68
 *     cdef c_Triangulation* c_triangulation = NULL
 *     cdef TerseTriangulation c_terse
 *     cdef int N=0, n=0, m=1             # <<<<<<<<<<<<<<
 *     byteseq = bytearray(bytestring)
 *     c_terse.num_tetrahedra = N = byteseq[0]
*/
  __pyx_v_N = 0;
  __pyx_v_n = 0;
  __pyx_v_m = 1;

  /* "cython/core/tail.pyx":69
 *     cdef TerseTriangulation c_terse
 *     cdef int N=0, n=0, m=1
 *     byteseq = bytearray(bytestring)             # <<<<<<<<<<<<<<
 *     c_terse.num_tetrahedra = N = byteseq[0]
 *     c_terse.glues_to_old_tet = <Boolean*>malloc(2*N*sizeof(Boolean))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)(&PyByteArray_Type));
  __pyx_t_3 = ((PyObject *)(&PyByteArray_Type)); 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_bytestring};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_byteseq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":70
 *     cdef int N=0, n=0, m=1
 *     byteseq = bytearray(bytestring)
 *     c_terse.num_tetrahedra = N = byteseq[0]             # <<<<<<<<<<<<<<
 *     c_terse.glues_to_old_tet = <Boolean*>malloc(2*N*sizeof(Boolean))
 *     c_terse.which_old_tet = <int*>malloc((N+1)*sizeof(int))
*/
  __pyx_t_5 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 70, __pyx_L1_error)
  __pyx_v_c_terse.num_tetrahedra = __pyx_t_5;
  __pyx_v_N = __pyx_t_5;

  /* "cython/core/tail.pyx":71
 *     byteseq = bytearray(bytestring)
 *     c_terse.num_tetrahedra = N = byteseq[0]
 *     c_terse.glues_to_old_tet = <Boolean*>malloc(2*N*sizeof(Boolean))             # <<<<<<<<<<<<<<
 *     c_terse.which_old_tet = <int*>malloc((N+1)*sizeof(int))
 *     c_terse.which_gluing = <Permutation*>malloc((N+1)*sizeof(Permutation))
*/
  __pyx_v_c_terse.glues_to_old_tet = ((Boolean *)malloc(((2 * __pyx_v_N) * (sizeof(Boolean)))));

  /* "cython/core/tail.pyx":72
 *     c_terse.num_tetrahedra = N = byteseq[0]
 *     c_terse.glues_to_old_tet = <Boolean*>malloc(2*N*sizeof(Boolean))
 *     c_terse.which_old_tet = <int*>malloc((N+1)*sizeof(int))             # <<<<<<<<<<<<<<
 *     c_terse.which_gluing = <Permutation*>malloc((N+1)*sizeof(Permutation))
 *     bit = 0
*/
  __pyx_v_c_terse.which_old_tet = ((int *)malloc(((__pyx_v_N + 1) * (sizeof(int)))));

  /* "cython/core/tail.pyx":73
 *     c_terse.glues_to_old_tet = <Boolean*>malloc(2*N*sizeof(Boolean))
 *     c_terse.which_old_tet = <int*>malloc((N+1)*sizeof(int))
 *     c_terse.which_gluing = <Permutation*>malloc((N+1)*sizeof(Permutation))             # <<<<<<<<<<<<<<
 *     bit = 0
 *     for n from 0 <= n < 2*N:
*/
  __pyx_v_c_terse.which_gluing = ((Permutation *)malloc(((__pyx_v_N + 1) * (sizeof(Permutation)))));

  /* "cython/core/tail.pyx":74
 *     c_terse.which_old_tet = <int*>malloc((N+1)*sizeof(int))
 *     c_terse.which_gluing = <Permutation*>malloc((N+1)*sizeof(Permutation))
 *     bit = 0             # <<<<<<<<<<<<<<
 *     for n from 0 <= n < 2*N:
 *         if byteseq[m] & (1 << bit):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_bit = __pyx_mstate_global->__pyx_int_0;

  /* "cython/core/tail.pyx":75
 *     c_terse.which_gluing = <Permutation*>malloc((N+1)*sizeof(Permutation))
 *     bit = 0
 *     for n from 0 <= n < 2*N:             # <<<<<<<<<<<<<<
 *         if byteseq[m] & (1 << bit):
 *             c_terse.glues_to_old_tet[n] = 1
*/
  __pyx_t_6 = (2 * __pyx_v_N);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_6; __pyx_v_n++) {

    /* "cython/core/tail.pyx":76
 *     bit = 0
 *     for n from 0 <= n < 2*N:
 *         if byteseq[m] & (1 << bit):             # <<<<<<<<<<<<<<
 *             c_terse.glues_to_old_tet[n] = 1
 *         else:
*/
    __pyx_t_5 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, __pyx_v_m, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 76, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Lshift(__pyx_mstate_global->__pyx_int_1, __pyx_v_bit); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "cython/core/tail.pyx":77
 *     for n from 0 <= n < 2*N:
 *         if byteseq[m] & (1 << bit):
 *             c_terse.glues_to_old_tet[n] = 1             # <<<<<<<<<<<<<<
 *         else:
 *             c_terse.glues_to_old_tet[n] = 0
*/
      (__pyx_v_c_terse.glues_to_old_tet[__pyx_v_n]) = 1;

      /* "cython/core/tail.pyx":76
 *     bit = 0
 *     for n from 0 <= n < 2*N:
 *         if byteseq[m] & (1 << bit):             # <<<<<<<<<<<<<<
 *             c_terse.glues_to_old_tet[n] = 1
 *         else:
*/
      goto __pyx_L5;
    }

    /* "cython/core/tail.pyx":79
 *             c_terse.glues_to_old_tet[n] = 1
 *         else:
 *             c_terse.glues_to_old_tet[n] = 0             # <<<<<<<<<<<<<<
 *         bit += 1
 *         if bit % 8 == 0:
*/
    /*else*/ {
      (__pyx_v_c_terse.glues_to_old_tet[__pyx_v_n]) = 0;
    }
    __pyx_L5:;

    /* "cython/core/tail.pyx":80
 *         else:
 *             c_terse.glues_to_old_tet[n] = 0
 *         bit += 1             # <<<<<<<<<<<<<<
 *         if bit % 8 == 0:
 *             m += 1
*/
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_bit, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_bit, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":81
 *             c_terse.glues_to_old_tet[n] = 0
 *         bit += 1
 *         if bit % 8 == 0:             # <<<<<<<<<<<<<<
 *             m += 1
 *             bit = 0
*/
    __pyx_t_2 = __Pyx_PyLong_RemainderObjC(__pyx_v_bit, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 81, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "cython/core/tail.pyx":82
 *         bit += 1
 *         if bit % 8 == 0:
 *             m += 1             # <<<<<<<<<<<<<<
 *             bit = 0
 *     if bit:
*/
      __pyx_v_m = (__pyx_v_m + 1);

      /* "cython/core/tail.pyx":83
 *         if bit % 8 == 0:
 *             m += 1
 *             bit = 0             # <<<<<<<<<<<<<<
 *     if bit:
 *         m += 1
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
      __Pyx_DECREF_SET(__pyx_v_bit, __pyx_mstate_global->__pyx_int_0);

      /* "cython/core/tail.pyx":81
 *             c_terse.glues_to_old_tet[n] = 0
 *         bit += 1
 *         if bit % 8 == 0:             # <<<<<<<<<<<<<<
 *             m += 1
 *             bit = 0
*/
    }
  }

  /* "cython/core/tail.pyx":84
 *             m += 1
 *             bit = 0
 *     if bit:             # <<<<<<<<<<<<<<
 *         m += 1
 *     for n from 0 <= n < 1 + N:
*/
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_bit); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 84, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/tail.pyx":85
 *             bit = 0
 *     if bit:
 *         m += 1             # <<<<<<<<<<<<<<
 *     for n from 0 <= n < 1 + N:
 *         c_terse.which_old_tet[n] = int(byteseq[m])
*/
    __pyx_v_m = (__pyx_v_m + 1);

    /* "cython/core/tail.pyx":84
 *             m += 1
 *             bit = 0
 *     if bit:             # <<<<<<<<<<<<<<
 *         m += 1
 *     for n from 0 <= n < 1 + N:
*/
  }

  /* "cython/core/tail.pyx":86
 *     if bit:
 *         m += 1
 *     for n from 0 <= n < 1 + N:             # <<<<<<<<<<<<<<
 *         c_terse.which_old_tet[n] = int(byteseq[m])
 *         m += 1
*/
  __pyx_t_6 = (1 + __pyx_v_N);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_6; __pyx_v_n++) {

    /* "cython/core/tail.pyx":87
 *         m += 1
 *     for n from 0 <= n < 1 + N:
 *         c_terse.which_old_tet[n] = int(byteseq[m])             # <<<<<<<<<<<<<<
 *         m += 1
 *     for n from 0 <= n < 1 + N:
*/
    __pyx_t_5 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, __pyx_v_m, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 87, __pyx_L1_error)
    (__pyx_v_c_terse.which_old_tet[__pyx_v_n]) = __pyx_t_5;

    /* "cython/core/tail.pyx":88
 *     for n from 0 <= n < 1 + N:
 *         c_terse.which_old_tet[n] = int(byteseq[m])
 *         m += 1             # <<<<<<<<<<<<<<
 *     for n from 0 <= n < 1 + N:
 *         c_terse.which_gluing[n] = int(byteseq[m])
*/
    __pyx_v_m = (__pyx_v_m + 1);
  }

  /* "cython/core/tail.pyx":89
 *         c_terse.which_old_tet[n] = int(byteseq[m])
 *         m += 1
 *     for n from 0 <= n < 1 + N:             # <<<<<<<<<<<<<<
 *         c_terse.which_gluing[n] = int(byteseq[m])
 *         m += 1
*/
  __pyx_t_6 = (1 + __pyx_v_N);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_6; __pyx_v_n++) {

    /* "cython/core/tail.pyx":90
 *         m += 1
 *     for n from 0 <= n < 1 + N:
 *         c_terse.which_gluing[n] = int(byteseq[m])             # <<<<<<<<<<<<<<
 *         m += 1
 *     c_triangulation = terse_to_tri(&c_terse)
*/
    __pyx_t_5 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, __pyx_v_m, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 90, __pyx_L1_error)
    (__pyx_v_c_terse.which_gluing[__pyx_v_n]) = ((Permutation)__pyx_t_5);

    /* "cython/core/tail.pyx":91
 *     for n from 0 <= n < 1 + N:
 *         c_terse.which_gluing[n] = int(byteseq[m])
 *         m += 1             # <<<<<<<<<<<<<<
 *     c_triangulation = terse_to_tri(&c_terse)
 *     free(c_terse.glues_to_old_tet)
*/
    __pyx_v_m = (__pyx_v_m + 1);
  }

  /* "cython/core/tail.pyx":92
 *         c_terse.which_gluing[n] = int(byteseq[m])
 *         m += 1
 *     c_triangulation = terse_to_tri(&c_terse)             # <<<<<<<<<<<<<<
 *     free(c_terse.glues_to_old_tet)
 *     free(c_terse.which_old_tet)
*/
  __pyx_t_8 = terse_to_tri((&__pyx_v_c_terse)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 92, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_8;

  /* "cython/core/tail.pyx":93
 *         m += 1
 *     c_triangulation = terse_to_tri(&c_terse)
 *     free(c_terse.glues_to_old_tet)             # <<<<<<<<<<<<<<
 *     free(c_terse.which_old_tet)
 *     free(c_terse.which_gluing)
*/
  free(__pyx_v_c_terse.glues_to_old_tet);

  /* "cython/core/tail.pyx":94
 *     c_triangulation = terse_to_tri(&c_terse)
 *     free(c_terse.glues_to_old_tet)
 *     free(c_terse.which_old_tet)             # <<<<<<<<<<<<<<
 *     free(c_terse.which_gluing)
 *     return c_triangulation
*/
  free(__pyx_v_c_terse.which_old_tet);

  /* "cython/core/tail.pyx":95
 *     free(c_terse.glues_to_old_tet)
 *     free(c_terse.which_old_tet)
 *     free(c_terse.which_gluing)             # <<<<<<<<<<<<<<
 *     return c_triangulation
 * 
*/
  free(__pyx_v_c_terse.which_gluing);

  /* "cython/core/tail.pyx":96
 *     free(c_terse.which_old_tet)
 *     free(c_terse.which_gluing)
 *     return c_triangulation             # <<<<<<<<<<<<<<
 * 
 * cdef int set_cusps(c_Triangulation* c_triangulation, fillings) except -1:
*/
  __pyx_r = __pyx_v_c_triangulation;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":65
 *     """
 * 
 * cdef c_Triangulation* triangulation_from_bytes(bytestring) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation* c_triangulation = NULL
 *     cdef TerseTriangulation c_terse
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.triangulation_from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_byteseq);
  __Pyx_XDECREF(__pyx_v_bit);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":98
 *     return c_triangulation
 * 
 * cdef int set_cusps(c_Triangulation* c_triangulation, fillings) except -1:             # <<<<<<<<<<<<<<
 *     if c_triangulation == NULL:
 *         return 0
*/

static int __pyx_f_8SnapPyHP_set_cusps(Triangulation *__pyx_v_c_triangulation, PyObject *__pyx_v_fillings) {
  int __pyx_v_num_cusps;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_meridian = NULL;
  PyObject *__pyx_v_longitude = NULL;
  PyObject *__pyx_v_is_complete = NULL;
  int __pyx_r;
  __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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  Boolean __pyx_t_12;
  __pyx_t_8SnapPyHP_Real __pyx_t_13;
  __pyx_t_8SnapPyHP_Real __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_cusps", 0);

  /* "cython/core/tail.pyx":99
 * 
 * cdef int set_cusps(c_Triangulation* c_triangulation, fillings) except -1:
 *     if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *         return 0
 *     if len(fillings) > 0:
*/
  __pyx_t_1 = (__pyx_v_c_triangulation == NULL);
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":100
 * cdef int set_cusps(c_Triangulation* c_triangulation, fillings) except -1:
 *     if c_triangulation == NULL:
 *         return 0             # <<<<<<<<<<<<<<
 *     if len(fillings) > 0:
 *         num_cusps = get_num_cusps(c_triangulation)
*/
    __pyx_r = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":99
 * 
 * cdef int set_cusps(c_Triangulation* c_triangulation, fillings) except -1:
 *     if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *         return 0
 *     if len(fillings) > 0:
*/
  }

  /* "cython/core/tail.pyx":101
 *     if c_triangulation == NULL:
 *         return 0
 *     if len(fillings) > 0:             # <<<<<<<<<<<<<<
 *         num_cusps = get_num_cusps(c_triangulation)
 *         if len(fillings) > num_cusps:
*/
  __pyx_t_2 = PyObject_Length(__pyx_v_fillings); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 101, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 > 0);
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":102
 *         return 0
 *     if len(fillings) > 0:
 *         num_cusps = get_num_cusps(c_triangulation)             # <<<<<<<<<<<<<<
 *         if len(fillings) > num_cusps:
 *             raise ValueError('The number of fillings specified exceeds '
*/
    __pyx_t_3 = get_num_cusps(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 102, __pyx_L1_error)
    __pyx_v_num_cusps = __pyx_t_3;

    /* "cython/core/tail.pyx":103
 *     if len(fillings) > 0:
 *         num_cusps = get_num_cusps(c_triangulation)
 *         if len(fillings) > num_cusps:             # <<<<<<<<<<<<<<
 *             raise ValueError('The number of fillings specified exceeds '
 *                              'the number of cusps.')
*/
    __pyx_t_2 = PyObject_Length(__pyx_v_fillings); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 103, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 > __pyx_v_num_cusps);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/tail.pyx":104
 *         num_cusps = get_num_cusps(c_triangulation)
 *         if len(fillings) > num_cusps:
 *             raise ValueError('The number of fillings specified exceeds '             # <<<<<<<<<<<<<<
 *                              'the number of cusps.')
 *         for i in range(len(fillings)):
*/
      __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_6 = __pyx_builtin_ValueError; 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_The_number_of_fillings_specified};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __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(3, 104, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 104, __pyx_L1_error)

      /* "cython/core/tail.pyx":103
 *     if len(fillings) > 0:
 *         num_cusps = get_num_cusps(c_triangulation)
 *         if len(fillings) > num_cusps:             # <<<<<<<<<<<<<<
 *             raise ValueError('The number of fillings specified exceeds '
 *                              'the number of cusps.')
*/
    }

    /* "cython/core/tail.pyx":106
 *             raise ValueError('The number of fillings specified exceeds '
 *                              'the number of cusps.')
 *         for i in range(len(fillings)):             # <<<<<<<<<<<<<<
 *             meridian, longitude = fillings[i]
 *             is_complete = (meridian == 0 and longitude == 0)
*/
    __pyx_t_2 = PyObject_Length(__pyx_v_fillings); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 106, __pyx_L1_error)
    __pyx_t_8 = __pyx_t_2;
    for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
      __pyx_v_i = __pyx_t_9;

      /* "cython/core/tail.pyx":107
 *                              'the number of cusps.')
 *         for i in range(len(fillings)):
 *             meridian, longitude = fillings[i]             # <<<<<<<<<<<<<<
 *             is_complete = (meridian == 0 and longitude == 0)
 *             set_cusp_info(c_triangulation, <int>i,
*/
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fillings, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(3, 107, __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_INCREF(__pyx_t_6);
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_5);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 107, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 107, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_5);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 107, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 107, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #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(3, 107, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
        index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(3, 107, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(3, 107, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_meridian, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_longitude, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":108
 *         for i in range(len(fillings)):
 *             meridian, longitude = fillings[i]
 *             is_complete = (meridian == 0 and longitude == 0)             # <<<<<<<<<<<<<<
 *             set_cusp_info(c_triangulation, <int>i,
 *                           is_complete,
*/
      __pyx_t_5 = __Pyx_PyLong_EqObjC(__pyx_v_meridian, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 108, __pyx_L1_error)
      if (__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_4 = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyLong_EqObjC(__pyx_v_longitude, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_L10_bool_binop_done:;
      __Pyx_XDECREF_SET(__pyx_v_is_complete, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/tail.pyx":110
 *             is_complete = (meridian == 0 and longitude == 0)
 *             set_cusp_info(c_triangulation, <int>i,
 *                           is_complete,             # <<<<<<<<<<<<<<
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
*/
      __pyx_t_12 = __Pyx_PyLong_As_Boolean(__pyx_v_is_complete); if (unlikely((__pyx_t_12 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(3, 110, __pyx_L1_error)

      /* "cython/core/tail.pyx":111
 *             set_cusp_info(c_triangulation, <int>i,
 *                           is_complete,
 *                           Object2Real(meridian),             # <<<<<<<<<<<<<<
 *                           Object2Real(longitude))
 *     return 0
*/
      __pyx_t_13 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_meridian); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 111, __pyx_L1_error)

      /* "cython/core/tail.pyx":112
 *                           is_complete,
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
      __pyx_t_14 = __pyx_f_8SnapPyHP_Object2Real(__pyx_v_longitude); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 112, __pyx_L1_error)

      /* "cython/core/tail.pyx":109
 *             meridian, longitude = fillings[i]
 *             is_complete = (meridian == 0 and longitude == 0)
 *             set_cusp_info(c_triangulation, <int>i,             # <<<<<<<<<<<<<<
 *                           is_complete,
 *                           Object2Real(meridian),
*/
      set_cusp_info(__pyx_v_c_triangulation, ((int)__pyx_v_i), __pyx_t_12, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_13), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 109, __pyx_L1_error)
    }

    /* "cython/core/tail.pyx":101
 *     if c_triangulation == NULL:
 *         return 0
 *     if len(fillings) > 0:             # <<<<<<<<<<<<<<
 *         num_cusps = get_num_cusps(c_triangulation)
 *         if len(fillings) > num_cusps:
*/
  }

  /* "cython/core/tail.pyx":113
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":98
 *     return c_triangulation
 * 
 * cdef int set_cusps(c_Triangulation* c_triangulation, fillings) except -1:             # <<<<<<<<<<<<<<
 *     if c_triangulation == NULL:
 *         return 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPyHP.set_cusps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_meridian);
  __Pyx_XDECREF(__pyx_v_longitude);
  __Pyx_XDECREF(__pyx_v_is_complete);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":117
 * 
 * # Testing code for get_triangulation
 * def get_triangulation_tester():             # <<<<<<<<<<<<<<
 *     """
 *     >>> get_triangulation_tester() # doctest: +NUMERIC6
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_51get_triangulation_tester(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_8SnapPyHP_50get_triangulation_tester, "\n    >>> get_triangulation_tester() # doctest: +NUMERIC6\n    L13n9331(0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    m003(0,0) 2.02988321 Z/5 + Z\n    m004(0,0) 2.02988321 Z\n    v1205(2,3) 4.70744340 Z/40\n    x012(0,0)(0,0) 3.54972978 Z/2 + Z\n    y123(0,0) 5.02755480 Z\n    L13n9331(3,4)(2,3)(2,1) 14.60215339 Z/53\n    K7_1(0,0) 3.57388254 Z\n    6_1(0,0) 3.16396323 Z\n    5^2_1(3,4)(1,-2) 2.73300075 Z/3\n    8^3_3(0,0)(0,0)(0,0) 8.96736085 Z + Z + Z\n    4_1(0,0) 2.02988321 Z\n    12n123(0,0) 18.15036328 Z\n    16n1235(0,0) 21.29383093 Z\n    b++RL(0,0) 2.02988321 Z\n    b-+RRL(0,0) 2.40690959 Z/3 + Z\n    b+-RL(0,0) 2.02988321 Z/5 + Z\n    b--RRL(0,0) 2.40690959 Z/3 + Z\n    Braid:[1, 2, -1, -2](0,0)(0,0) 4.05976643 Z + Z\n    DT:[(8, 10, -14), (2, 6, 20), (-4, 22, 24, 12, 26, 18, 16)](0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    DT[4,6,2](0,0) 0.0 Z\n    DT[mcccgdeGacjBklfmih](0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    DT:mcccgdeGacjBklfmih(0,0)(0,0)(0,0) 16.64369585 Z + Z + Z\n    a0*B1(0,0) 2.02988321 Z\n    b1*A0 a0*B1(1,0) 0.0 Z/2\n    dLQbcccdxwb(0,0) 2.56897060 Z/3 + Z\n    L13n9331(0,0)(0,0)(0,0) Z + Z + Z\n    m003(0,0) Z/5 + Z\n    m004(0,0) Z\n    v1205(2,3) Z/40\n    x012(0,0)(0,0) Z/2 + Z\n    y123(0,0) Z\n    L13n9331(3,4)(2,3)(2,1) Z/53\n    K7_1(0,0) Z\n    6_1(0,0) Z\n    5^2_1(3,4)(1,-2) Z/3\n    8^3_3(0,0)(0,0)(0,0) Z + Z + Z\n    4_1(0,0) Z\n    12n123(0,0) Z\n    16n1235(0,0) Z\n    b++RL(0,0) Z\n    b-+RRL(0,0) Z/3 + Z\n    b+-RL(0,0) Z/5 + Z\n    b--RRL(0,0) Z/3 + Z\n    Braid:[1, 2, -1, -2](0,0)(0,0) Z + Z\n    DT:[(8, 10, -14), (2, 6, 20), (-4, 22, 24, 12, 26, 18, 16)](0,0)(0,0)(0,0) Z + Z + Z\n    DT[4,6,2](0,0) Z\n    DT[mcccgdeGacjBklfmih](0,0)(0,0)(0,0) Z + Z + Z\n    DT:mcccgdeGacjBklfmih(0,0)(0,0)(0,0) Z + Z + Z\n    a0*B1(0,0) Z\n    b1*A0 a0*B1(1,0) Z/2\n    dLQbcccdxwb(0,0) Z/3 + Z\n    ");
static PyMethodDef __pyx_mdef_8SnapPyHP_51get_triangulation_tester = {"get_triangulation_tester", (PyCFunction)__pyx_pw_8SnapPyHP_51get_triangulation_tester, METH_NOARGS, __pyx_doc_8SnapPyHP_50get_triangulation_tester};
static PyObject *__pyx_pw_8SnapPyHP_51get_triangulation_tester(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_triangulation_tester (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8SnapPyHP_50get_triangulation_tester(__pyx_self);

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

static PyObject *__pyx_pf_8SnapPyHP_50get_triangulation_tester(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_specs = NULL;
  PyObject *__pyx_v_spec = NULL;
  PyObject *__pyx_v_vol = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_triangulation_tester", 0);

  /* "cython/core/tail.pyx":174
 *     """
 * 
 *     M = database.HTLinkExteriors['L13n9331']             # <<<<<<<<<<<<<<
 *     specs = [M._to_string(), 'm003', 'm004', 'v1205(2,3)', 'x012', 'y123',
 *              'L13n9331(3,4)(2,3)(2,1)', 'K7_1', '6_1',
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_HTLinkExteriors); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_L13n9331); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_M = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":175
 * 
 *     M = database.HTLinkExteriors['L13n9331']
 *     specs = [M._to_string(), 'm003', 'm004', 'v1205(2,3)', 'x012', 'y123',             # <<<<<<<<<<<<<<
 *              'L13n9331(3,4)(2,3)(2,1)', 'K7_1', '6_1',
 *              '5^2_1(3,4)(1,-2)', '8_3^3', 'L104001', '12n123', '16n1235',
*/
  __pyx_t_2 = __pyx_v_M;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_string, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "cython/core/tail.pyx":179
 *              '5^2_1(3,4)(1,-2)', '8_3^3', 'L104001', '12n123', '16n1235',
 *              'b++RL', 'b-+RRL', 'b+-RL', 'b--RRL',
 *              'Braid[1,2,-1,-2]', 'DT:'+repr(M.DT_code()), 'DT[4,6,2]',             # <<<<<<<<<<<<<<
 *              'DT['+M.DT_code(alpha=True) + ']',
 *              'DT:'+M.DT_code(alpha=True),
*/
  __pyx_t_4 = __pyx_v_M;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_4 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_DT, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":180
 *              'b++RL', 'b-+RRL', 'b+-RL', 'b--RRL',
 *              'Braid[1,2,-1,-2]', 'DT:'+repr(M.DT_code()), 'DT[4,6,2]',
 *              'DT['+M.DT_code(alpha=True) + ']',             # <<<<<<<<<<<<<<
 *              'DT:'+M.DT_code(alpha=True),
 *              'Bundle(S_{1,1}, [a0, B1])', 'Splitting(S_{1,0}, [b1, A0], [a0,B1])',
*/
  __pyx_t_5 = __pyx_v_M;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_alpha, Py_True, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(3, 180, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __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(3, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_DT_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":181
 *              'Braid[1,2,-1,-2]', 'DT:'+repr(M.DT_code()), 'DT[4,6,2]',
 *              'DT['+M.DT_code(alpha=True) + ']',
 *              'DT:'+M.DT_code(alpha=True),             # <<<<<<<<<<<<<<
 *              'Bundle(S_{1,1}, [a0, B1])', 'Splitting(S_{1,0}, [b1, A0], [a0,B1])',
 *              'dLQbcccdxwb']
*/
  __pyx_t_5 = __pyx_v_M;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_alpha, Py_True, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(3, 181, __pyx_L1_error)
    __pyx_t_6 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_DT_code, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_7 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_DT, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":175
 * 
 *     M = database.HTLinkExteriors['L13n9331']
 *     specs = [M._to_string(), 'm003', 'm004', 'v1205(2,3)', 'x012', 'y123',             # <<<<<<<<<<<<<<
 *              'L13n9331(3,4)(2,3)(2,1)', 'K7_1', '6_1',
 *              '5^2_1(3,4)(1,-2)', '8_3^3', 'L104001', '12n123', '16n1235',
*/
  __pyx_t_6 = PyList_New(26); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_m003);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_m003);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_n_u_m003) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_m004);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_m004);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_n_u_m004) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_v1205_2_3);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_v1205_2_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 3, __pyx_mstate_global->__pyx_kp_u_v1205_2_3) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_x012);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_x012);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 4, __pyx_mstate_global->__pyx_n_u_x012) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_y123);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_y123);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 5, __pyx_mstate_global->__pyx_n_u_y123) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_L13n9331_3_4_2_3_2_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_L13n9331_3_4_2_3_2_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 6, __pyx_mstate_global->__pyx_kp_u_L13n9331_3_4_2_3_2_1) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_K7_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_K7_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 7, __pyx_mstate_global->__pyx_n_u_K7_1) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_6_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_6_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 8, __pyx_mstate_global->__pyx_kp_u_6_1) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_5_2_1_3_4_1_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_5_2_1_3_4_1_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 9, __pyx_mstate_global->__pyx_kp_u_5_2_1_3_4_1_2) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_8_3_3);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_8_3_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 10, __pyx_mstate_global->__pyx_kp_u_8_3_3) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_L104001);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_L104001);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 11, __pyx_mstate_global->__pyx_n_u_L104001) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_12n123);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_12n123);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 12, __pyx_mstate_global->__pyx_kp_u_12n123) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_16n1235);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_16n1235);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 13, __pyx_mstate_global->__pyx_kp_u_16n1235) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_b_RL);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_b_RL);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 14, __pyx_mstate_global->__pyx_kp_u_b_RL) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_b_RRL);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_b_RRL);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 15, __pyx_mstate_global->__pyx_kp_u_b_RRL) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_b_RL_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_b_RL_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 16, __pyx_mstate_global->__pyx_kp_u_b_RL_2) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_b_RRL_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_b_RRL_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 17, __pyx_mstate_global->__pyx_kp_u_b_RRL_2) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Braid_1_2_1_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_Braid_1_2_1_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 18, __pyx_mstate_global->__pyx_kp_u_Braid_1_2_1_2) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 19, __pyx_t_2) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_DT_4_6_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_DT_4_6_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 20, __pyx_mstate_global->__pyx_kp_u_DT_4_6_2) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 21, __pyx_t_4) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 22, __pyx_t_7) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Bundle_S__1_1_a0_B1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_Bundle_S__1_1_a0_B1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 23, __pyx_mstate_global->__pyx_kp_u_Bundle_S__1_1_a0_B1) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Splitting_S__1_0_b1_A0_a0_B1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_Splitting_S__1_0_b1_A0_a0_B1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 24, __pyx_mstate_global->__pyx_kp_u_Splitting_S__1_0_b1_A0_a0_B1) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dLQbcccdxwb);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dLQbcccdxwb);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 25, __pyx_mstate_global->__pyx_n_u_dLQbcccdxwb) != (0)) __PYX_ERR(3, 175, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_7 = 0;
  __pyx_v_specs = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":185
 *              'dLQbcccdxwb']
 * 
 *     for spec in specs:             # <<<<<<<<<<<<<<
 *         M = Manifold(spec)
 *         vol = M.volume()
*/
  __pyx_t_6 = __pyx_v_specs; __Pyx_INCREF(__pyx_t_6);
  __pyx_t_8 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 185, __pyx_L1_error)
      #endif
      if (__pyx_t_8 >= __pyx_temp) break;
    }
    __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8);
    ++__pyx_t_8;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_spec, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/tail.pyx":186
 * 
 *     for spec in specs:
 *         M = Manifold(spec)             # <<<<<<<<<<<<<<
 *         vol = M.volume()
 *         if abs(vol) < 0.1:
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold);
    __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold); 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_spec};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 186, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_7);
    }
    __Pyx_DECREF_SET(__pyx_v_M, ((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "cython/core/tail.pyx":187
 *     for spec in specs:
 *         M = Manifold(spec)
 *         vol = M.volume()             # <<<<<<<<<<<<<<
 *         if abs(vol) < 0.1:
 *             vol = 0.0
*/
    __pyx_t_2 = __pyx_v_M;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_volume, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/tail.pyx":188
 *         M = Manifold(spec)
 *         vol = M.volume()
 *         if abs(vol) < 0.1:             # <<<<<<<<<<<<<<
 *             vol = 0.0
 *         print(M, vol, M.homology())
*/
    __pyx_t_7 = __Pyx_PyNumber_Absolute(__pyx_v_vol); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_mstate_global->__pyx_float_0_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {

      /* "cython/core/tail.pyx":189
 *         vol = M.volume()
 *         if abs(vol) < 0.1:
 *             vol = 0.0             # <<<<<<<<<<<<<<
 *         print(M, vol, M.homology())
 * 
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
      __Pyx_DECREF_SET(__pyx_v_vol, __pyx_mstate_global->__pyx_float_0_0);

      /* "cython/core/tail.pyx":188
 *         M = Manifold(spec)
 *         vol = M.volume()
 *         if abs(vol) < 0.1:             # <<<<<<<<<<<<<<
 *             vol = 0.0
 *         print(M, vol, M.homology())
*/
    }

    /* "cython/core/tail.pyx":190
 *         if abs(vol) < 0.1:
 *             vol = 0.0
 *         print(M, vol, M.homology())             # <<<<<<<<<<<<<<
 * 
 *     for spec in specs:
*/
    __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_builtin_print);
    __pyx_t_4 = __pyx_builtin_print; 
    __pyx_t_5 = __pyx_v_M;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_homology, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_M, __pyx_v_vol, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":185
 *              'dLQbcccdxwb']
 * 
 *     for spec in specs:             # <<<<<<<<<<<<<<
 *         M = Manifold(spec)
 *         vol = M.volume()
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":192
 *         print(M, vol, M.homology())
 * 
 *     for spec in specs:             # <<<<<<<<<<<<<<
 *         M = Triangulation(spec)
 *         print(M, M.homology())
*/
  __pyx_t_6 = __pyx_v_specs; __Pyx_INCREF(__pyx_t_6);
  __pyx_t_8 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 192, __pyx_L1_error)
      #endif
      if (__pyx_t_8 >= __pyx_temp) break;
    }
    __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8);
    ++__pyx_t_8;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_spec, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":193
 * 
 *     for spec in specs:
 *         M = Triangulation(spec)             # <<<<<<<<<<<<<<
 *         print(M, M.homology())
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
    __pyx_t_1 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation); 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_spec};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 193, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_M, ((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":194
 *     for spec in specs:
 *         M = Triangulation(spec)
 *         print(M, M.homology())             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_builtin_print);
    __pyx_t_4 = __pyx_builtin_print; 
    __pyx_t_5 = __pyx_v_M;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_homology, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_M, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":192
 *         print(M, vol, M.homology())
 * 
 *     for spec in specs:             # <<<<<<<<<<<<<<
 *         M = Triangulation(spec)
 *         print(M, M.homology())
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":117
 * 
 * # Testing code for get_triangulation
 * def get_triangulation_tester():             # <<<<<<<<<<<<<<
 *     """
 *     >>> get_triangulation_tester() # doctest: +NUMERIC6
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPyHP.get_triangulation_tester", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_specs);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XDECREF(__pyx_v_vol);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":227
 * 
 * 
 * def extract_HT_knot(record, crossings, alternation):             # <<<<<<<<<<<<<<
 *     DT = []
 *     size = (1+crossings)//2
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_53extract_HT_knot(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_8SnapPyHP_53extract_HT_knot = {"extract_HT_knot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_53extract_HT_knot, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_53extract_HT_knot(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_record = 0;
  PyObject *__pyx_v_crossings = 0;
  PyObject *__pyx_v_alternation = 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("extract_HT_knot (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_record,&__pyx_mstate_global->__pyx_n_u_crossings,&__pyx_mstate_global->__pyx_n_u_alternation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 227, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "extract_HT_knot", 0) < 0) __PYX_ERR(3, 227, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("extract_HT_knot", 1, 3, 3, i); __PYX_ERR(3, 227, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 227, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 227, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 227, __pyx_L3_error)
    }
    __pyx_v_record = values[0];
    __pyx_v_crossings = values[1];
    __pyx_v_alternation = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extract_HT_knot", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 227, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.extract_HT_knot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_52extract_HT_knot(__pyx_self, __pyx_v_record, __pyx_v_crossings, __pyx_v_alternation);

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

static PyObject *__pyx_pf_8SnapPyHP_52extract_HT_knot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_record, PyObject *__pyx_v_crossings, PyObject *__pyx_v_alternation) {
  PyObject *__pyx_v_DT = NULL;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_byte = NULL;
  PyObject *__pyx_v_first_nybble = NULL;
  PyObject *__pyx_v_second_nybble = NULL;
  PyObject *__pyx_v_signs = NULL;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extract_HT_knot", 0);

  /* "cython/core/tail.pyx":228
 * 
 * def extract_HT_knot(record, crossings, alternation):
 *     DT = []             # <<<<<<<<<<<<<<
 *     size = (1+crossings)//2
 *     for byte in record[:size]:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_DT = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":229
 * def extract_HT_knot(record, crossings, alternation):
 *     DT = []
 *     size = (1+crossings)//2             # <<<<<<<<<<<<<<
 *     for byte in record[:size]:
 *         first_nybble = (byte & 0xf0) >> 4
*/
  __pyx_t_1 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_v_crossings, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_FloorDivideObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_size = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":230
 *     DT = []
 *     size = (1+crossings)//2
 *     for byte in record[:size]:             # <<<<<<<<<<<<<<
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0:
*/
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_record, 0, 0, NULL, &__pyx_v_size, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 230, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 230, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 230, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 230, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":231
 *     size = (1+crossings)//2
 *     for byte in record[:size]:
 *         first_nybble = (byte & 0xf0) >> 4             # <<<<<<<<<<<<<<
 *         if first_nybble == 0:
 *             first_nybble = 16
*/
    __pyx_t_2 = __Pyx_PyLong_AndObjC(__pyx_v_byte, __pyx_mstate_global->__pyx_int_240, 0xf0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyLong_RshiftObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_first_nybble, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":232
 *     for byte in record[:size]:
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0:             # <<<<<<<<<<<<<<
 *             first_nybble = 16
 *         DT.append(2*first_nybble)
*/
    __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_first_nybble, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 232, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/tail.pyx":233
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0:
 *             first_nybble = 16             # <<<<<<<<<<<<<<
 *         DT.append(2*first_nybble)
 *         second_nybble = byte & 0x0f
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16);
      __Pyx_DECREF_SET(__pyx_v_first_nybble, __pyx_mstate_global->__pyx_int_16);

      /* "cython/core/tail.pyx":232
 *     for byte in record[:size]:
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0:             # <<<<<<<<<<<<<<
 *             first_nybble = 16
 *         DT.append(2*first_nybble)
*/
    }

    /* "cython/core/tail.pyx":234
 *         if first_nybble == 0:
 *             first_nybble = 16
 *         DT.append(2*first_nybble)             # <<<<<<<<<<<<<<
 *         second_nybble = byte & 0x0f
 *         if second_nybble == 0:
*/
    __pyx_t_5 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_v_first_nybble, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_DT, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 234, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":235
 *             first_nybble = 16
 *         DT.append(2*first_nybble)
 *         second_nybble = byte & 0x0f             # <<<<<<<<<<<<<<
 *         if second_nybble == 0:
 *             second_nybble = 16
*/
    __pyx_t_5 = __Pyx_PyLong_AndObjC(__pyx_v_byte, __pyx_mstate_global->__pyx_int_15, 0x0f, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_second_nybble, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":236
 *         DT.append(2*first_nybble)
 *         second_nybble = byte & 0x0f
 *         if second_nybble == 0:             # <<<<<<<<<<<<<<
 *             second_nybble = 16
 *         DT.append(2*second_nybble)
*/
    __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_second_nybble, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 236, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/tail.pyx":237
 *         second_nybble = byte & 0x0f
 *         if second_nybble == 0:
 *             second_nybble = 16             # <<<<<<<<<<<<<<
 *         DT.append(2*second_nybble)
 *     if alternation == 'n':
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16);
      __Pyx_DECREF_SET(__pyx_v_second_nybble, __pyx_mstate_global->__pyx_int_16);

      /* "cython/core/tail.pyx":236
 *         DT.append(2*first_nybble)
 *         second_nybble = byte & 0x0f
 *         if second_nybble == 0:             # <<<<<<<<<<<<<<
 *             second_nybble = 16
 *         DT.append(2*second_nybble)
*/
    }

    /* "cython/core/tail.pyx":238
 *         if second_nybble == 0:
 *             second_nybble = 16
 *         DT.append(2*second_nybble)             # <<<<<<<<<<<<<<
 *     if alternation == 'n':
 *         signs = record[-2]<<8 | record[-1]
*/
    __pyx_t_5 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_v_second_nybble, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_DT, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 238, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":230
 *     DT = []
 *     size = (1+crossings)//2
 *     for byte in record[:size]:             # <<<<<<<<<<<<<<
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":239
 *             second_nybble = 16
 *         DT.append(2*second_nybble)
 *     if alternation == 'n':             # <<<<<<<<<<<<<<
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_alternation, __pyx_mstate_global->__pyx_n_u_n, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 239, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/tail.pyx":240
 *         DT.append(2*second_nybble)
 *     if alternation == 'n':
 *         signs = record[-2]<<8 | record[-1]             # <<<<<<<<<<<<<<
 *         mask = 0x8000
 *         for i in range(crossings):
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_record, -2L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyLong_LshiftObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_record, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Or(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_signs = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":241
 *     if alternation == 'n':
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000             # <<<<<<<<<<<<<<
 *         for i in range(crossings):
 *             if (signs & (mask >> i)) == 0:
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_32768);
    __pyx_v_mask = __pyx_mstate_global->__pyx_int_32768;

    /* "cython/core/tail.pyx":242
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000
 *         for i in range(crossings):             # <<<<<<<<<<<<<<
 *             if (signs & (mask >> i)) == 0:
 *                 DT[i] = -DT[i]
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_5 = __pyx_builtin_range; 
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_crossings};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 242, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 242, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 242, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 242, __pyx_L1_error)
      } else {
        __pyx_t_2 = __pyx_t_4(__pyx_t_5);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 242, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/tail.pyx":243
 *         mask = 0x8000
 *         for i in range(crossings):
 *             if (signs & (mask >> i)) == 0:             # <<<<<<<<<<<<<<
 *                 DT[i] = -DT[i]
 *     return DT[:crossings]
*/
      __pyx_t_2 = PyNumber_Rshift(__pyx_v_mask, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 243, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_And(__pyx_v_signs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 243, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 243, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_6) {

        /* "cython/core/tail.pyx":244
 *         for i in range(crossings):
 *             if (signs & (mask >> i)) == 0:
 *                 DT[i] = -DT[i]             # <<<<<<<<<<<<<<
 *     return DT[:crossings]
 * 
*/
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_DT, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely((PyObject_SetItem(__pyx_v_DT, __pyx_v_i, __pyx_t_2) < 0))) __PYX_ERR(3, 244, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/tail.pyx":243
 *         mask = 0x8000
 *         for i in range(crossings):
 *             if (signs & (mask >> i)) == 0:             # <<<<<<<<<<<<<<
 *                 DT[i] = -DT[i]
 *     return DT[:crossings]
*/
      }

      /* "cython/core/tail.pyx":242
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000
 *         for i in range(crossings):             # <<<<<<<<<<<<<<
 *             if (signs & (mask >> i)) == 0:
 *                 DT[i] = -DT[i]
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":239
 *             second_nybble = 16
 *         DT.append(2*second_nybble)
 *     if alternation == 'n':             # <<<<<<<<<<<<<<
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000
*/
  }

  /* "cython/core/tail.pyx":245
 *             if (signs & (mask >> i)) == 0:
 *                 DT[i] = -DT[i]
 *     return DT[:crossings]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_crossings);
  __pyx_t_5 = __pyx_v_crossings;
  __pyx_t_6 = (__pyx_t_5 == Py_None);
  if (__pyx_t_6) {
    __pyx_t_3 = PY_SSIZE_T_MAX;
  } else {
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 245, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_9;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_DT, 0, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":227
 * 
 * 
 * def extract_HT_knot(record, crossings, alternation):             # <<<<<<<<<<<<<<
 *     DT = []
 *     size = (1+crossings)//2
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.extract_HT_knot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_DT);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_byte);
  __Pyx_XDECREF(__pyx_v_first_nybble);
  __Pyx_XDECREF(__pyx_v_second_nybble);
  __Pyx_XDECREF(__pyx_v_signs);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":248
 * 
 * 
 * def get_HT_knot_DT(crossings, alternation, index):             # <<<<<<<<<<<<<<
 *     size = (1 + crossings) // 2
 *     index -= 1
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_55get_HT_knot_DT(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_8SnapPyHP_55get_HT_knot_DT = {"get_HT_knot_DT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_55get_HT_knot_DT, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_55get_HT_knot_DT(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_crossings = 0;
  PyObject *__pyx_v_alternation = 0;
  PyObject *__pyx_v_index = 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_HT_knot_DT (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_crossings,&__pyx_mstate_global->__pyx_n_u_alternation,&__pyx_mstate_global->__pyx_n_u_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 248, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_HT_knot_DT", 0) < 0) __PYX_ERR(3, 248, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_HT_knot_DT", 1, 3, 3, i); __PYX_ERR(3, 248, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 248, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 248, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 248, __pyx_L3_error)
    }
    __pyx_v_crossings = values[0];
    __pyx_v_alternation = values[1];
    __pyx_v_index = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_HT_knot_DT", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 248, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.get_HT_knot_DT", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_54get_HT_knot_DT(__pyx_self, __pyx_v_crossings, __pyx_v_alternation, __pyx_v_index);

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

static PyObject *__pyx_pf_8SnapPyHP_54get_HT_knot_DT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_crossings, PyObject *__pyx_v_alternation, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_record = NULL;
  PyObject *__pyx_v_DT = 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;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_HT_knot_DT", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "cython/core/tail.pyx":249
 * 
 * def get_HT_knot_DT(crossings, alternation, index):
 *     size = (1 + crossings) // 2             # <<<<<<<<<<<<<<
 *     index -= 1
 *     if (alternation == 'a'
*/
  __pyx_t_1 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_v_crossings, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_FloorDivideObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_size = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":250
 * def get_HT_knot_DT(crossings, alternation, index):
 *     size = (1 + crossings) // 2
 *     index -= 1             # <<<<<<<<<<<<<<
 *     if (alternation == 'a'
 *             and crossings in Alternating_numbers
*/
  __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":251
 *     size = (1 + crossings) // 2
 *     index -= 1
 *     if (alternation == 'a'             # <<<<<<<<<<<<<<
 *             and crossings in Alternating_numbers
 *             and 0 <= index < Alternating_numbers[crossings]):
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_alternation, __pyx_mstate_global->__pyx_n_u_a_2, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 251, __pyx_L1_error)
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cython/core/tail.pyx":252
 *     index -= 1
 *     if (alternation == 'a'
 *             and crossings in Alternating_numbers             # <<<<<<<<<<<<<<
 *             and 0 <= index < Alternating_numbers[crossings]):
 *         offset = 8*(Alternating_offsets[crossings] + index)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Alternating_numbers); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_crossings, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cython/core/tail.pyx":253
 *     if (alternation == 'a'
 *             and crossings in Alternating_numbers
 *             and 0 <= index < Alternating_numbers[crossings]):             # <<<<<<<<<<<<<<
 *         offset = 8*(Alternating_offsets[crossings] + index)
 *         Alternating_table.seek(offset)
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_index, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 253, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Alternating_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_crossings); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_index, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 253, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;

  /* "cython/core/tail.pyx":251
 *     size = (1 + crossings) // 2
 *     index -= 1
 *     if (alternation == 'a'             # <<<<<<<<<<<<<<
 *             and crossings in Alternating_numbers
 *             and 0 <= index < Alternating_numbers[crossings]):
*/
  if (__pyx_t_3) {

    /* "cython/core/tail.pyx":254
 *             and crossings in Alternating_numbers
 *             and 0 <= index < Alternating_numbers[crossings]):
 *         offset = 8*(Alternating_offsets[crossings] + index)             # <<<<<<<<<<<<<<
 *         Alternating_table.seek(offset)
 *         data = Alternating_table.read(size)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Alternating_offsets); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_crossings); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_8, __pyx_t_2, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_offset = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":255
 *             and 0 <= index < Alternating_numbers[crossings]):
 *         offset = 8*(Alternating_offsets[crossings] + index)
 *         Alternating_table.seek(offset)             # <<<<<<<<<<<<<<
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB' % size, data)
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Alternating_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_offset};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":256
 *         offset = 8*(Alternating_offsets[crossings] + index)
 *         Alternating_table.seek(offset)
 *         data = Alternating_table.read(size)             # <<<<<<<<<<<<<<
 *         record = struct.unpack('%dB' % size, data)
 *     elif (alternation == 'n'
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Alternating_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_size};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_v_data = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":257
 *         Alternating_table.seek(offset)
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB' % size, data)             # <<<<<<<<<<<<<<
 *     elif (alternation == 'n'
 *           and crossings in Nonalternating_numbers
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_struct); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_unpack); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_dB, __pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_v_record = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":251
 *     size = (1 + crossings) // 2
 *     index -= 1
 *     if (alternation == 'a'             # <<<<<<<<<<<<<<
 *             and crossings in Alternating_numbers
 *             and 0 <= index < Alternating_numbers[crossings]):
*/
    goto __pyx_L3;
  }

  /* "cython/core/tail.pyx":258
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB' % size, data)
 *     elif (alternation == 'n'             # <<<<<<<<<<<<<<
 *           and crossings in Nonalternating_numbers
 *           and 0 <= index < Nonalternating_numbers[crossings]):
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_alternation, __pyx_mstate_global->__pyx_n_u_n, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 258, __pyx_L1_error)
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L7_bool_binop_done;
  }

  /* "cython/core/tail.pyx":259
 *         record = struct.unpack('%dB' % size, data)
 *     elif (alternation == 'n'
 *           and crossings in Nonalternating_numbers             # <<<<<<<<<<<<<<
 *           and 0 <= index < Nonalternating_numbers[crossings]):
 *         offset = 10*(Nonalternating_offsets[crossings] + index)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Nonalternating_numbers); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_crossings, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L7_bool_binop_done;
  }

  /* "cython/core/tail.pyx":260
 *     elif (alternation == 'n'
 *           and crossings in Nonalternating_numbers
 *           and 0 <= index < Nonalternating_numbers[crossings]):             # <<<<<<<<<<<<<<
 *         offset = 10*(Nonalternating_offsets[crossings] + index)
 *         Nonalternating_table.seek(offset)
*/
  __pyx_t_5 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_v_index, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 260, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_5)) {
    __Pyx_DECREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Nonalternating_numbers); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_crossings); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_index, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 260, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __pyx_t_4;
  __pyx_L7_bool_binop_done:;

  /* "cython/core/tail.pyx":258
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB' % size, data)
 *     elif (alternation == 'n'             # <<<<<<<<<<<<<<
 *           and crossings in Nonalternating_numbers
 *           and 0 <= index < Nonalternating_numbers[crossings]):
*/
  if (likely(__pyx_t_3)) {

    /* "cython/core/tail.pyx":261
 *           and crossings in Nonalternating_numbers
 *           and 0 <= index < Nonalternating_numbers[crossings]):
 *         offset = 10*(Nonalternating_offsets[crossings] + index)             # <<<<<<<<<<<<<<
 *         Nonalternating_table.seek(offset)
 *         data = Nonalternating_table.read(size+2)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Nonalternating_offsets); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_crossings); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_10, __pyx_t_5, 10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_offset = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":262
 *           and 0 <= index < Nonalternating_numbers[crossings]):
 *         offset = 10*(Nonalternating_offsets[crossings] + index)
 *         Nonalternating_table.seek(offset)             # <<<<<<<<<<<<<<
 *         data = Nonalternating_table.read(size+2)
 *         record = struct.unpack('%dB' % (size+2), data)
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Nonalternating_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_offset};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":263
 *         offset = 10*(Nonalternating_offsets[crossings] + index)
 *         Nonalternating_table.seek(offset)
 *         data = Nonalternating_table.read(size+2)             # <<<<<<<<<<<<<<
 *         record = struct.unpack('%dB' % (size+2), data)
 *     else:
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Nonalternating_table); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_size, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_v_data = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":264
 *         Nonalternating_table.seek(offset)
 *         data = Nonalternating_table.read(size+2)
 *         record = struct.unpack('%dB' % (size+2), data)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('You have specified a Hoste-Thistlethwaite '
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_struct); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_unpack); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_size, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_dB, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_8, __pyx_v_data};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_v_record = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":258
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB' % size, data)
 *     elif (alternation == 'n'             # <<<<<<<<<<<<<<
 *           and crossings in Nonalternating_numbers
 *           and 0 <= index < Nonalternating_numbers[crossings]):
*/
    goto __pyx_L3;
  }

  /* "cython/core/tail.pyx":266
 *         record = struct.unpack('%dB' % (size+2), data)
 *     else:
 *         raise ValueError('You have specified a Hoste-Thistlethwaite '             # <<<<<<<<<<<<<<
 *                          'knot with an \n'
 *                          'inappropriate index or number of crossings.')
*/
  /*else*/ {
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_8 = __pyx_builtin_ValueError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_You_have_specified_a_Hoste_Thist};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(3, 266, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/tail.pyx":270
 *                          'inappropriate index or number of crossings.')
 * 
 *     DT = extract_HT_knot(record, crossings, alternation)             # <<<<<<<<<<<<<<
 *     return DT
 * 
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_extract_HT_knot); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_record, __pyx_v_crossings, __pyx_v_alternation};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_DT = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":271
 * 
 *     DT = extract_HT_knot(record, crossings, alternation)
 *     return DT             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_DT);
  __pyx_r = __pyx_v_DT;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":248
 * 
 * 
 * def get_HT_knot_DT(crossings, alternation, index):             # <<<<<<<<<<<<<<
 *     size = (1 + crossings) // 2
 *     index -= 1
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.get_HT_knot_DT", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_record);
  __Pyx_XDECREF(__pyx_v_DT);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":274
 * 
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):             # <<<<<<<<<<<<<<
 *     crossings = 16
 *     if alternation == 'a':
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_57get_HT_knot_by_index(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_8SnapPyHP_57get_HT_knot_by_index = {"get_HT_knot_by_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_57get_HT_knot_by_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_57get_HT_knot_by_index(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_alternation = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_manifold_class = 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_HT_knot_by_index (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alternation,&__pyx_mstate_global->__pyx_n_u_index,&__pyx_mstate_global->__pyx_n_u_manifold_class_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 274, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_HT_knot_by_index", 0) < 0) __PYX_ERR(3, 274, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_HT_knot_by_index", 1, 3, 3, i); __PYX_ERR(3, 274, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 274, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 274, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 274, __pyx_L3_error)
    }
    __pyx_v_alternation = values[0];
    __pyx_v_index = values[1];
    __pyx_v_manifold_class = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_HT_knot_by_index", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 274, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.get_HT_knot_by_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_56get_HT_knot_by_index(__pyx_self, __pyx_v_alternation, __pyx_v_index, __pyx_v_manifold_class);

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

static PyObject *__pyx_pf_8SnapPyHP_56get_HT_knot_by_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_alternation, PyObject *__pyx_v_index, PyObject *__pyx_v_manifold_class) {
  PyObject *__pyx_v_crossings = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_index_within_crossings = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_HT_knot_by_index", 0);

  /* "cython/core/tail.pyx":275
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):
 *     crossings = 16             # <<<<<<<<<<<<<<
 *     if alternation == 'a':
 *         for i in range(3, 17):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16);
  __pyx_v_crossings = __pyx_mstate_global->__pyx_int_16;

  /* "cython/core/tail.pyx":276
 * def get_HT_knot_by_index(alternation, index, manifold_class):
 *     crossings = 16
 *     if alternation == 'a':             # <<<<<<<<<<<<<<
 *         for i in range(3, 17):
 *             if Alternating_offsets[i] > index:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alternation, __pyx_mstate_global->__pyx_n_u_a_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 276, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":277
 *     crossings = 16
 *     if alternation == 'a':
 *         for i in range(3, 17):             # <<<<<<<<<<<<<<
 *             if Alternating_offsets[i] > index:
 *                 crossings = i-1
*/
    for (__pyx_t_2 = 3; __pyx_t_2 < 17; __pyx_t_2+=1) {
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":278
 *     if alternation == 'a':
 *         for i in range(3, 17):
 *             if Alternating_offsets[i] > index:             # <<<<<<<<<<<<<<
 *                 crossings = i-1
 *                 break
*/
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Alternating_offsets); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_index, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 278, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_1) {

        /* "cython/core/tail.pyx":279
 *         for i in range(3, 17):
 *             if Alternating_offsets[i] > index:
 *                 crossings = i-1             # <<<<<<<<<<<<<<
 *                 break
 *         index_within_crossings = index - Alternating_offsets[crossings]
*/
        __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 279, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_crossings, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cython/core/tail.pyx":280
 *             if Alternating_offsets[i] > index:
 *                 crossings = i-1
 *                 break             # <<<<<<<<<<<<<<
 *         index_within_crossings = index - Alternating_offsets[crossings]
 *     elif alternation == 'n':
*/
        goto __pyx_L5_break;

        /* "cython/core/tail.pyx":278
 *     if alternation == 'a':
 *         for i in range(3, 17):
 *             if Alternating_offsets[i] > index:             # <<<<<<<<<<<<<<
 *                 crossings = i-1
 *                 break
*/
      }
    }
    __pyx_L5_break:;

    /* "cython/core/tail.pyx":281
 *                 crossings = i-1
 *                 break
 *         index_within_crossings = index - Alternating_offsets[crossings]             # <<<<<<<<<<<<<<
 *     elif alternation == 'n':
 *         for i in range(8, 17):
*/
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Alternating_offsets); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_crossings); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_index, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_index_within_crossings = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":276
 * def get_HT_knot_by_index(alternation, index, manifold_class):
 *     crossings = 16
 *     if alternation == 'a':             # <<<<<<<<<<<<<<
 *         for i in range(3, 17):
 *             if Alternating_offsets[i] > index:
*/
    goto __pyx_L3;
  }

  /* "cython/core/tail.pyx":282
 *                 break
 *         index_within_crossings = index - Alternating_offsets[crossings]
 *     elif alternation == 'n':             # <<<<<<<<<<<<<<
 *         for i in range(8, 17):
 *             if Nonalternating_offsets[i] > index:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alternation, __pyx_mstate_global->__pyx_n_u_n, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 282, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":283
 *         index_within_crossings = index - Alternating_offsets[crossings]
 *     elif alternation == 'n':
 *         for i in range(8, 17):             # <<<<<<<<<<<<<<
 *             if Nonalternating_offsets[i] > index:
 *                 crossings = i-1
*/
    for (__pyx_t_2 = 8; __pyx_t_2 < 17; __pyx_t_2+=1) {
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":284
 *     elif alternation == 'n':
 *         for i in range(8, 17):
 *             if Nonalternating_offsets[i] > index:             # <<<<<<<<<<<<<<
 *                 crossings = i-1
 *                 break
*/
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Nonalternating_offsets); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_index, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 284, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_1) {

        /* "cython/core/tail.pyx":285
 *         for i in range(8, 17):
 *             if Nonalternating_offsets[i] > index:
 *                 crossings = i-1             # <<<<<<<<<<<<<<
 *                 break
 *         index_within_crossings = index - Nonalternating_offsets[crossings]
*/
        __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_crossings, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cython/core/tail.pyx":286
 *             if Nonalternating_offsets[i] > index:
 *                 crossings = i-1
 *                 break             # <<<<<<<<<<<<<<
 *         index_within_crossings = index - Nonalternating_offsets[crossings]
 *     name = '%d' % crossings + alternation + '%d' % (index_within_crossings + 1)
*/
        goto __pyx_L8_break;

        /* "cython/core/tail.pyx":284
 *     elif alternation == 'n':
 *         for i in range(8, 17):
 *             if Nonalternating_offsets[i] > index:             # <<<<<<<<<<<<<<
 *                 crossings = i-1
 *                 break
*/
      }
    }
    __pyx_L8_break:;

    /* "cython/core/tail.pyx":287
 *                 crossings = i-1
 *                 break
 *         index_within_crossings = index - Nonalternating_offsets[crossings]             # <<<<<<<<<<<<<<
 *     name = '%d' % crossings + alternation + '%d' % (index_within_crossings + 1)
 *     return manifold_class(name)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Nonalternating_offsets); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_crossings); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_index, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_index_within_crossings = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":282
 *                 break
 *         index_within_crossings = index - Alternating_offsets[crossings]
 *     elif alternation == 'n':             # <<<<<<<<<<<<<<
 *         for i in range(8, 17):
 *             if Nonalternating_offsets[i] > index:
*/
  }
  __pyx_L3:;

  /* "cython/core/tail.pyx":288
 *                 break
 *         index_within_crossings = index - Nonalternating_offsets[crossings]
 *     name = '%d' % crossings + alternation + '%d' % (index_within_crossings + 1)             # <<<<<<<<<<<<<<
 *     return manifold_class(name)
 * 
*/
  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d, __pyx_v_crossings); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_alternation); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_v_index_within_crossings)) { __Pyx_RaiseUnboundLocalError("index_within_crossings"); __PYX_ERR(3, 288, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_v_index_within_crossings, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":289
 *         index_within_crossings = index - Nonalternating_offsets[crossings]
 *     name = '%d' % crossings + alternation + '%d' % (index_within_crossings + 1)
 *     return manifold_class(name)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_v_manifold_class);
  __pyx_t_4 = __pyx_v_manifold_class; 
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_name};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":274
 * 
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):             # <<<<<<<<<<<<<<
 *     crossings = 16
 *     if alternation == 'a':
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.get_HT_knot_by_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_crossings);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_index_within_crossings);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":301
 *     length = 0
 * 
 *     def __init__(self, indices=(0, 0, 0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_6Census_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_6Census_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_6Census_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_6Census_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 301, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 301, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[26])));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 301, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 301, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[26])));
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 301, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Census.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_6Census___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_6Census___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_v_myslice = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":302
 * 
 *     def __init__(self, indices=(0, 0, 0)):
 *         myslice = slice(*indices)             # <<<<<<<<<<<<<<
 *         self.start, self.stop, self.step = myslice.indices(self.length)
 *         self.index = self.start
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PySlice_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_myslice = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":303
 *     def __init__(self, indices=(0, 0, 0)):
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)             # <<<<<<<<<<<<<<
 *         self.index = self.start
 * 
*/
  __pyx_t_1 = __pyx_v_myslice;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 303, __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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(3, 303, __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_INCREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 303, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 303, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 303, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(3, 303, __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(3, 303, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_start, __pyx_t_3) < 0) __PYX_ERR(3, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop, __pyx_t_1) < 0) __PYX_ERR(3, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_step, __pyx_t_5) < 0) __PYX_ERR(3, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":304
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
 *         self.index = self.start             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_2) < 0) __PYX_ERR(3, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":301
 *     length = 0
 * 
 *     def __init__(self, indices=(0, 0, 0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.Census.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_myslice);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":306
 *         self.index = self.start
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_6Census_3__iter__(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_8SnapPyHP_6Census_3__iter__ = {"__iter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_6Census_3__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_6Census_3__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 306, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__iter__", 0) < 0) __PYX_ERR(3, 306, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, i); __PYX_ERR(3, 306, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 306, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 306, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Census.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_6Census_2__iter__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_6Census_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cython/core/tail.pyx":307
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, item):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":306
 *         self.index = self.start
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

/* "cython/core/tail.pyx":309
 *         return self
 * 
 *     def __contains__(self, item):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_6Census_5__contains__(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_8SnapPyHP_6Census_5__contains__ = {"__contains__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_6Census_5__contains__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_6Census_5__contains__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_item = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_item,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 309, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__contains__", 0) < 0) __PYX_ERR(3, 309, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, i); __PYX_ERR(3, 309, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 309, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 309, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_item = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 309, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Census.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_6Census_4__contains__(__pyx_self, __pyx_v_self, __pyx_v_item);

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

static PyObject *__pyx_pf_8SnapPyHP_6Census_4__contains__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__", 0);

  /* "cython/core/tail.pyx":310
 * 
 *     def __contains__(self, item):
 *         raise NotImplementedError("This census does not support manifold lookup")             # <<<<<<<<<<<<<<
 * 
 *     def next(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_t_3 = __pyx_builtin_NotImplementedError; 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_This_census_does_not_support_man};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(3, 310, __pyx_L1_error)

  /* "cython/core/tail.pyx":309
 *         return self
 * 
 *     def __contains__(self, item):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.Census.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":312
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         if self.index >= self.stop:
 *             raise StopIteration
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_6Census_7next(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_8SnapPyHP_6Census_7next = {"next", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_6Census_7next, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_6Census_7next(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 312, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "next", 0) < 0) __PYX_ERR(3, 312, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("next", 1, 1, 1, i); __PYX_ERR(3, 312, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 312, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("next", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 312, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Census.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_6Census_6next(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_6Census_6next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);

  /* "cython/core/tail.pyx":313
 * 
 *     def next(self):
 *         if self.index >= self.stop:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         self.index = self.index + self.step
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 313, __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(3, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/tail.pyx":314
 *     def next(self):
 *         if self.index >= self.stop:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         self.index = self.index + self.step
 *         return self[self.index-self.step]
*/
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(3, 314, __pyx_L1_error)

    /* "cython/core/tail.pyx":313
 * 
 *     def next(self):
 *         if self.index >= self.stop:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         self.index = self.index + self.step
*/
  }

  /* "cython/core/tail.pyx":315
 *         if self.index >= self.stop:
 *             raise StopIteration
 *         self.index = self.index + self.step             # <<<<<<<<<<<<<<
 *         return self[self.index-self.step]
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 315, __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 (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_1) < 0) __PYX_ERR(3, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":316
 *             raise StopIteration
 *         self.index = self.index + self.step
 *         return self[self.index-self.step]             # <<<<<<<<<<<<<<
 * 
 *     __next__ = next
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":312
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         if self.index >= self.stop:
 *             raise StopIteration
*/

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

/* "cython/core/tail.pyx":320
 *     __next__ = next
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_6Census_9__len__(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_8SnapPyHP_6Census_9__len__ = {"__len__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_6Census_9__len__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_6Census_9__len__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 320, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__len__", 0) < 0) __PYX_ERR(3, 320, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__len__", 1, 1, 1, i); __PYX_ERR(3, 320, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 320, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__len__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 320, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Census.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_6Census_8__len__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_6Census_8__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("__len__", 0);

  /* "cython/core/tail.pyx":321
 * 
 *     def __len__(self):
 *         return self.length             # <<<<<<<<<<<<<<
 * 
 *     # subclasses override this
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":320
 *     __next__ = next
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length
 * 
*/

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

/* "cython/core/tail.pyx":324
 * 
 *     # subclasses override this
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_6Census_11__getitem__(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_8SnapPyHP_6Census_11__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_6Census_11__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_6Census_11__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_n = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 324, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 324, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 324, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 324, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 324, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 324, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 324, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 324, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.Census.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_6Census_10__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_6Census_10__getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__", 0);

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

/* "cython/core/tail.pyx":376
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 *         self.Census_Morwen8 = tarfile.open(os.path.join(manifold_path, 'morwen8.tgz'), 'r:*')
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12CuspedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_12CuspedCensus_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12CuspedCensus_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_12CuspedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 376, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 376, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 376, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 376, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 376, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CuspedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_12CuspedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_12CuspedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":377
 * 
 *     def __init__(self, indices=(0, length, 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 *         self.Census_Morwen8 = tarfile.open(os.path.join(manifold_path, 'morwen8.tgz'), 'r:*')
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":378
 *     def __init__(self, indices=(0, length, 1)):
 *         Census.__init__(self, indices)
 *         self.Census_Morwen8 = tarfile.open(os.path.join(manifold_path, 'morwen8.tgz'), 'r:*')             # <<<<<<<<<<<<<<
 * 
 *     # Override
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tarfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = __pyx_t_8;
  __Pyx_INCREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_7, __pyx_mstate_global->__pyx_kp_u_morwen8_tgz};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_kp_u_r_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Census_Morwen8, __pyx_t_1) < 0) __PYX_ERR(3, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":376
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 *         self.Census_Morwen8 = tarfile.open(os.path.join(manifold_path, 'morwen8.tgz'), 'r:*')
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.CuspedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":381
 * 
 *     # Override
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_orientable[n]
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12CuspedCensus_3lookup(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_8SnapPyHP_12CuspedCensus_3lookup = {"lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12CuspedCensus_3lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_12CuspedCensus_3lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 381, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lookup", 0) < 0) __PYX_ERR(3, 381, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, i); __PYX_ERR(3, 381, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 381, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 381, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 381, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CuspedCensus.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_12CuspedCensus_2lookup(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_12CuspedCensus_2lookup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  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("lookup", 0);

  /* "cython/core/tail.pyx":382
 *     # Override
 *     def lookup(self, n):
 *         return five_tet_orientable[n]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_five_tet_orientable); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 382, __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;

  /* "cython/core/tail.pyx":381
 * 
 *     # Override
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_orientable[n]
 * 
*/

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

/* "cython/core/tail.pyx":384
 *         return five_tet_orientable[n]
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_12CuspedCensus_5__getitem__(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_8SnapPyHP_12CuspedCensus_5__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12CuspedCensus_5__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_12CuspedCensus_5__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 384, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 384, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 384, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 384, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 384, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 384, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 384, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 384, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.CuspedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_12CuspedCensus_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_12CuspedCensus_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_result = 0;
  long __pyx_v_num_tet;
  PyObject *__pyx_v_census_index = NULL;
  PyObject *__pyx_v_num = NULL;
  PyObject *__pyx_v_spec = NULL;
  PyObject *__pyx_v_tarpath = NULL;
  PyObject *__pyx_v_filedata = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  char *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Orientability __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_n);

  /* "cython/core/tail.pyx":387
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         if n < 0:
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":388
 *         cdef Manifold result
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         if n < 0:
 *             n = self.length - n
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = __pyx_v_n;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(3, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":387
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         if n < 0:
*/
  }

  /* "cython/core/tail.pyx":389
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 *         if n < 0:             # <<<<<<<<<<<<<<
 *             n = self.length - n
 *         if n < self.five_length:
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 389, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":390
 *             return self.__class__(n.indices(self.length))
 *         if n < 0:
 *             n = self.length - n             # <<<<<<<<<<<<<<
 *         if n < self.five_length:
 *             num_tet = 5
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":389
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 *         if n < 0:             # <<<<<<<<<<<<<<
 *             n = self.length - n
 *         if n < self.five_length:
*/
  }

  /* "cython/core/tail.pyx":391
 *         if n < 0:
 *             n = self.length - n
 *         if n < self.five_length:             # <<<<<<<<<<<<<<
 *             num_tet = 5
 *             census_index = self.lookup(n)
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_five_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":392
 *             n = self.length - n
 *         if n < self.five_length:
 *             num_tet = 5             # <<<<<<<<<<<<<<
 *             census_index = self.lookup(n)
 *         elif n - self.five_length < self.six_length:
*/
    __pyx_v_num_tet = 5;

    /* "cython/core/tail.pyx":393
 *         if n < self.five_length:
 *             num_tet = 5
 *             census_index = self.lookup(n)             # <<<<<<<<<<<<<<
 *         elif n - self.five_length < self.six_length:
 *             num_tet = 6
*/
    __pyx_t_4 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_n};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_lookup, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_census_index = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":391
 *         if n < 0:
 *             n = self.length - n
 *         if n < self.five_length:             # <<<<<<<<<<<<<<
 *             num_tet = 5
 *             census_index = self.lookup(n)
*/
    goto __pyx_L5;
  }

  /* "cython/core/tail.pyx":394
 *             num_tet = 5
 *             census_index = self.lookup(n)
 *         elif n - self.five_length < self.six_length:             # <<<<<<<<<<<<<<
 *             num_tet = 6
 *             census_index = n - self.five_length
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_five_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_n, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_six_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":395
 *             census_index = self.lookup(n)
 *         elif n - self.five_length < self.six_length:
 *             num_tet = 6             # <<<<<<<<<<<<<<
 *             census_index = n - self.five_length
 *         elif n - self.five_length - self.six_length < self.seven_length:
*/
    __pyx_v_num_tet = 6;

    /* "cython/core/tail.pyx":396
 *         elif n - self.five_length < self.six_length:
 *             num_tet = 6
 *             census_index = n - self.five_length             # <<<<<<<<<<<<<<
 *         elif n - self.five_length - self.six_length < self.seven_length:
 *             num_tet = 7
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_five_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_census_index = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":394
 *             num_tet = 5
 *             census_index = self.lookup(n)
 *         elif n - self.five_length < self.six_length:             # <<<<<<<<<<<<<<
 *             num_tet = 6
 *             census_index = n - self.five_length
*/
    goto __pyx_L5;
  }

  /* "cython/core/tail.pyx":397
 *             num_tet = 6
 *             census_index = n - self.five_length
 *         elif n - self.five_length - self.six_length < self.seven_length:             # <<<<<<<<<<<<<<
 *             num_tet = 7
 *             census_index = n - self.five_length - self.six_length
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_five_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_n, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_six_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_seven_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":398
 *             census_index = n - self.five_length
 *         elif n - self.five_length - self.six_length < self.seven_length:
 *             num_tet = 7             # <<<<<<<<<<<<<<
 *             census_index = n - self.five_length - self.six_length
 *         elif (self.orientability == Orientability.index('orientable')
*/
    __pyx_v_num_tet = 7;

    /* "cython/core/tail.pyx":399
 *         elif n - self.five_length - self.six_length < self.seven_length:
 *             num_tet = 7
 *             census_index = n - self.five_length - self.six_length             # <<<<<<<<<<<<<<
 *         elif (self.orientability == Orientability.index('orientable')
 *               and (n - self.five_length - self.six_length -
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_five_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_six_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 399, __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_v_census_index = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":397
 *             num_tet = 6
 *             census_index = n - self.five_length
 *         elif n - self.five_length - self.six_length < self.seven_length:             # <<<<<<<<<<<<<<
 *             num_tet = 7
 *             census_index = n - self.five_length - self.six_length
*/
    goto __pyx_L5;
  }

  /* "cython/core/tail.pyx":400
 *             num_tet = 7
 *             census_index = n - self.five_length - self.six_length
 *         elif (self.orientability == Orientability.index('orientable')             # <<<<<<<<<<<<<<
 *               and (n - self.five_length - self.six_length -
 *                    self.seven_length < self.eight_length)):
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_orientability); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Orientability); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_orientable};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }

  /* "cython/core/tail.pyx":401
 *             census_index = n - self.five_length - self.six_length
 *         elif (self.orientability == Orientability.index('orientable')
 *               and (n - self.five_length - self.six_length -             # <<<<<<<<<<<<<<
 *                    self.seven_length < self.eight_length)):
 *             census_index = (n - self.five_length - self.six_length
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_five_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_n, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_six_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":402
 *         elif (self.orientability == Orientability.index('orientable')
 *               and (n - self.five_length - self.six_length -
 *                    self.seven_length < self.eight_length)):             # <<<<<<<<<<<<<<
 *             census_index = (n - self.five_length - self.six_length
 *                             - self.seven_length)
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_seven_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "cython/core/tail.pyx":401
 *             census_index = n - self.five_length - self.six_length
 *         elif (self.orientability == Orientability.index('orientable')
 *               and (n - self.five_length - self.six_length -             # <<<<<<<<<<<<<<
 *                    self.seven_length < self.eight_length)):
 *             census_index = (n - self.five_length - self.six_length
*/
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":402
 *         elif (self.orientability == Orientability.index('orientable')
 *               and (n - self.five_length - self.six_length -
 *                    self.seven_length < self.eight_length)):             # <<<<<<<<<<<<<<
 *             census_index = (n - self.five_length - self.six_length
 *                             - self.seven_length)
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_eight_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_8;
  __pyx_L6_bool_binop_done:;

  /* "cython/core/tail.pyx":400
 *             num_tet = 7
 *             census_index = n - self.five_length - self.six_length
 *         elif (self.orientability == Orientability.index('orientable')             # <<<<<<<<<<<<<<
 *               and (n - self.five_length - self.six_length -
 *                    self.seven_length < self.eight_length)):
*/
  if (likely(__pyx_t_1)) {

    /* "cython/core/tail.pyx":403
 *               and (n - self.five_length - self.six_length -
 *                    self.seven_length < self.eight_length)):
 *             census_index = (n - self.five_length - self.six_length             # <<<<<<<<<<<<<<
 *                             - self.seven_length)
 *             # Make this work without passing the spec to Manifold()
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_five_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_n, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_six_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":404
 *                    self.seven_length < self.eight_length)):
 *             census_index = (n - self.five_length - self.six_length
 *                             - self.seven_length)             # <<<<<<<<<<<<<<
 *             # Make this work without passing the spec to Manifold()
 *             num = repr(census_index)
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_seven_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 404, __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;
    __pyx_v_census_index = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":406
 *                             - self.seven_length)
 *             # Make this work without passing the spec to Manifold()
 *             num = repr(census_index)             # <<<<<<<<<<<<<<
 *             spec = "t" + "0"*(5 - len(num)) + num
 *             tarpath = "morwen8/" + spec
*/
    __pyx_t_5 = PyObject_Repr(__pyx_v_census_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_num = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":407
 *             # Make this work without passing the spec to Manifold()
 *             num = repr(census_index)
 *             spec = "t" + "0"*(5 - len(num)) + num             # <<<<<<<<<<<<<<
 *             tarpath = "morwen8/" + spec
 *             try:
*/
    if (unlikely(__pyx_v_num == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(3, 407, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_num); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(3, 407, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_kp_u_0, (5 - __pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_n_u_t, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_t_4, __pyx_v_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_spec = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":408
 *             num = repr(census_index)
 *             spec = "t" + "0"*(5 - len(num)) + num
 *             tarpath = "morwen8/" + spec             # <<<<<<<<<<<<<<
 *             try:
 *                 filedata = self.Census_Morwen8.extractfile(tarpath).read()
*/
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_morwen8, __pyx_v_spec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_tarpath = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":409
 *             spec = "t" + "0"*(5 - len(num)) + num
 *             tarpath = "morwen8/" + spec
 *             try:             # <<<<<<<<<<<<<<
 *                 filedata = self.Census_Morwen8.extractfile(tarpath).read()
 *                 c_triangulation = read_triangulation_from_string(filedata)
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "cython/core/tail.pyx":410
 *             tarpath = "morwen8/" + spec
 *             try:
 *                 filedata = self.Census_Morwen8.extractfile(tarpath).read()             # <<<<<<<<<<<<<<
 *                 c_triangulation = read_triangulation_from_string(filedata)
 *             except:
*/
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Census_Morwen8); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 410, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __pyx_t_6;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_7 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_tarpath};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extractfile, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 410, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_t_4 = __pyx_t_3;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 410, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __pyx_v_filedata = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "cython/core/tail.pyx":411
 *             try:
 *                 filedata = self.Census_Morwen8.extractfile(tarpath).read()
 *                 c_triangulation = read_triangulation_from_string(filedata)             # <<<<<<<<<<<<<<
 *             except:
 *                 raise IOError('The Morwen 8 tetrahedra manifold %s '
*/
        __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_filedata); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(3, 411, __pyx_L8_error)
        __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_13);

        /* "cython/core/tail.pyx":409
 *             spec = "t" + "0"*(5 - len(num)) + num
 *             tarpath = "morwen8/" + spec
 *             try:             # <<<<<<<<<<<<<<
 *                 filedata = self.Census_Morwen8.extractfile(tarpath).read()
 *                 c_triangulation = read_triangulation_from_string(filedata)
*/
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/tail.pyx":412
 *                 filedata = self.Census_Morwen8.extractfile(tarpath).read()
 *                 c_triangulation = read_triangulation_from_string(filedata)
 *             except:             # <<<<<<<<<<<<<<
 *                 raise IOError('The Morwen 8 tetrahedra manifold %s '
 *                               'was not found.' % spec)
*/
      /*except:*/ {
        __Pyx_AddTraceback("SnapPyHP.CuspedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(3, 412, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_4);

        /* "cython/core/tail.pyx":413
 *                 c_triangulation = read_triangulation_from_string(filedata)
 *             except:
 *                 raise IOError('The Morwen 8 tetrahedra manifold %s '             # <<<<<<<<<<<<<<
 *                               'was not found.' % spec)
 *             result = Manifold(spec='empty')
*/
        __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_builtin_IOError);
        __pyx_t_14 = __pyx_builtin_IOError; 

        /* "cython/core/tail.pyx":414
 *             except:
 *                 raise IOError('The Morwen 8 tetrahedra manifold %s '
 *                               'was not found.' % spec)             # <<<<<<<<<<<<<<
 *             result = Manifold(spec='empty')
 *             result.set_c_triangulation(c_triangulation)
*/
        __pyx_t_15 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_The_Morwen_8_tetrahedra_manifold, __pyx_v_spec); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 414, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_7 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_15};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 413, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(3, 413, __pyx_L10_except_error)
      }

      /* "cython/core/tail.pyx":409
 *             spec = "t" + "0"*(5 - len(num)) + num
 *             tarpath = "morwen8/" + spec
 *             try:             # <<<<<<<<<<<<<<
 *                 filedata = self.Census_Morwen8.extractfile(tarpath).read()
 *                 c_triangulation = read_triangulation_from_string(filedata)
*/
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "cython/core/tail.pyx":415
 *                 raise IOError('The Morwen 8 tetrahedra manifold %s '
 *                               'was not found.' % spec)
 *             result = Manifold(spec='empty')             # <<<<<<<<<<<<<<
 *             result.set_c_triangulation(c_triangulation)
 *             return result
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold);
    __pyx_t_5 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold); 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL};
      __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_spec, __pyx_mstate_global->__pyx_n_u_empty, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(3, 415, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 415, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }
    __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":416
 *                               'was not found.' % spec)
 *             result = Manifold(spec='empty')
 *             result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *             return result
 *             # return Manifold('t%d' % census_index)
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":417
 *             result = Manifold(spec='empty')
 *             result.set_c_triangulation(c_triangulation)
 *             return result             # <<<<<<<<<<<<<<
 *             # return Manifold('t%d' % census_index)
 *         else:
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_result);
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;

    /* "cython/core/tail.pyx":400
 *             num_tet = 7
 *             census_index = n - self.five_length - self.six_length
 *         elif (self.orientability == Orientability.index('orientable')             # <<<<<<<<<<<<<<
 *               and (n - self.five_length - self.six_length -
 *                    self.seven_length < self.eight_length)):
*/
  }

  /* "cython/core/tail.pyx":420
 *             # return Manifold('t%d' % census_index)
 *         else:
 *             raise IndexError('Index is out of range.')             # <<<<<<<<<<<<<<
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, num_tet, self.orientability, census_index)
*/
  /*else*/ {
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_IndexError);
    __pyx_t_6 = __pyx_builtin_IndexError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Index_is_out_of_range};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(3, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 420, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "cython/core/tail.pyx":422
 *             raise IndexError('Index is out of range.')
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, num_tet, self.orientability, census_index)             # <<<<<<<<<<<<<<
 *         if c_triangulation == NULL:
 *             print(num_tet, census_index)
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(3, 422, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_orientability); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_16 = ((Orientability)__Pyx_PyLong_As_Orientability(__pyx_t_6)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_17 = __Pyx_PyLong_As_int(__pyx_v_census_index); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 422, __pyx_L1_error)

  /* "cython/core/tail.pyx":421
 *         else:
 *             raise IndexError('Index is out of range.')
 *         c_triangulation = GetCuspedCensusManifold(             # <<<<<<<<<<<<<<
 *             self.path, num_tet, self.orientability, census_index)
 *         if c_triangulation == NULL:
*/
  __pyx_v_c_triangulation = GetCuspedCensusManifold(__pyx_t_13, __pyx_v_num_tet, __pyx_t_16, __pyx_t_17);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":423
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, num_tet, self.orientability, census_index)
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             print(num_tet, census_index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
*/
  __pyx_t_1 = (__pyx_v_c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/tail.pyx":424
 *             self.path, num_tet, self.orientability, census_index)
 *         if c_triangulation == NULL:
 *             print(num_tet, census_index)             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Manifold(spec='empty')
*/
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_print);
    __pyx_t_5 = __pyx_builtin_print; 
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_num_tet); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_census_index};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":425
 *         if c_triangulation == NULL:
 *             print(num_tet, census_index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')             # <<<<<<<<<<<<<<
 *         result = Manifold(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_3 = __pyx_builtin_RuntimeError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_SnapPea_failed_to_read_the_censu};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 425, __pyx_L1_error)

    /* "cython/core/tail.pyx":423
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, num_tet, self.orientability, census_index)
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             print(num_tet, census_index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
*/
  }

  /* "cython/core/tail.pyx":426
 *             print(num_tet, census_index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Manifold(spec='empty')             # <<<<<<<<<<<<<<
 *         result.set_c_triangulation(c_triangulation)
 *         return result
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold);
  __pyx_t_5 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_spec, __pyx_mstate_global->__pyx_n_u_empty, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(3, 426, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 426, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":427
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Manifold(spec='empty')
 *         result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":428
 *         result = Manifold(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "cython/core/tail.pyx":384
 *         return five_tet_orientable[n]
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPyHP.CuspedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_census_index);
  __Pyx_XDECREF(__pyx_v_num);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XDECREF(__pyx_v_tarpath);
  __Pyx_XDECREF(__pyx_v_filedata);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":444
 *     orientability = Orientability.index('nonorientable')
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableCuspedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_28ObsNonorientableCuspedCensus_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_28ObsNonorientableCuspedCensus_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableCuspedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 444, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 444, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 444, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 444, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 444, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 444, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 444, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 444, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsNonorientableCuspedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_28ObsNonorientableCuspedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableCuspedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":445
 * 
 *     def __init__(self, indices=(0, length, 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def lookup(self, n):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":444
 *     orientability = Orientability.index('nonorientable')
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/

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

/* "cython/core/tail.pyx":447
 *         Census.__init__(self, indices)
 * 
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_nonorientable[n]
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableCuspedCensus_3lookup(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_8SnapPyHP_28ObsNonorientableCuspedCensus_3lookup = {"lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_28ObsNonorientableCuspedCensus_3lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableCuspedCensus_3lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 447, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lookup", 0) < 0) __PYX_ERR(3, 447, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, i); __PYX_ERR(3, 447, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 447, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 447, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 447, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsNonorientableCuspedCensus.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_28ObsNonorientableCuspedCensus_2lookup(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableCuspedCensus_2lookup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  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("lookup", 0);

  /* "cython/core/tail.pyx":448
 * 
 *     def lookup(self, n):
 *         return five_tet_nonorientable[n]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_five_tet_nonorientable); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 448, __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;

  /* "cython/core/tail.pyx":447
 *         Census.__init__(self, indices)
 * 
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_nonorientable[n]
 * 
*/

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

/* "cython/core/tail.pyx":461
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 11031, 1)):             # <<<<<<<<<<<<<<
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_25ObsOrientableClosedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_25ObsOrientableClosedCensus_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_25ObsOrientableClosedCensus_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_25ObsOrientableClosedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 461, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 461, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 461, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 461, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[27])));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 461, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 461, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 461, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[27])));
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 461, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsOrientableClosedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_25ObsOrientableClosedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_25ObsOrientableClosedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_v_datafile = NULL;
  PyObject *__pyx_v_closed_orientable = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":462
 * 
 *     def __init__(self, indices=(0, 11031, 1)):
 *         if ObsOrientableClosedCensus.data is None:             # <<<<<<<<<<<<<<
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedOrientableDistinct.txt')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cython/core/tail.pyx":463
 *     def __init__(self, indices=(0, 11031, 1)):
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,             # <<<<<<<<<<<<<<
 *                                     'ClosedOrientableDistinct.txt')
 *             closed_orientable = open(datafile)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_closed_census_directory); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_ClosedOrientableDistinct_txt};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_datafile = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":465
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedOrientableDistinct.txt')
 *             closed_orientable = open(datafile)             # <<<<<<<<<<<<<<
 *             ObsOrientableClosedCensus.data = closed_orientable.readlines()
 *             closed_orientable.close()
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_open);
    __pyx_t_4 = __pyx_builtin_open; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_datafile};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_closed_orientable = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":466
 *                                     'ClosedOrientableDistinct.txt')
 *             closed_orientable = open(datafile)
 *             ObsOrientableClosedCensus.data = closed_orientable.readlines()             # <<<<<<<<<<<<<<
 *             closed_orientable.close()
 *         self.length = len(ObsOrientableClosedCensus.data)
*/
    __pyx_t_4 = __pyx_v_closed_orientable;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_readlines, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_2) < 0) __PYX_ERR(3, 466, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":467
 *             closed_orientable = open(datafile)
 *             ObsOrientableClosedCensus.data = closed_orientable.readlines()
 *             closed_orientable.close()             # <<<<<<<<<<<<<<
 *         self.length = len(ObsOrientableClosedCensus.data)
 *         Census.__init__(self, indices)
*/
    __pyx_t_2 = __pyx_v_closed_orientable;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":462
 * 
 *     def __init__(self, indices=(0, 11031, 1)):
 *         if ObsOrientableClosedCensus.data is None:             # <<<<<<<<<<<<<<
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedOrientableDistinct.txt')
*/
  }

  /* "cython/core/tail.pyx":468
 *             ObsOrientableClosedCensus.data = closed_orientable.readlines()
 *             closed_orientable.close()
 *         self.length = len(ObsOrientableClosedCensus.data)             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_2) < 0) __PYX_ERR(3, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":469
 *             closed_orientable.close()
 *         self.length = len(ObsOrientableClosedCensus.data)
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_self, __pyx_v_indices};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":461
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 11031, 1)):             # <<<<<<<<<<<<<<
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.ObsOrientableClosedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datafile);
  __Pyx_XDECREF(__pyx_v_closed_orientable);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":471
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_25ObsOrientableClosedCensus_3__getitem__(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_8SnapPyHP_25ObsOrientableClosedCensus_3__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_25ObsOrientableClosedCensus_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_25ObsOrientableClosedCensus_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 471, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 471, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 471, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 471, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 471, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 471, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 471, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 471, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsOrientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_25ObsOrientableClosedCensus_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_25ObsOrientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_result = 0;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_num_tet = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  char *__pyx_t_11;
  int __pyx_t_12;
  Orientability __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":474
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":475
 *         cdef Manifold result
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         _, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = __pyx_v_n;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(3, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":474
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
*/
  }

  /* "cython/core/tail.pyx":476
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()             # <<<<<<<<<<<<<<
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 476, __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 != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(3, 476, __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_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 476, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 476, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 476, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 3);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 476, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 4);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 476, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_6,&__pyx_t_5,&__pyx_t_8};
      for (i=0; i < 5; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(3, 476, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_6,&__pyx_t_5,&__pyx_t_8};
    __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(3, 476, __pyx_L1_error)
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(3, 476, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v__ = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_num_tet = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_index = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_m = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_l = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":478
 *         _, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))             # <<<<<<<<<<<<<<
 *         if c_triangulation == NULL:
 *             print(num_tet, index)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(3, 478, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_num_tet); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_orientability); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_13 = ((Orientability)__Pyx_PyLong_As_Orientability(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":477
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(             # <<<<<<<<<<<<<<
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:
*/
  __pyx_v_c_triangulation = GetCuspedCensusManifold(__pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":479
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
*/
  __pyx_t_1 = (__pyx_v_c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/tail.pyx":480
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:
 *             print(num_tet, index)             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Triangulation(spec='empty')
*/
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_builtin_print);
    __pyx_t_5 = __pyx_builtin_print; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_num_tet, __pyx_v_index};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":481
 *         if c_triangulation == NULL:
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')             # <<<<<<<<<<<<<<
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_8 = __pyx_builtin_RuntimeError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_SnapPea_failed_to_read_the_censu};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 481, __pyx_L1_error)

    /* "cython/core/tail.pyx":479
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
*/
  }

  /* "cython/core/tail.pyx":482
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Triangulation(spec='empty')             # <<<<<<<<<<<<<<
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill((int(m), int(l)))
*/
  __pyx_t_8 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __pyx_t_5 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_spec, __pyx_mstate_global->__pyx_n_u_empty, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(3, 482, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 482, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  if (!(likely(((((PyObject *)__pyx_t_2)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(3, 482, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":483
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         result.dehn_fill((int(m), int(l)))
 *         return result.with_hyperbolic_structure()
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":484
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill((int(m), int(l)))             # <<<<<<<<<<<<<<
 *         return result.with_hyperbolic_structure()
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_result);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6) != (0)) __PYX_ERR(3, 484, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8) != (0)) __PYX_ERR(3, 484, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":485
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill((int(m), int(l)))
 *         return result.with_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)__pyx_v_result);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_hyperbolic_structure, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":471
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.ObsOrientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_num_tet);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":496
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 17, 1)):             # <<<<<<<<<<<<<<
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableClosedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_28ObsNonorientableClosedCensus_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_28ObsNonorientableClosedCensus_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableClosedCensus_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 496, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 496, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[28])));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 496, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 496, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[28])));
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 496, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsNonorientableClosedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_28ObsNonorientableClosedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableClosedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_v_datafile = NULL;
  PyObject *__pyx_v_closed_nonorientable = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":497
 * 
 *     def __init__(self, indices=(0, 17, 1)):
 *         if ObsNonorientableClosedCensus.data is None:             # <<<<<<<<<<<<<<
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedNonorientableDistinct.txt')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cython/core/tail.pyx":498
 *     def __init__(self, indices=(0, 17, 1)):
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,             # <<<<<<<<<<<<<<
 *                                     'ClosedNonorientableDistinct.txt')
 *             closed_nonorientable = open(datafile)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_closed_census_directory); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_ClosedNonorientableDistinct_txt};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_datafile = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":500
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedNonorientableDistinct.txt')
 *             closed_nonorientable = open(datafile)             # <<<<<<<<<<<<<<
 *             ObsNonorientableClosedCensus.data = closed_nonorientable.readlines()
 *             closed_nonorientable.close()
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_open);
    __pyx_t_4 = __pyx_builtin_open; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_datafile};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_closed_nonorientable = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":501
 *                                     'ClosedNonorientableDistinct.txt')
 *             closed_nonorientable = open(datafile)
 *             ObsNonorientableClosedCensus.data = closed_nonorientable.readlines()             # <<<<<<<<<<<<<<
 *             closed_nonorientable.close()
 *         self.length = len(ObsNonorientableClosedCensus.data)
*/
    __pyx_t_4 = __pyx_v_closed_nonorientable;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_readlines, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_2) < 0) __PYX_ERR(3, 501, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":502
 *             closed_nonorientable = open(datafile)
 *             ObsNonorientableClosedCensus.data = closed_nonorientable.readlines()
 *             closed_nonorientable.close()             # <<<<<<<<<<<<<<
 *         self.length = len(ObsNonorientableClosedCensus.data)
 *         Census.__init__(self, indices)
*/
    __pyx_t_2 = __pyx_v_closed_nonorientable;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 502, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":497
 * 
 *     def __init__(self, indices=(0, 17, 1)):
 *         if ObsNonorientableClosedCensus.data is None:             # <<<<<<<<<<<<<<
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedNonorientableDistinct.txt')
*/
  }

  /* "cython/core/tail.pyx":503
 *             ObsNonorientableClosedCensus.data = closed_nonorientable.readlines()
 *             closed_nonorientable.close()
 *         self.length = len(ObsNonorientableClosedCensus.data)             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_2) < 0) __PYX_ERR(3, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":504
 *             closed_nonorientable.close()
 *         self.length = len(ObsNonorientableClosedCensus.data)
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_self, __pyx_v_indices};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":496
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 17, 1)):             # <<<<<<<<<<<<<<
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.ObsNonorientableClosedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datafile);
  __Pyx_XDECREF(__pyx_v_closed_nonorientable);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":506
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableClosedCensus_3__getitem__(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_8SnapPyHP_28ObsNonorientableClosedCensus_3__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_28ObsNonorientableClosedCensus_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_28ObsNonorientableClosedCensus_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 506, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 506, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsNonorientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_28ObsNonorientableClosedCensus_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_28ObsNonorientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_result = 0;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_num_tet = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  char *__pyx_t_11;
  int __pyx_t_12;
  Orientability __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":509
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":510
 *         cdef Manifold result
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         _, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = __pyx_v_n;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(3, 510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":509
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
*/
  }

  /* "cython/core/tail.pyx":511
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()             # <<<<<<<<<<<<<<
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 511, __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 != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(3, 511, __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_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 511, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 511, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 511, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 3);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 511, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 4);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 511, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_6,&__pyx_t_5,&__pyx_t_8};
      for (i=0; i < 5; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(3, 511, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_6,&__pyx_t_5,&__pyx_t_8};
    __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(3, 511, __pyx_L1_error)
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(3, 511, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v__ = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_num_tet = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_index = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_m = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_l = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":513
 *         _, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))             # <<<<<<<<<<<<<<
 *         if c_triangulation == NULL:
 *             print(num_tet, index)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(3, 513, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_num_tet); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_orientability); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_13 = ((Orientability)__Pyx_PyLong_As_Orientability(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":512
 *             return self.__class__(n.indices(self.length))
 *         _, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(             # <<<<<<<<<<<<<<
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:
*/
  __pyx_v_c_triangulation = GetCuspedCensusManifold(__pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":514
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
*/
  __pyx_t_1 = (__pyx_v_c_triangulation == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/tail.pyx":515
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:
 *             print(num_tet, index)             # <<<<<<<<<<<<<<
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Triangulation(spec='empty')
*/
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_builtin_print);
    __pyx_t_5 = __pyx_builtin_print; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_num_tet, __pyx_v_index};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":516
 *         if c_triangulation == NULL:
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')             # <<<<<<<<<<<<<<
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_8 = __pyx_builtin_RuntimeError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_SnapPea_failed_to_read_the_censu};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 516, __pyx_L1_error)

    /* "cython/core/tail.pyx":514
 *         c_triangulation = GetCuspedCensusManifold(
 *             self.path, int(num_tet), self.orientability, int(index))
 *         if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
*/
  }

  /* "cython/core/tail.pyx":517
 *             print(num_tet, index)
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Triangulation(spec='empty')             # <<<<<<<<<<<<<<
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill((int(m), int(l)))
*/
  __pyx_t_8 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
  __pyx_t_5 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_spec, __pyx_mstate_global->__pyx_n_u_empty, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(3, 517, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 517, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  if (!(likely(((((PyObject *)__pyx_t_2)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold))))) __PYX_ERR(3, 517, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":518
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         result.dehn_fill((int(m), int(l)))
 *         return result.with_hyperbolic_structure()
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":519
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill((int(m), int(l)))             # <<<<<<<<<<<<<<
 *         return result.with_hyperbolic_structure()
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_result);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6) != (0)) __PYX_ERR(3, 519, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8) != (0)) __PYX_ERR(3, 519, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":520
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill((int(m), int(l)))
 *         return result.with_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)__pyx_v_result);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_hyperbolic_structure, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":506
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPyHP.ObsNonorientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_num_tet);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":533
 *     alternation = 'a'
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13KnotExteriors_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_13KnotExteriors_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13KnotExteriors_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13KnotExteriors_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 533, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 533, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 533, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 533, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 533, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 533, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 533, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 533, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.KnotExteriors.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13KnotExteriors___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_13KnotExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":534
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":533
 *     alternation = 'a'
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/

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

/* "cython/core/tail.pyx":536
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_13KnotExteriors_3__getitem__(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_8SnapPyHP_13KnotExteriors_3__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13KnotExteriors_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_13KnotExteriors_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 536, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 536, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 536, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 536, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 536, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 536, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 536, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 536, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.KnotExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_13KnotExteriors_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_13KnotExteriors_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":537
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":538
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         else:
 *             return get_HT_knot_by_index(self.alternation, n, _manifold_class)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = __pyx_v_n;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(3, 538, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 538, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":537
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
*/
  }

  /* "cython/core/tail.pyx":540
 *             return self.__class__(n.indices(self.length))
 *         else:
 *             return get_HT_knot_by_index(self.alternation, n, _manifold_class)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_HT_knot_by_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_alternation); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_manifold_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_6, __pyx_v_n, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/tail.pyx":536
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPyHP.KnotExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":558
 *     alternation = 'n'
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_27NonalternatingKnotExteriors_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_27NonalternatingKnotExteriors_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_27NonalternatingKnotExteriors_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_27NonalternatingKnotExteriors_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 558, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 558, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 558, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 558, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 558, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 558, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 558, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 558, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.NonalternatingKnotExteriors.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_27NonalternatingKnotExteriors___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_27NonalternatingKnotExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":559
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":558
 *     alternation = 'n'
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/

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

/* "cython/core/tail.pyx":571
 *     length = sum(census_knot_numbers)
 * 
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14ObsCensusKnots_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_14ObsCensusKnots_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14ObsCensusKnots_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14ObsCensusKnots_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 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("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_indices,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 571, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 571, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(3, 571, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 571, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 571, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsCensusKnots.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14ObsCensusKnots___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_14ObsCensusKnots___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":572
 * 
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":573
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):
 *         Census.__init__(self, indices)
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tarfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_census_knot_archive); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_kp_u_r_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Census_Knots, __pyx_t_1) < 0) __PYX_ERR(3, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":571
 *     length = sum(census_knot_numbers)
 * 
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
*/

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

/* "cython/core/tail.pyx":575
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'Knots in S^3 which appear in the SnapPea Census'
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14ObsCensusKnots_3__repr__(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_8SnapPyHP_14ObsCensusKnots_3__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14ObsCensusKnots_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14ObsCensusKnots_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 575, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(3, 575, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(3, 575, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 575, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 575, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsCensusKnots.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14ObsCensusKnots_2__repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_14ObsCensusKnots_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/tail.pyx":576
 * 
 *     def __repr__(self):
 *         return 'Knots in S^3 which appear in the SnapPea Census'             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Knots_in_S_3_which_appear_in_the);
  __pyx_r = __pyx_mstate_global->__pyx_kp_u_Knots_in_S_3_which_appear_in_the;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":575
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'Knots in S^3 which appear in the SnapPea Census'
 * 
*/

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

/* "cython/core/tail.pyx":578
 *         return 'Knots in S^3 which appear in the SnapPea Census'
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14ObsCensusKnots_5__getitem__(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_8SnapPyHP_14ObsCensusKnots_5__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14ObsCensusKnots_5__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14ObsCensusKnots_5__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 578, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 578, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 578, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 578, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 578, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 578, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 578, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 578, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsCensusKnots.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14ObsCensusKnots_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_14ObsCensusKnots_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_v_total = NULL;
  long __pyx_v_m;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_tarpath = NULL;
  PyObject *__pyx_v_filedata = NULL;
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  long __pyx_t_8;
  PyObject *__pyx_t_9[4];
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  char *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":579
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":580
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         else:
 *             total = 0
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = __pyx_v_n;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(3, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":579
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
*/
  }

  /* "cython/core/tail.pyx":582
 *             return self.__class__(n.indices(self.length))
 *         else:
 *             total = 0             # <<<<<<<<<<<<<<
 *             for m in range(2, 8):
 *                 if total + census_knot_numbers[m] <= n:
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_v_total = __pyx_mstate_global->__pyx_int_0;

    /* "cython/core/tail.pyx":583
 *         else:
 *             total = 0
 *             for m in range(2, 8):             # <<<<<<<<<<<<<<
 *                 if total + census_knot_numbers[m] <= n:
 *                     total += census_knot_numbers[m]
*/
    for (__pyx_t_8 = 2; __pyx_t_8 < 8; __pyx_t_8+=1) {
      __pyx_v_m = __pyx_t_8;

      /* "cython/core/tail.pyx":584
 *             total = 0
 *             for m in range(2, 8):
 *                 if total + census_knot_numbers[m] <= n:             # <<<<<<<<<<<<<<
 *                     total += census_knot_numbers[m]
 *                     continue
*/
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_census_knot_numbers); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_m, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_v_total, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_n, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 584, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 584, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "cython/core/tail.pyx":585
 *             for m in range(2, 8):
 *                 if total + census_knot_numbers[m] <= n:
 *                     total += census_knot_numbers[m]             # <<<<<<<<<<<<<<
 *                     continue
 *                 else:
*/
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_census_knot_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_m, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_total, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_total, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cython/core/tail.pyx":586
 *                 if total + census_knot_numbers[m] <= n:
 *                     total += census_knot_numbers[m]
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     name = 'K%s_%s' % (m, n - total + 1)
*/
        goto __pyx_L4_continue;

        /* "cython/core/tail.pyx":584
 *             total = 0
 *             for m in range(2, 8):
 *                 if total + census_knot_numbers[m] <= n:             # <<<<<<<<<<<<<<
 *                     total += census_knot_numbers[m]
 *                     continue
*/
      }

      /* "cython/core/tail.pyx":588
 *                     continue
 *                 else:
 *                     name = 'K%s_%s' % (m, n - total + 1)             # <<<<<<<<<<<<<<
 *                     break
 *             if name:
*/
      /*else*/ {
        __pyx_t_4 = __Pyx_PyUnicode_From_long(__pyx_v_m, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyNumber_Subtract(__pyx_v_n, __pyx_v_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9[0] = __pyx_mstate_global->__pyx_n_u_K;
        __pyx_t_9[1] = __pyx_t_4;
        __pyx_t_9[2] = __pyx_mstate_global->__pyx_n_u__21;
        __pyx_t_9[3] = __pyx_t_2;
        __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_name = ((PyObject*)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "cython/core/tail.pyx":589
 *                 else:
 *                     name = 'K%s_%s' % (m, n - total + 1)
 *                     break             # <<<<<<<<<<<<<<
 *             if name:
 *                 tarpath = 'CensusKnots/%s' % name
*/
        goto __pyx_L5_break;
      }
      __pyx_L4_continue:;
    }
    __pyx_L5_break:;

    /* "cython/core/tail.pyx":590
 *                     name = 'K%s_%s' % (m, n - total + 1)
 *                     break
 *             if name:             # <<<<<<<<<<<<<<
 *                 tarpath = 'CensusKnots/%s' % name
 *                 try:
*/
    if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(3, 590, __pyx_L1_error) }
    __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_name) != 0);
    if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(3, 590, __pyx_L1_error)
    if (likely(__pyx_t_1)) {

      /* "cython/core/tail.pyx":591
 *                     break
 *             if name:
 *                 tarpath = 'CensusKnots/%s' % name             # <<<<<<<<<<<<<<
 *                 try:
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()
*/
      if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(3, 591, __pyx_L1_error) }
      __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_CensusKnots_s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_tarpath = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":592
 *             if name:
 *                 tarpath = 'CensusKnots/%s' % name
 *                 try:             # <<<<<<<<<<<<<<
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "cython/core/tail.pyx":593
 *                 tarpath = 'CensusKnots/%s' % name
 *                 try:
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()             # <<<<<<<<<<<<<<
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:
*/
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Census_Knots); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 593, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = __pyx_t_5;
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_tarpath};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extractfile, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 593, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_2 = __pyx_t_4;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
            __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 593, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __pyx_v_filedata = __pyx_t_3;
          __pyx_t_3 = 0;

          /* "cython/core/tail.pyx":594
 *                 try:
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)             # <<<<<<<<<<<<<<
 *                 except:
 *                     raise IOError("The census knot %s was not found." % name)
*/
          __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_filedata); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(3, 594, __pyx_L8_error)
          __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_13);

          /* "cython/core/tail.pyx":592
 *             if name:
 *                 tarpath = 'CensusKnots/%s' % name
 *                 try:             # <<<<<<<<<<<<<<
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
*/
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L13_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/tail.pyx":595
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:             # <<<<<<<<<<<<<<
 *                     raise IOError("The census knot %s was not found." % name)
 *                 result = Triangulation('empty')
*/
        /*except:*/ {
          __Pyx_AddTraceback("SnapPyHP.ObsCensusKnots.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(3, 595, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_2);

          /* "cython/core/tail.pyx":596
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:
 *                     raise IOError("The census knot %s was not found." % name)             # <<<<<<<<<<<<<<
 *                 result = Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)
*/
          __pyx_t_6 = NULL;
          __Pyx_INCREF(__pyx_builtin_IOError);
          __pyx_t_14 = __pyx_builtin_IOError; 
          if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(3, 596, __pyx_L10_except_error) }
          __pyx_t_15 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_The_census_knot_s_was_not_found, __pyx_v_name); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 596, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_7 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_15};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 596, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_Raise(__pyx_t_5, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __PYX_ERR(3, 596, __pyx_L10_except_error)
        }

        /* "cython/core/tail.pyx":592
 *             if name:
 *                 tarpath = 'CensusKnots/%s' % name
 *                 try:             # <<<<<<<<<<<<<<
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
*/
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L13_try_end:;
      }

      /* "cython/core/tail.pyx":597
 *                 except:
 *                     raise IOError("The census knot %s was not found." % name)
 *                 result = Triangulation('empty')             # <<<<<<<<<<<<<<
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
      __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation); 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 597, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_2);
      }
      __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/tail.pyx":598
 *                     raise IOError("The census knot %s was not found." % name)
 *                 result = Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *                 result.set_name(name)
 *                 return result.with_hyperbolic_structure()
*/
      __pyx_t_2 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_result->__pyx_vtab)->set_c_triangulation(__pyx_v_result, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/tail.pyx":599
 *                 result = Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)             # <<<<<<<<<<<<<<
 *                 return result.with_hyperbolic_structure()
 *             else:
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_result);
      __Pyx_INCREF(__pyx_t_3);
      if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(3, 599, __pyx_L1_error) }
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_name};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/tail.pyx":600
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)
 *                 return result.with_hyperbolic_structure()             # <<<<<<<<<<<<<<
 *             else:
 *                 raise IndexError('There are only 201 census knots.')
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)__pyx_v_result);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_hyperbolic_structure, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "cython/core/tail.pyx":590
 *                     name = 'K%s_%s' % (m, n - total + 1)
 *                     break
 *             if name:             # <<<<<<<<<<<<<<
 *                 tarpath = 'CensusKnots/%s' % name
 *                 try:
*/
    }

    /* "cython/core/tail.pyx":602
 *                 return result.with_hyperbolic_structure()
 *             else:
 *                 raise IndexError('There are only 201 census knots.')             # <<<<<<<<<<<<<<
 * 
 * 
*/
    /*else*/ {
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_IndexError);
      __pyx_t_4 = __pyx_builtin_IndexError; 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_There_are_only_201_census_knots};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 602, __pyx_L1_error)
    }
  }

  /* "cython/core/tail.pyx":578
 *         return 'Knots in S^3 which appear in the SnapPea Census'
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPyHP.ObsCensusKnots.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_total);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_tarpath);
  __Pyx_XDECREF(__pyx_v_filedata);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":619
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0, 10000, 1)):             # <<<<<<<<<<<<<<
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16ObsLinkExteriors_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_16ObsLinkExteriors_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16ObsLinkExteriors_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16ObsLinkExteriors_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_components = 0;
  PyObject *__pyx_v_indices = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_components,&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 619, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 619, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[29])));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(3, 619, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 619, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 619, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_tuple[29])));
    }
    __pyx_v_self = values[0];
    __pyx_v_components = values[1];
    __pyx_v_indices = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(3, 619, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsLinkExteriors.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16ObsLinkExteriors___init__(__pyx_self, __pyx_v_self, __pyx_v_components, __pyx_v_indices);

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

static PyObject *__pyx_pf_8SnapPyHP_16ObsLinkExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_components, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":620
 * 
 *     def __init__(self, components, indices=(0, 10000, 1)):
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')             # <<<<<<<<<<<<<<
 * 
 *         if not (1 <= components < len(self.num_links)):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tarfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_link_archive); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_kp_u_r_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Christy_links, __pyx_t_1) < 0) __PYX_ERR(3, 620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":622
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
 *         if not (1 <= components < len(self.num_links)):             # <<<<<<<<<<<<<<
 *             raise IndexError('SnapPy has no data on links with '
 *                              '%s components.' % components)
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_1, __pyx_v_components, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 622, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_num_links); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 622, __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(3, 622, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_components, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 622, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (!__pyx_t_7);
  if (unlikely(__pyx_t_8)) {

    /* "cython/core/tail.pyx":623
 * 
 *         if not (1 <= components < len(self.num_links)):
 *             raise IndexError('SnapPy has no data on links with '             # <<<<<<<<<<<<<<
 *                              '%s components.' % components)
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_IndexError);
    __pyx_t_3 = __pyx_builtin_IndexError; 

    /* "cython/core/tail.pyx":624
 *         if not (1 <= components < len(self.num_links)):
 *             raise IndexError('SnapPy has no data on links with '
 *                              '%s components.' % components)             # <<<<<<<<<<<<<<
 * 
 *         self.components = components
*/
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_SnapPy_has_no_data_on_links_with, __pyx_v_components); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(3, 623, __pyx_L1_error)

    /* "cython/core/tail.pyx":622
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
 *         if not (1 <= components < len(self.num_links)):             # <<<<<<<<<<<<<<
 *             raise IndexError('SnapPy has no data on links with '
 *                              '%s components.' % components)
*/
  }

  /* "cython/core/tail.pyx":626
 *                              '%s components.' % components)
 * 
 *         self.components = components             # <<<<<<<<<<<<<<
 * 
 *         self.length = sum(self.num_links[components])
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_components, __pyx_v_components) < 0) __PYX_ERR(3, 626, __pyx_L1_error)

  /* "cython/core/tail.pyx":628
 *         self.components = components
 * 
 *         self.length = sum(self.num_links[components])             # <<<<<<<<<<<<<<
 * 
 *         Census.__init__(self, (indices[0],
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_2 = __pyx_builtin_sum; 
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_num_links); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_components); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_1) < 0) __PYX_ERR(3, 628, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":630
 *         self.length = sum(self.num_links[components])
 * 
 *         Census.__init__(self, (indices[0],             # <<<<<<<<<<<<<<
 *                                min(self.length, indices[1]),
 *                                indices[2]))
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_indices, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "cython/core/tail.pyx":631
 * 
 *         Census.__init__(self, (indices[0],
 *                                min(self.length, indices[1]),             # <<<<<<<<<<<<<<
 *                                indices[2]))
 * 
*/
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_indices, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 631, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__pyx_t_8) {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_11 = __pyx_t_4;
  } else {
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_11 = __pyx_t_10;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":632
 *         Census.__init__(self, (indices[0],
 *                                min(self.length, indices[1]),
 *                                indices[2]))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_indices, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/tail.pyx":630
 *         self.length = sum(self.num_links[components])
 * 
 *         Census.__init__(self, (indices[0],             # <<<<<<<<<<<<<<
 *                                min(self.length, indices[1]),
 *                                indices[2]))
*/
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9) != (0)) __PYX_ERR(3, 630, __pyx_L1_error);
  __Pyx_INCREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(3, 630, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4) != (0)) __PYX_ERR(3, 630, __pyx_L1_error);
  __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_t_10};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":619
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0, 10000, 1)):             # <<<<<<<<<<<<<<
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPyHP.ObsLinkExteriors.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":634
 *                                indices[2]))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('Christy census of %s-component link complements '
 *                 'in S^3' % self.components)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16ObsLinkExteriors_3__repr__(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_8SnapPyHP_16ObsLinkExteriors_3__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16ObsLinkExteriors_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16ObsLinkExteriors_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 634, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(3, 634, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(3, 634, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 634, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 634, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsLinkExteriors.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16ObsLinkExteriors_2__repr__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8SnapPyHP_16ObsLinkExteriors_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/tail.pyx":635
 * 
 *     def __repr__(self):
 *         return ('Christy census of %s-component link complements '             # <<<<<<<<<<<<<<
 *                 'in S^3' % self.components)
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/tail.pyx":636
 *     def __repr__(self):
 *         return ('Christy census of %s-component link complements '
 *                 'in S^3' % self.components)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, j):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Christy_census_of_s_component_li, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 636, __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;

  /* "cython/core/tail.pyx":634
 *                                indices[2]))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('Christy census of %s-component link complements '
 *                 'in S^3' % self.components)
*/

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

/* "cython/core/tail.pyx":638
 *                 'in S^3' % self.components)
 * 
 *     def __getitem__(self, j):             # <<<<<<<<<<<<<<
 *         if isinstance(j, slice):
 *             return self.__class__(j.indices(self.length))
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_16ObsLinkExteriors_5__getitem__(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_8SnapPyHP_16ObsLinkExteriors_5__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16ObsLinkExteriors_5__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_16ObsLinkExteriors_5__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_j = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_j,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 638, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 638, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 638, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 638, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 638, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 638, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 638, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_j = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 638, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsLinkExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_16ObsLinkExteriors_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_j);

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

static PyObject *__pyx_pf_8SnapPyHP_16ObsLinkExteriors_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_j) {
  PyObject *__pyx_v_so_far = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_filename = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_tarpath = NULL;
  PyObject *__pyx_v_filedata = NULL;
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_8SnapPyHP_Triangulation *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10[5];
  PyObject *__pyx_t_11[3];
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  char *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":639
 * 
 *     def __getitem__(self, j):
 *         if isinstance(j, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(j.indices(self.length))
 *         so_far = 0
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_j); 
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":640
 *     def __getitem__(self, j):
 *         if isinstance(j, slice):
 *             return self.__class__(j.indices(self.length))             # <<<<<<<<<<<<<<
 *         so_far = 0
 *         for k in range(self.max_crossings + 1):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = __pyx_v_j;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(3, 640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":639
 * 
 *     def __getitem__(self, j):
 *         if isinstance(j, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(j.indices(self.length))
 *         so_far = 0
*/
  }

  /* "cython/core/tail.pyx":641
 *         if isinstance(j, slice):
 *             return self.__class__(j.indices(self.length))
 *         so_far = 0             # <<<<<<<<<<<<<<
 *         for k in range(self.max_crossings + 1):
 *             n = self.num_links[self.components][k]
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_so_far = __pyx_mstate_global->__pyx_int_0;

  /* "cython/core/tail.pyx":642
 *             return self.__class__(j.indices(self.length))
 *         so_far = 0
 *         for k in range(self.max_crossings + 1):             # <<<<<<<<<<<<<<
 *             n = self.num_links[self.components][k]
 *             so_far = so_far + n
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_3 = __pyx_builtin_range; 
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_max_crossings); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 642, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 642, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_8);
        ++__pyx_t_8;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 642, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8);
        #endif
        ++__pyx_t_8;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 642, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 642, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":643
 *         so_far = 0
 *         for k in range(self.max_crossings + 1):
 *             n = self.num_links[self.components][k]             # <<<<<<<<<<<<<<
 *             so_far = so_far + n
 *             if so_far > j:
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_num_links); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":644
 *         for k in range(self.max_crossings + 1):
 *             n = self.num_links[self.components][k]
 *             so_far = so_far + n             # <<<<<<<<<<<<<<
 *             if so_far > j:
 *                 l = j - so_far + n + 1
*/
    __pyx_t_5 = PyNumber_Add(__pyx_v_so_far, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_so_far, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":645
 *             n = self.num_links[self.components][k]
 *             so_far = so_far + n
 *             if so_far > j:             # <<<<<<<<<<<<<<
 *                 l = j - so_far + n + 1
 *                 filename = 'L%d%.2d%.3d' % (self.components, k, l)
*/
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_so_far, __pyx_v_j, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 645, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 645, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "cython/core/tail.pyx":646
 *             so_far = so_far + n
 *             if so_far > j:
 *                 l = j - so_far + n + 1             # <<<<<<<<<<<<<<
 *                 filename = 'L%d%.2d%.3d' % (self.components, k, l)
 *                 if self.components > 1:
*/
      __pyx_t_5 = PyNumber_Subtract(__pyx_v_j, __pyx_v_so_far); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_l = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":647
 *             if so_far > j:
 *                 l = j - so_far + n + 1
 *                 filename = 'L%d%.2d%.3d' % (self.components, k, l)             # <<<<<<<<<<<<<<
 *                 if self.components > 1:
 *                     name = "%d^%d_%d" % (k, self.components, l)
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(3, 647, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_k) != (0)) __PYX_ERR(3, 647, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_l);
      __Pyx_GIVEREF(__pyx_v_l);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_l) != (0)) __PYX_ERR(3, 647, __pyx_L1_error);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_L_d_2d_3d, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_filename = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":648
 *                 l = j - so_far + n + 1
 *                 filename = 'L%d%.2d%.3d' % (self.components, k, l)
 *                 if self.components > 1:             # <<<<<<<<<<<<<<
 *                     name = "%d^%d_%d" % (k, self.components, l)
 *                 else:
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 648, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 648, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "cython/core/tail.pyx":649
 *                 filename = 'L%d%.2d%.3d' % (self.components, k, l)
 *                 if self.components > 1:
 *                     name = "%d^%d_%d" % (k, self.components, l)             # <<<<<<<<<<<<<<
 *                 else:
 *                     name = "%d_%d" % (k, l)
*/
        __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_k), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_l), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10[0] = __pyx_t_4;
        __pyx_t_10[1] = __pyx_mstate_global->__pyx_kp_u__20;
        __pyx_t_10[2] = __pyx_t_2;
        __pyx_t_10[3] = __pyx_mstate_global->__pyx_n_u__21;
        __pyx_t_10[4] = __pyx_t_5;
        __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 649, __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_5); __pyx_t_5 = 0;
        __pyx_v_name = ((PyObject*)__pyx_t_6);
        __pyx_t_6 = 0;

        /* "cython/core/tail.pyx":648
 *                 l = j - so_far + n + 1
 *                 filename = 'L%d%.2d%.3d' % (self.components, k, l)
 *                 if self.components > 1:             # <<<<<<<<<<<<<<
 *                     name = "%d^%d_%d" % (k, self.components, l)
 *                 else:
*/
        goto __pyx_L7;
      }

      /* "cython/core/tail.pyx":651
 *                     name = "%d^%d_%d" % (k, self.components, l)
 *                 else:
 *                     name = "%d_%d" % (k, l)             # <<<<<<<<<<<<<<
 *                 tarpath = 'ChristyLinks/%s' % filename
 *                 try:
*/
      /*else*/ {
        __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_k), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 651, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_l), __pyx_mstate_global->__pyx_n_u_d_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 651, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11[0] = __pyx_t_6;
        __pyx_t_11[1] = __pyx_mstate_global->__pyx_n_u__21;
        __pyx_t_11[2] = __pyx_t_5;
        __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_11, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 651, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_name = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L7:;

      /* "cython/core/tail.pyx":652
 *                 else:
 *                     name = "%d_%d" % (k, l)
 *                 tarpath = 'ChristyLinks/%s' % filename             # <<<<<<<<<<<<<<
 *                 try:
 *                     filedata = self.Christy_links.extractfile(tarpath).read()
*/
      __pyx_t_2 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_ChristyLinks_s, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_tarpath = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/tail.pyx":653
 *                     name = "%d_%d" % (k, l)
 *                 tarpath = 'ChristyLinks/%s' % filename
 *                 try:             # <<<<<<<<<<<<<<
 *                     filedata = self.Christy_links.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {

          /* "cython/core/tail.pyx":654
 *                 tarpath = 'ChristyLinks/%s' % filename
 *                 try:
 *                     filedata = self.Christy_links.extractfile(tarpath).read()             # <<<<<<<<<<<<<<
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:
*/
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Christy_links); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 654, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_4 = __pyx_t_15;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_tarpath};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extractfile, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 654, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __pyx_t_5 = __pyx_t_6;
          __Pyx_INCREF(__pyx_t_5);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 654, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_v_filedata = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "cython/core/tail.pyx":655
 *                 try:
 *                     filedata = self.Christy_links.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)             # <<<<<<<<<<<<<<
 *                 except:
 *                     raise IOError('The link complement %s was not '
*/
          __pyx_t_16 = __Pyx_PyObject_AsWritableString(__pyx_v_filedata); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(3, 655, __pyx_L8_error)
          __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_16);

          /* "cython/core/tail.pyx":653
 *                     name = "%d_%d" % (k, l)
 *                 tarpath = 'ChristyLinks/%s' % filename
 *                 try:             # <<<<<<<<<<<<<<
 *                     filedata = self.Christy_links.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
*/
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/tail.pyx":656
 *                     filedata = self.Christy_links.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:             # <<<<<<<<<<<<<<
 *                     raise IOError('The link complement %s was not '
 *                                   'found.' % filename)
*/
        /*except:*/ {
          __Pyx_AddTraceback("SnapPyHP.ObsLinkExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(3, 656, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_5);

          /* "cython/core/tail.pyx":657
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:
 *                     raise IOError('The link complement %s was not '             # <<<<<<<<<<<<<<
 *                                   'found.' % filename)
 *                 result = Triangulation('empty')
*/
          __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_builtin_IOError);
          __pyx_t_17 = __pyx_builtin_IOError; 

          /* "cython/core/tail.pyx":658
 *                 except:
 *                     raise IOError('The link complement %s was not '
 *                                   'found.' % filename)             # <<<<<<<<<<<<<<
 *                 result = Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)
*/
          __pyx_t_18 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_The_link_complement_s_was_not_fo, __pyx_v_filename); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 658, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_7 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_18};
            __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 657, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_15);
          }
          __Pyx_Raise(__pyx_t_15, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __PYX_ERR(3, 657, __pyx_L10_except_error)
        }

        /* "cython/core/tail.pyx":653
 *                     name = "%d_%d" % (k, l)
 *                 tarpath = 'ChristyLinks/%s' % filename
 *                 try:             # <<<<<<<<<<<<<<
 *                     filedata = self.Christy_links.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
*/
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L15_try_end:;
      }

      /* "cython/core/tail.pyx":659
 *                     raise IOError('The link complement %s was not '
 *                                   'found.' % filename)
 *                 result = Triangulation('empty')             # <<<<<<<<<<<<<<
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)
*/
      __pyx_t_6 = NULL;
      __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation);
      __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation); 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 659, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_5);
      }
      __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Triangulation *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":660
 *                                   'found.' % filename)
 *                 result = Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *                 result.set_name(name)
 *                 return result.with_hyperbolic_structure()
*/
      __pyx_t_5 = ((struct __pyx_vtabstruct_8SnapPyHP_Triangulation *)__pyx_v_result->__pyx_vtab)->set_c_triangulation(__pyx_v_result, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 660, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":661
 *                 result = Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)             # <<<<<<<<<<<<<<
 *                 return result.with_hyperbolic_structure()
 * 
*/
      __pyx_t_2 = ((PyObject *)__pyx_v_result);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":662
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)
 *                 return result.with_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((PyObject *)__pyx_v_result);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_hyperbolic_structure, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cython/core/tail.pyx":645
 *             n = self.num_links[self.components][k]
 *             so_far = so_far + n
 *             if so_far > j:             # <<<<<<<<<<<<<<
 *                 l = j - so_far + n + 1
 *                 filename = 'L%d%.2d%.3d' % (self.components, k, l)
*/
    }

    /* "cython/core/tail.pyx":642
 *             return self.__class__(j.indices(self.length))
 *         so_far = 0
 *         for k in range(self.max_crossings + 1):             # <<<<<<<<<<<<<<
 *             n = self.num_links[self.components][k]
 *             so_far = so_far + n
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":638
 *                 'in S^3' % self.components)
 * 
 *     def __getitem__(self, j):             # <<<<<<<<<<<<<<
 *         if isinstance(j, slice):
 *             return self.__class__(j.indices(self.length))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("SnapPyHP.ObsLinkExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_so_far);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_tarpath);
  __Pyx_XDECREF(__pyx_v_filedata);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":672
 * 
 * class MorwenLinks:
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'The MorwenLinks class has been replaced by HTLinkExteriors. '
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_11MorwenLinks_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_11MorwenLinks_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_11MorwenLinks_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_11MorwenLinks_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_num_components = 0;
  CYTHON_UNUSED PyObject *__pyx_v_num_crossings = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_num_components,&__pyx_mstate_global->__pyx_n_u_num_crossings,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 672, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 672, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(3, 672, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 672, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 672, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_self = values[0];
    __pyx_v_num_components = values[1];
    __pyx_v_num_crossings = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(3, 672, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.MorwenLinks.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_11MorwenLinks___init__(__pyx_self, __pyx_v_self, __pyx_v_num_components, __pyx_v_num_crossings);

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

static PyObject *__pyx_pf_8SnapPyHP_11MorwenLinks___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_num_components, CYTHON_UNUSED PyObject *__pyx_v_num_crossings) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":673
 * class MorwenLinks:
 *     def __init__(self, num_components, num_crossings = None):
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             'The MorwenLinks class has been replaced by HTLinkExteriors. '
 *             'Please refer to the documentation for HTLinkExteriors.'
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __pyx_t_3 = __pyx_builtin_ValueError; 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_MorwenLinks_class_has_been_r};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(3, 673, __pyx_L1_error)

  /* "cython/core/tail.pyx":672
 * 
 * class MorwenLinks:
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'The MorwenLinks class has been replaced by HTLinkExteriors. '
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPyHP.MorwenLinks.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":679
 * 
 * 
 * def left_pad_string(str,  length, pad=' '):             # <<<<<<<<<<<<<<
 *     return pad*(length - len(str)) + str
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_59left_pad_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_59left_pad_string = {"left_pad_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_59left_pad_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_59left_pad_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_str = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_pad = 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("left_pad_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_str,&__pyx_mstate_global->__pyx_n_u_length,&__pyx_mstate_global->__pyx_n_u_pad,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 679, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 679, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 679, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 679, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "left_pad_string", 0) < 0) __PYX_ERR(3, 679, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_kp_u__9)));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("left_pad_string", 0, 2, 3, i); __PYX_ERR(3, 679, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 679, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 679, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 679, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_kp_u__9)));
    }
    __pyx_v_str = values[0];
    __pyx_v_length = values[1];
    __pyx_v_pad = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("left_pad_string", 0, 2, 3, __pyx_nargs); __PYX_ERR(3, 679, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.left_pad_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_58left_pad_string(__pyx_self, __pyx_v_str, __pyx_v_length, __pyx_v_pad);

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

static PyObject *__pyx_pf_8SnapPyHP_58left_pad_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_str, PyObject *__pyx_v_length, PyObject *__pyx_v_pad) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __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("left_pad_string", 0);

  /* "cython/core/tail.pyx":680
 * 
 * def left_pad_string(str,  length, pad=' '):
 *     return pad*(length - len(str)) + str             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Length(__pyx_v_str); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 680, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_length, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_pad, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 680, __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;

  /* "cython/core/tail.pyx":679
 * 
 * 
 * def left_pad_string(str,  length, pad=' '):             # <<<<<<<<<<<<<<
 *     return pad*(length - len(str)) + str
 * 
*/

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

/* "cython/core/tail.pyx":687
 *     Obsolete.
 *     """
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         if num_components < 0:
 *             return
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14ObsMorwenLinks_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8SnapPyHP_14ObsMorwenLinks_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14ObsMorwenLinks_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14ObsMorwenLinks_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_num_components = 0;
  PyObject *__pyx_v_num_crossings = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_num_components,&__pyx_mstate_global->__pyx_n_u_num_crossings,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 687, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(3, 687, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(3, 687, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 687, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 687, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_self = values[0];
    __pyx_v_num_components = values[1];
    __pyx_v_num_crossings = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(3, 687, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsMorwenLinks.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14ObsMorwenLinks___init__(__pyx_self, __pyx_v_self, __pyx_v_num_components, __pyx_v_num_crossings);

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

static PyObject *__pyx_pf_8SnapPyHP_14ObsMorwenLinks___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_num_components, PyObject *__pyx_v_num_crossings) {
  PyObject *__pyx_v_crossings = NULL;
  PyObject *__pyx_v_files = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_second_char = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_strline = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":688
 *     """
 *     def __init__(self, num_components, num_crossings = None):
 *         if num_components < 0:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_components, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 688, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(3, 688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":689
 *     def __init__(self, num_components, num_crossings = None):
 *         if num_components < 0:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         crossings = range(4, 15) if num_crossings is None else [num_crossings]
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/tail.pyx":688
 *     """
 *     def __init__(self, num_components, num_crossings = None):
 *         if num_components < 0:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "cython/core/tail.pyx":691
 *             return
 * 
 *         crossings = range(4, 15) if num_crossings is None else [num_crossings]             # <<<<<<<<<<<<<<
 *         files = []
 *         for c in crossings:
*/
  __pyx_t_2 = (__pyx_v_num_crossings == Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_mstate_global->__pyx_tuple[30], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_num_crossings);
    __Pyx_GIVEREF(__pyx_v_num_crossings);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_num_crossings) != (0)) __PYX_ERR(3, 691, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_crossings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":692
 * 
 *         crossings = range(4, 15) if num_crossings is None else [num_crossings]
 *         files = []             # <<<<<<<<<<<<<<
 *         for c in crossings:
 *             n = left_pad_string('%d' % c, 2, '0')
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_files = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":693
 *         crossings = range(4, 15) if num_crossings is None else [num_crossings]
 *         files = []
 *         for c in crossings:             # <<<<<<<<<<<<<<
 *             n = left_pad_string('%d' % c, 2, '0')
 *             files.append('hyperbolic_data_%sa.gz' % n)
*/
  if (likely(PyList_CheckExact(__pyx_v_crossings)) || PyTuple_CheckExact(__pyx_v_crossings)) {
    __pyx_t_1 = __pyx_v_crossings; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_crossings); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 693, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 693, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 693, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 693, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 693, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":694
 *         files = []
 *         for c in crossings:
 *             n = left_pad_string('%d' % c, 2, '0')             # <<<<<<<<<<<<<<
 *             files.append('hyperbolic_data_%sa.gz' % n)
 *             if c > 5:
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_left_pad_string); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_d, __pyx_v_c); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_8, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_kp_u_0};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":695
 *         for c in crossings:
 *             n = left_pad_string('%d' % c, 2, '0')
 *             files.append('hyperbolic_data_%sa.gz' % n)             # <<<<<<<<<<<<<<
 *             if c > 5:
 *                 files.append('hyperbolic_data_%sn.gz' % n)
*/
    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_hyperbolic_data__sa_gz, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_files, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 695, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":696
 *             n = left_pad_string('%d' % c, 2, '0')
 *             files.append('hyperbolic_data_%sa.gz' % n)
 *             if c > 5:             # <<<<<<<<<<<<<<
 *                 files.append('hyperbolic_data_%sn.gz' % n)
 * 
*/
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_c, __pyx_mstate_global->__pyx_int_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 696, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(3, 696, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "cython/core/tail.pyx":697
 *             files.append('hyperbolic_data_%sa.gz' % n)
 *             if c > 5:
 *                 files.append('hyperbolic_data_%sn.gz' % n)             # <<<<<<<<<<<<<<
 * 
 *         self.files = files
*/
      __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_hyperbolic_data__sn_gz, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_files, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 697, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":696
 *             n = left_pad_string('%d' % c, 2, '0')
 *             files.append('hyperbolic_data_%sa.gz' % n)
 *             if c > 5:             # <<<<<<<<<<<<<<
 *                 files.append('hyperbolic_data_%sn.gz' % n)
 * 
*/
    }

    /* "cython/core/tail.pyx":693
 *         crossings = range(4, 15) if num_crossings is None else [num_crossings]
 *         files = []
 *         for c in crossings:             # <<<<<<<<<<<<<<
 *             n = left_pad_string('%d' % c, 2, '0')
 *             files.append('hyperbolic_data_%sa.gz' % n)
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":699
 *                 files.append('hyperbolic_data_%sn.gz' % n)
 * 
 *         self.files = files             # <<<<<<<<<<<<<<
 * 
 *         self.DT_codes = []
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_files, __pyx_v_files) < 0) __PYX_ERR(3, 699, __pyx_L1_error)

  /* "cython/core/tail.pyx":701
 *         self.files = files
 * 
 *         self.DT_codes = []             # <<<<<<<<<<<<<<
 *         second_char = string.ascii_lowercase[num_components-1]
 *         for file in files:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_DT_codes, __pyx_t_1) < 0) __PYX_ERR(3, 701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":702
 * 
 *         self.DT_codes = []
 *         second_char = string.ascii_lowercase[num_components-1]             # <<<<<<<<<<<<<<
 *         for file in files:
 *             data = gzip.open(morwen_link_directory + os.sep + file).readlines()
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ascii_lowercase); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_num_components, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 702, __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_v_second_char = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "cython/core/tail.pyx":703
 *         self.DT_codes = []
 *         second_char = string.ascii_lowercase[num_components-1]
 *         for file in files:             # <<<<<<<<<<<<<<
 *             data = gzip.open(morwen_link_directory + os.sep + file).readlines()
 *             for line in data:
*/
  __pyx_t_7 = __pyx_v_files; __Pyx_INCREF(__pyx_t_7);
  __pyx_t_4 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 703, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_4);
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":704
 *         second_char = string.ascii_lowercase[num_components-1]
 *         for file in files:
 *             data = gzip.open(morwen_link_directory + os.sep + file).readlines()             # <<<<<<<<<<<<<<
 *             for line in data:
 *                 strline = line.decode()
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_gzip); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_morwen_link_directory); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_sep); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_v_file); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_14};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_3 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_readlines, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":705
 *         for file in files:
 *             data = gzip.open(morwen_link_directory + os.sep + file).readlines()
 *             for line in data:             # <<<<<<<<<<<<<<
 *                 strline = line.decode()
 *                 if strline[1] == second_char:
*/
    if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
      __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_15 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_15 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 705, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 705, __pyx_L1_error)
            #endif
            if (__pyx_t_15 >= __pyx_temp) break;
          }
          __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_15);
          ++__pyx_t_15;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 705, __pyx_L1_error)
            #endif
            if (__pyx_t_15 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_15));
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_15);
          #endif
          ++__pyx_t_15;
        }
        if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 705, __pyx_L1_error)
      } else {
        __pyx_t_8 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 705, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/tail.pyx":706
 *             data = gzip.open(morwen_link_directory + os.sep + file).readlines()
 *             for line in data:
 *                 strline = line.decode()             # <<<<<<<<<<<<<<
 *                 if strline[1] == second_char:
 *                     self.DT_codes.append(strline.strip())
*/
      __pyx_t_3 = __pyx_v_line;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 706, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_strline, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/tail.pyx":707
 *             for line in data:
 *                 strline = line.decode()
 *                 if strline[1] == second_char:             # <<<<<<<<<<<<<<
 *                     self.DT_codes.append(strline.strip())
 * 
*/
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_strline, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_second_char, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 707, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(3, 707, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "cython/core/tail.pyx":708
 *                 strline = line.decode()
 *                 if strline[1] == second_char:
 *                     self.DT_codes.append(strline.strip())             # <<<<<<<<<<<<<<
 * 
 *         self.length = len(self.DT_codes)
*/
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_DT_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = __pyx_v_strline;
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 708, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_t_8); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 708, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cython/core/tail.pyx":707
 *             for line in data:
 *                 strline = line.decode()
 *                 if strline[1] == second_char:             # <<<<<<<<<<<<<<
 *                     self.DT_codes.append(strline.strip())
 * 
*/
      }

      /* "cython/core/tail.pyx":705
 *         for file in files:
 *             data = gzip.open(morwen_link_directory + os.sep + file).readlines()
 *             for line in data:             # <<<<<<<<<<<<<<
 *                 strline = line.decode()
 *                 if strline[1] == second_char:
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":703
 *         self.DT_codes = []
 *         second_char = string.ascii_lowercase[num_components-1]
 *         for file in files:             # <<<<<<<<<<<<<<
 *             data = gzip.open(morwen_link_directory + os.sep + file).readlines()
 *             for line in data:
*/
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/tail.pyx":710
 *                     self.DT_codes.append(strline.strip())
 * 
 *         self.length = len(self.DT_codes)             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))
 * 
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_DT_codes); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 710, __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(3, 710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_7) < 0) __PYX_ERR(3, 710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/tail.pyx":711
 * 
 *         self.length = len(self.DT_codes)
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_DT_codes); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(3, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(3, 711, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8) != (0)) __PYX_ERR(3, 711, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(3, 711, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_self};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_indices, __pyx_t_12, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(3, 711, __pyx_L1_error)
    __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/tail.pyx":687
 *     Obsolete.
 *     """
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         if num_components < 0:
 *             return
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPyHP.ObsMorwenLinks.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_crossings);
  __Pyx_XDECREF(__pyx_v_files);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_second_char);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_strline);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":713
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             SC = self.__class__(-1)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_14ObsMorwenLinks_3__getitem__(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_8SnapPyHP_14ObsMorwenLinks_3__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14ObsMorwenLinks_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_14ObsMorwenLinks_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 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("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 713, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 713, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 713, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < 0) __PYX_ERR(3, 713, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(3, 713, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 713, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 713, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 713, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.ObsMorwenLinks.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_14ObsMorwenLinks_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8SnapPyHP_14ObsMorwenLinks_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_v_SC = NULL;
  PyObject *__pyx_v_name = NULL;
  struct __pyx_obj_8SnapPyHP_Manifold *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":714
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             SC = self.__class__(-1)
 *             SC.DT_codes = self.DT_codes[n]
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":715
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):
 *             SC = self.__class__(-1)             # <<<<<<<<<<<<<<
 *             SC.DT_codes = self.DT_codes[n]
 *             SC.length = len(SC.DT_codes)
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_class, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_SC = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":716
 *         if isinstance(n, slice):
 *             SC = self.__class__(-1)
 *             SC.DT_codes = self.DT_codes[n]             # <<<<<<<<<<<<<<
 *             SC.length = len(SC.DT_codes)
 *             Census.__init__(SC, indices=(0, len(SC.DT_codes), 1))
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_DT_codes); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_SC, __pyx_mstate_global->__pyx_n_u_DT_codes, __pyx_t_3) < 0) __PYX_ERR(3, 716, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":717
 *             SC = self.__class__(-1)
 *             SC.DT_codes = self.DT_codes[n]
 *             SC.length = len(SC.DT_codes)             # <<<<<<<<<<<<<<
 *             Census.__init__(SC, indices=(0, len(SC.DT_codes), 1))
 *             return SC
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_SC, __pyx_mstate_global->__pyx_n_u_DT_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 717, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_SC, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_3) < 0) __PYX_ERR(3, 717, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":718
 *             SC.DT_codes = self.DT_codes[n]
 *             SC.length = len(SC.DT_codes)
 *             Census.__init__(SC, indices=(0, len(SC.DT_codes), 1))             # <<<<<<<<<<<<<<
 *             return SC
 *         else:
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_SC, __pyx_mstate_global->__pyx_n_u_DT_codes); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 718, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(3, 718, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(3, 718, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(3, 718, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_SC};
      __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_indices, __pyx_t_8, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(3, 718, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":719
 *             SC.length = len(SC.DT_codes)
 *             Census.__init__(SC, indices=(0, len(SC.DT_codes), 1))
 *             return SC             # <<<<<<<<<<<<<<
 *         else:
 *             name = str('DT:%s' % self.DT_codes[n])
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_SC);
    __pyx_r = __pyx_v_SC;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":714
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             SC = self.__class__(-1)
 *             SC.DT_codes = self.DT_codes[n]
*/
  }

  /* "cython/core/tail.pyx":721
 *             return SC
 *         else:
 *             name = str('DT:%s' % self.DT_codes[n])             # <<<<<<<<<<<<<<
 *             result = Manifold(name)
 *             result.set_name(name)
*/
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_DT_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_DT_s, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_name = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":722
 *         else:
 *             name = str('DT:%s' % self.DT_codes[n])
 *             result = Manifold(name)             # <<<<<<<<<<<<<<
 *             result.set_name(name)
 *             return result
*/
    __pyx_t_7 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold);
    __pyx_t_6 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold); 
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_name};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 722, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }
    __pyx_v_result = ((struct __pyx_obj_8SnapPyHP_Manifold *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":723
 *             name = str('DT:%s' % self.DT_codes[n])
 *             result = Manifold(name)
 *             result.set_name(name)             # <<<<<<<<<<<<<<
 *             return result
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_result);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_name};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 723, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":724
 *             result = Manifold(name)
 *             result.set_name(name)
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_result);
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;
  }

  /* "cython/core/tail.pyx":713
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             SC = self.__class__(-1)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPyHP.ObsMorwenLinks.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_SC);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":729
 * # Creating fibered manifolds from braids
 * 
 * cdef c_Triangulation* get_fibered_manifold_associated_to_braid(num_strands,             # <<<<<<<<<<<<<<
 *                                                                braid_word):
 *     if num_strands < 2:
*/

static Triangulation *__pyx_f_8SnapPyHP_get_fibered_manifold_associated_to_braid(PyObject *__pyx_v_num_strands, PyObject *__pyx_v_braid_word) {
  PyObject *__pyx_v_allowed_letters = NULL;
  int *__pyx_v_word;
  Triangulation *__pyx_v_c_triangulation;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_9genexpr94__pyx_v_x = NULL;
  PyObject *__pyx_9genexpr95__pyx_v_x = NULL;
  PyObject *__pyx_9genexpr96__pyx_v_b = NULL;
  Triangulation *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Triangulation *__pyx_t_15;
  char *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fibered_manifold_associated_to_braid", 0);

  /* "cython/core/tail.pyx":731
 * cdef c_Triangulation* get_fibered_manifold_associated_to_braid(num_strands,
 *                                                                braid_word):
 *     if num_strands < 2:             # <<<<<<<<<<<<<<
 *         raise ValueError('Braids must have at least 2 strands.')
 *     allowed_letters = ([x for x in range(1, num_strands)] +
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_strands, __pyx_mstate_global->__pyx_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 731, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(3, 731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/tail.pyx":732
 *                                                                braid_word):
 *     if num_strands < 2:
 *         raise ValueError('Braids must have at least 2 strands.')             # <<<<<<<<<<<<<<
 *     allowed_letters = ([x for x in range(1, num_strands)] +
 *                        [x for x in range(-num_strands+1, 0)])
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Braids_must_have_at_least_2_stra};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(3, 732, __pyx_L1_error)

    /* "cython/core/tail.pyx":731
 * cdef c_Triangulation* get_fibered_manifold_associated_to_braid(num_strands,
 *                                                                braid_word):
 *     if num_strands < 2:             # <<<<<<<<<<<<<<
 *         raise ValueError('Braids must have at least 2 strands.')
 *     allowed_letters = ([x for x in range(1, num_strands)] +
*/
  }

  /* "cython/core/tail.pyx":733
 *     if num_strands < 2:
 *         raise ValueError('Braids must have at least 2 strands.')
 *     allowed_letters = ([x for x in range(1, num_strands)] +             # <<<<<<<<<<<<<<
 *                        [x for x in range(-num_strands+1, 0)])
 *     if False in [b in allowed_letters for b in braid_word]:
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 733, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_6 = __pyx_builtin_range; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1, __pyx_v_num_strands};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 733, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_6 = __pyx_t_4; __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_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 733, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 733, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 733, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 733, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 733, __pyx_L6_error)
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 733, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr94__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr94__pyx_v_x))) __PYX_ERR(3, 733, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_x); __pyx_9genexpr94__pyx_v_x = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_x); __pyx_9genexpr94__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  { /* enter inner scope */

    /* "cython/core/tail.pyx":734
 *         raise ValueError('Braids must have at least 2 strands.')
 *     allowed_letters = ([x for x in range(1, num_strands)] +
 *                        [x for x in range(-num_strands+1, 0)])             # <<<<<<<<<<<<<<
 *     if False in [b in allowed_letters for b in braid_word]:
 *         raise ValueError('The braid word is invalid.')
*/
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 734, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_9 = __pyx_builtin_range; 
    __pyx_t_10 = PyNumber_Negative(__pyx_v_num_strands); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 734, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyLong_AddObjC(__pyx_t_10, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 734, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_11, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 734, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 734, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 734, __pyx_L13_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 734, __pyx_L13_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 734, __pyx_L13_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 734, __pyx_L13_error)
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_9);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 734, __pyx_L13_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr95__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_9genexpr95__pyx_v_x))) __PYX_ERR(3, 734, __pyx_L13_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_9genexpr95__pyx_v_x); __pyx_9genexpr95__pyx_v_x = 0;
    goto __pyx_L17_exit_scope;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_9genexpr95__pyx_v_x); __pyx_9genexpr95__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L17_exit_scope:;
  } /* exit inner scope */

  /* "cython/core/tail.pyx":733
 *     if num_strands < 2:
 *         raise ValueError('Braids must have at least 2 strands.')
 *     allowed_letters = ([x for x in range(1, num_strands)] +             # <<<<<<<<<<<<<<
 *                        [x for x in range(-num_strands+1, 0)])
 *     if False in [b in allowed_letters for b in braid_word]:
*/
  __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_allowed_letters = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "cython/core/tail.pyx":735
 *     allowed_letters = ([x for x in range(1, num_strands)] +
 *                        [x for x in range(-num_strands+1, 0)])
 *     if False in [b in allowed_letters for b in braid_word]:             # <<<<<<<<<<<<<<
 *         raise ValueError('The braid word is invalid.')
 * 
*/
  { /* enter inner scope */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 735, __pyx_L21_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (likely(PyList_CheckExact(__pyx_v_braid_word)) || PyTuple_CheckExact(__pyx_v_braid_word)) {
      __pyx_t_6 = __pyx_v_braid_word; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_braid_word); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 735, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 735, __pyx_L21_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 735, __pyx_L21_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 735, __pyx_L21_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7));
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 735, __pyx_L21_error)
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 735, __pyx_L21_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_9genexpr96__pyx_v_b, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr96__pyx_v_b, __pyx_v_allowed_letters, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(3, 735, __pyx_L21_error)
      __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 735, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_1))) __PYX_ERR(3, 735, __pyx_L21_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr96__pyx_v_b); __pyx_9genexpr96__pyx_v_b = 0;
    goto __pyx_L25_exit_scope;
    __pyx_L21_error:;
    __Pyx_XDECREF(__pyx_9genexpr96__pyx_v_b); __pyx_9genexpr96__pyx_v_b = 0;
    goto __pyx_L1_error;
    __pyx_L25_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(3, 735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/tail.pyx":736
 *                        [x for x in range(-num_strands+1, 0)])
 *     if False in [b in allowed_letters for b in braid_word]:
 *         raise ValueError('The braid word is invalid.')             # <<<<<<<<<<<<<<
 * 
 *     cdef int* word
*/
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_1 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_The_braid_word_is_invalid};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(3, 736, __pyx_L1_error)

    /* "cython/core/tail.pyx":735
 *     allowed_letters = ([x for x in range(1, num_strands)] +
 *                        [x for x in range(-num_strands+1, 0)])
 *     if False in [b in allowed_letters for b in braid_word]:             # <<<<<<<<<<<<<<
 *         raise ValueError('The braid word is invalid.')
 * 
*/
  }

  /* "cython/core/tail.pyx":741
 *     cdef c_Triangulation* c_triangulation
 * 
 *     n = len(braid_word)             # <<<<<<<<<<<<<<
 *     word = <int*>malloc(n*sizeof(int))
 *     for  i, w in enumerate(braid_word):
*/
  __pyx_t_7 = PyObject_Length(__pyx_v_braid_word); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 741, __pyx_L1_error)
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_v_n = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "cython/core/tail.pyx":742
 * 
 *     n = len(braid_word)
 *     word = <int*>malloc(n*sizeof(int))             # <<<<<<<<<<<<<<
 *     for  i, w in enumerate(braid_word):
 *         word[i] = w
*/
  __pyx_t_9 = __Pyx_PyLong_FromSize_t((sizeof(int))); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_n, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_word = ((int *)malloc(__pyx_t_5));

  /* "cython/core/tail.pyx":743
 *     n = len(braid_word)
 *     word = <int*>malloc(n*sizeof(int))
 *     for  i, w in enumerate(braid_word):             # <<<<<<<<<<<<<<
 *         word[i] = w
 *     c_triangulation = fibered_manifold_associated_to_braid(num_strands, n, word)
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_braid_word)) || PyTuple_CheckExact(__pyx_v_braid_word)) {
    __pyx_t_9 = __pyx_v_braid_word; __Pyx_INCREF(__pyx_t_9);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_braid_word); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 743, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_9))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 743, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 743, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 743, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_8(__pyx_t_9);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 743, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":744
 *     word = <int*>malloc(n*sizeof(int))
 *     for  i, w in enumerate(braid_word):
 *         word[i] = w             # <<<<<<<<<<<<<<
 *     c_triangulation = fibered_manifold_associated_to_braid(num_strands, n, word)
 *     free(word)
*/
    __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_v_w); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 744, __pyx_L1_error)
    __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 744, __pyx_L1_error)
    (__pyx_v_word[__pyx_t_13]) = __pyx_t_12;

    /* "cython/core/tail.pyx":743
 *     n = len(braid_word)
 *     word = <int*>malloc(n*sizeof(int))
 *     for  i, w in enumerate(braid_word):             # <<<<<<<<<<<<<<
 *         word[i] = w
 *     c_triangulation = fibered_manifold_associated_to_braid(num_strands, n, word)
*/
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":745
 *     for  i, w in enumerate(braid_word):
 *         word[i] = w
 *     c_triangulation = fibered_manifold_associated_to_braid(num_strands, n, word)             # <<<<<<<<<<<<<<
 *     free(word)
 *     name = to_byte_str('Braid:' + repr(braid_word))
*/
  __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_v_num_strands); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 745, __pyx_L1_error)
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_v_n); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 745, __pyx_L1_error)
  __pyx_t_15 = fibered_manifold_associated_to_braid(__pyx_t_12, __pyx_t_14, __pyx_v_word); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 745, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_15;

  /* "cython/core/tail.pyx":746
 *         word[i] = w
 *     c_triangulation = fibered_manifold_associated_to_braid(num_strands, n, word)
 *     free(word)             # <<<<<<<<<<<<<<
 *     name = to_byte_str('Braid:' + repr(braid_word))
 *     set_triangulation_name(c_triangulation, name)
*/
  free(__pyx_v_word);

  /* "cython/core/tail.pyx":747
 *     c_triangulation = fibered_manifold_associated_to_braid(num_strands, n, word)
 *     free(word)
 *     name = to_byte_str('Braid:' + repr(braid_word))             # <<<<<<<<<<<<<<
 *     set_triangulation_name(c_triangulation, name)
 *     return c_triangulation
*/
  __pyx_t_9 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_Repr(__pyx_v_braid_word); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Braid, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_9);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":748
 *     free(word)
 *     name = to_byte_str('Braid:' + repr(braid_word))
 *     set_triangulation_name(c_triangulation, name)             # <<<<<<<<<<<<<<
 *     return c_triangulation
 * 
*/
  __pyx_t_16 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error)
  set_triangulation_name(__pyx_v_c_triangulation, __pyx_t_16); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 748, __pyx_L1_error)

  /* "cython/core/tail.pyx":749
 *     name = to_byte_str('Braid:' + repr(braid_word))
 *     set_triangulation_name(c_triangulation, name)
 *     return c_triangulation             # <<<<<<<<<<<<<<
 * 
 * # Link Editor support
*/
  __pyx_r = __pyx_v_c_triangulation;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":729
 * # Creating fibered manifolds from braids
 * 
 * cdef c_Triangulation* get_fibered_manifold_associated_to_braid(num_strands,             # <<<<<<<<<<<<<<
 *                                                                braid_word):
 *     if num_strands < 2:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPyHP.get_fibered_manifold_associated_to_braid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_allowed_letters);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_9genexpr94__pyx_v_x);
  __Pyx_XDECREF(__pyx_9genexpr95__pyx_v_x);
  __Pyx_XDECREF(__pyx_9genexpr96__pyx_v_b);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":756
 * signtype = {'R': KLPHalfTwistCL, 'L': KLPHalfTwistCCL}
 * 
 * cdef c_Triangulation* get_triangulation_from_PythonKLP(pythonklp, remove_finite_vertices=True) except *:             # <<<<<<<<<<<<<<
 *     cdef KLPProjection P
 *     cdef c_Triangulation *c_triangulation
*/

static Triangulation *__pyx_f_8SnapPyHP_get_triangulation_from_PythonKLP(PyObject *__pyx_v_pythonklp, struct __pyx_opt_args_8SnapPyHP_get_triangulation_from_PythonKLP *__pyx_optional_args) {
  PyObject *__pyx_v_remove_finite_vertices = ((PyObject *)Py_True);
  KLPProjection __pyx_v_P;
  Triangulation *__pyx_v_c_triangulation;
  PyObject *__pyx_v_Pycrossings = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_cr_dict = NULL;
  PyObject *__pyx_v_neighbor = NULL;
  PyObject *__pyx_v_strand = NULL;
  PyObject *__pyx_v_sign = NULL;
  PyObject *__pyx_v_tri_name = NULL;
  Triangulation *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  size_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  KLPStrandType __pyx_t_13;
  KLPCrossingType __pyx_t_14;
  int __pyx_t_15;
  Boolean __pyx_t_16;
  Triangulation *__pyx_t_17;
  char *__pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_triangulation_from_PythonKLP", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_remove_finite_vertices = __pyx_optional_args->remove_finite_vertices;
    }
  }

  /* "cython/core/tail.pyx":760
 *     cdef c_Triangulation *c_triangulation
 * 
 *     P.num_crossings, P.num_free_loops, P.num_components, Pycrossings = pythonklp             # <<<<<<<<<<<<<<
 *     P.crossings = <KLPCrossing *>malloc(P.num_crossings * sizeof(KLPCrossing))
 *     if P.crossings == NULL:
*/
  if ((likely(PyTuple_CheckExact(__pyx_v_pythonklp))) || (PyList_CheckExact(__pyx_v_pythonklp))) {
    PyObject* sequence = __pyx_v_pythonklp;
    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(3, 760, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 760, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 760, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 760, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 3);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 760, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4};
      for (i=0; i < 4; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(3, 760, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4};
    __pyx_t_5 = PyObject_GetIter(__pyx_v_pythonklp); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_6(__pyx_t_5); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 4) < 0) __PYX_ERR(3, 760, __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(3, 760, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_P.num_crossings = __pyx_t_7;
  __pyx_v_P.num_free_loops = __pyx_t_8;
  __pyx_v_P.num_components = __pyx_t_9;
  __pyx_v_Pycrossings = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":761
 * 
 *     P.num_crossings, P.num_free_loops, P.num_components, Pycrossings = pythonklp
 *     P.crossings = <KLPCrossing *>malloc(P.num_crossings * sizeof(KLPCrossing))             # <<<<<<<<<<<<<<
 *     if P.crossings == NULL:
 *         raise RuntimeError('Could not allocate a crossing table.')
*/
  __pyx_v_P.crossings = ((KLPCrossing *)malloc((__pyx_v_P.num_crossings * (sizeof(KLPCrossing)))));

  /* "cython/core/tail.pyx":762
 *     P.num_crossings, P.num_free_loops, P.num_components, Pycrossings = pythonklp
 *     P.crossings = <KLPCrossing *>malloc(P.num_crossings * sizeof(KLPCrossing))
 *     if P.crossings == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Could not allocate a crossing table.')
 * 
*/
  __pyx_t_10 = (__pyx_v_P.crossings == NULL);
  if (unlikely(__pyx_t_10)) {

    /* "cython/core/tail.pyx":763
 *     P.crossings = <KLPCrossing *>malloc(P.num_crossings * sizeof(KLPCrossing))
 *     if P.crossings == NULL:
 *         raise RuntimeError('Could not allocate a crossing table.')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(P.num_crossings):
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_2 = __pyx_builtin_RuntimeError; 
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Could_not_allocate_a_crossing_ta};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 763, __pyx_L1_error)

    /* "cython/core/tail.pyx":762
 *     P.num_crossings, P.num_free_loops, P.num_components, Pycrossings = pythonklp
 *     P.crossings = <KLPCrossing *>malloc(P.num_crossings * sizeof(KLPCrossing))
 *     if P.crossings == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Could not allocate a crossing table.')
 * 
*/
  }

  /* "cython/core/tail.pyx":765
 *         raise RuntimeError('Could not allocate a crossing table.')
 * 
 *     for i in range(P.num_crossings):             # <<<<<<<<<<<<<<
 *         cr_dict = Pycrossings[i]
 *         neighbor = cr_dict['Xbackward_neighbor']
*/
  __pyx_t_9 = __pyx_v_P.num_crossings;
  __pyx_t_8 = __pyx_t_9;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cython/core/tail.pyx":766
 * 
 *     for i in range(P.num_crossings):
 *         cr_dict = Pycrossings[i]             # <<<<<<<<<<<<<<
 *         neighbor = cr_dict['Xbackward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPBackward] = &P.crossings[neighbor]
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_Pycrossings, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_cr_dict, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":767
 *     for i in range(P.num_crossings):
 *         cr_dict = Pycrossings[i]
 *         neighbor = cr_dict['Xbackward_neighbor']             # <<<<<<<<<<<<<<
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPBackward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Xforward_neighbor']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Xbackward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_neighbor, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":768
 *         cr_dict = Pycrossings[i]
 *         neighbor = cr_dict['Xbackward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPBackward] = &P.crossings[neighbor]             # <<<<<<<<<<<<<<
 *         neighbor = cr_dict['Xforward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPForward] = &P.crossings[neighbor]
*/
    __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 768, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandX)])[((int)KLPBackward)]) = (&(__pyx_v_P.crossings[__pyx_t_12]));

    /* "cython/core/tail.pyx":769
 *         neighbor = cr_dict['Xbackward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPBackward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Xforward_neighbor']             # <<<<<<<<<<<<<<
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPForward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Ybackward_neighbor']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Xforward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_neighbor, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":770
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPBackward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Xforward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPForward] = &P.crossings[neighbor]             # <<<<<<<<<<<<<<
 *         neighbor = cr_dict['Ybackward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPBackward] = &P.crossings[neighbor]
*/
    __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 770, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandX)])[((int)KLPForward)]) = (&(__pyx_v_P.crossings[__pyx_t_12]));

    /* "cython/core/tail.pyx":771
 *         neighbor = cr_dict['Xforward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPForward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Ybackward_neighbor']             # <<<<<<<<<<<<<<
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPBackward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Yforward_neighbor']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Ybackward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_neighbor, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":772
 *         P.crossings[i].neighbor[<int>KLPStrandX][<int>KLPForward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Ybackward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPBackward] = &P.crossings[neighbor]             # <<<<<<<<<<<<<<
 *         neighbor = cr_dict['Yforward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPForward] = &P.crossings[neighbor]
*/
    __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 772, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandY)])[((int)KLPBackward)]) = (&(__pyx_v_P.crossings[__pyx_t_12]));

    /* "cython/core/tail.pyx":773
 *         neighbor = cr_dict['Ybackward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPBackward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Yforward_neighbor']             # <<<<<<<<<<<<<<
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPForward] = &P.crossings[neighbor]
 * 
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Yforward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_neighbor, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":774
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPBackward] = &P.crossings[neighbor]
 *         neighbor = cr_dict['Yforward_neighbor']
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPForward] = &P.crossings[neighbor]             # <<<<<<<<<<<<<<
 * 
 *         strand = cr_dict['Xbackward_strand']
*/
    __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 774, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandY)])[((int)KLPForward)]) = (&(__pyx_v_P.crossings[__pyx_t_12]));

    /* "cython/core/tail.pyx":776
 *         P.crossings[i].neighbor[<int>KLPStrandY][<int>KLPForward] = &P.crossings[neighbor]
 * 
 *         strand = cr_dict['Xbackward_strand']             # <<<<<<<<<<<<<<
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPBackward] = strandtype[strand]
 *         strand = cr_dict['Xforward_strand']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Xbackward_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_strand, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":777
 * 
 *         strand = cr_dict['Xbackward_strand']
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPBackward] = strandtype[strand]             # <<<<<<<<<<<<<<
 *         strand = cr_dict['Xforward_strand']
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPForward] = strandtype[strand]
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_strandtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = ((KLPStrandType)__Pyx_PyLong_As_KLPStrandType(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 777, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (((__pyx_v_P.crossings[__pyx_v_i]).strand[((int)KLPStrandX)])[((int)KLPBackward)]) = __pyx_t_13;

    /* "cython/core/tail.pyx":778
 *         strand = cr_dict['Xbackward_strand']
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPBackward] = strandtype[strand]
 *         strand = cr_dict['Xforward_strand']             # <<<<<<<<<<<<<<
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPForward] = strandtype[strand]
 *         strand = cr_dict['Ybackward_strand']
*/
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Xforward_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":779
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPBackward] = strandtype[strand]
 *         strand = cr_dict['Xforward_strand']
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPForward] = strandtype[strand]             # <<<<<<<<<<<<<<
 *         strand = cr_dict['Ybackward_strand']
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPBackward] = strandtype[strand]
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_strandtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = ((KLPStrandType)__Pyx_PyLong_As_KLPStrandType(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 779, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (((__pyx_v_P.crossings[__pyx_v_i]).strand[((int)KLPStrandX)])[((int)KLPForward)]) = __pyx_t_13;

    /* "cython/core/tail.pyx":780
 *         strand = cr_dict['Xforward_strand']
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPForward] = strandtype[strand]
 *         strand = cr_dict['Ybackward_strand']             # <<<<<<<<<<<<<<
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPBackward] = strandtype[strand]
 *         strand = cr_dict['Yforward_strand']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Ybackward_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":781
 *         P.crossings[i].strand[<int>KLPStrandX][<int>KLPForward] = strandtype[strand]
 *         strand = cr_dict['Ybackward_strand']
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPBackward] = strandtype[strand]             # <<<<<<<<<<<<<<
 *         strand = cr_dict['Yforward_strand']
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPForward] = strandtype[strand]
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_strandtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = ((KLPStrandType)__Pyx_PyLong_As_KLPStrandType(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 781, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (((__pyx_v_P.crossings[__pyx_v_i]).strand[((int)KLPStrandY)])[((int)KLPBackward)]) = __pyx_t_13;

    /* "cython/core/tail.pyx":782
 *         strand = cr_dict['Ybackward_strand']
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPBackward] = strandtype[strand]
 *         strand = cr_dict['Yforward_strand']             # <<<<<<<<<<<<<<
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPForward] = strandtype[strand]
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Yforward_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":783
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPBackward] = strandtype[strand]
 *         strand = cr_dict['Yforward_strand']
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPForward] = strandtype[strand]             # <<<<<<<<<<<<<<
 * 
 *         sign = cr_dict['sign']
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_strandtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = ((KLPStrandType)__Pyx_PyLong_As_KLPStrandType(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (((__pyx_v_P.crossings[__pyx_v_i]).strand[((int)KLPStrandY)])[((int)KLPForward)]) = __pyx_t_13;

    /* "cython/core/tail.pyx":785
 *         P.crossings[i].strand[<int>KLPStrandY][<int>KLPForward] = strandtype[strand]
 * 
 *         sign = cr_dict['sign']             # <<<<<<<<<<<<<<
 *         P.crossings[i].handedness = signtype[sign[0]]
 *         P.crossings[i].component[<int>KLPStrandX] = cr_dict['Xcomponent']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_sign); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_sign, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":786
 * 
 *         sign = cr_dict['sign']
 *         P.crossings[i].handedness = signtype[sign[0]]             # <<<<<<<<<<<<<<
 *         P.crossings[i].component[<int>KLPStrandX] = cr_dict['Xcomponent']
 *         P.crossings[i].component[<int>KLPStrandY] = cr_dict['Ycomponent']
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_signtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_sign, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = ((KLPCrossingType)__Pyx_PyLong_As_KLPCrossingType(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_P.crossings[__pyx_v_i]).handedness = __pyx_t_14;

    /* "cython/core/tail.pyx":787
 *         sign = cr_dict['sign']
 *         P.crossings[i].handedness = signtype[sign[0]]
 *         P.crossings[i].component[<int>KLPStrandX] = cr_dict['Xcomponent']             # <<<<<<<<<<<<<<
 *         P.crossings[i].component[<int>KLPStrandY] = cr_dict['Ycomponent']
 * 
*/
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Xcomponent); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((__pyx_v_P.crossings[__pyx_v_i]).component[((int)KLPStrandX)]) = __pyx_t_15;

    /* "cython/core/tail.pyx":788
 *         P.crossings[i].handedness = signtype[sign[0]]
 *         P.crossings[i].component[<int>KLPStrandX] = cr_dict['Xcomponent']
 *         P.crossings[i].component[<int>KLPStrandY] = cr_dict['Ycomponent']             # <<<<<<<<<<<<<<
 * 
 *     c_triangulation = triangulate_link_complement(&P, remove_finite_vertices)
*/
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_mstate_global->__pyx_n_u_Ycomponent); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((__pyx_v_P.crossings[__pyx_v_i]).component[((int)KLPStrandY)]) = __pyx_t_15;
  }

  /* "cython/core/tail.pyx":790
 *         P.crossings[i].component[<int>KLPStrandY] = cr_dict['Ycomponent']
 * 
 *     c_triangulation = triangulate_link_complement(&P, remove_finite_vertices)             # <<<<<<<<<<<<<<
 *     free(P.crossings)
 * 
*/
  __pyx_t_16 = __Pyx_PyLong_As_Boolean(__pyx_v_remove_finite_vertices); if (unlikely((__pyx_t_16 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(3, 790, __pyx_L1_error)
  __pyx_t_17 = triangulate_link_complement((&__pyx_v_P), __pyx_t_16); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 790, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_17;

  /* "cython/core/tail.pyx":791
 * 
 *     c_triangulation = triangulate_link_complement(&P, remove_finite_vertices)
 *     free(P.crossings)             # <<<<<<<<<<<<<<
 * 
 *     if c_triangulation == NULL:
*/
  free(__pyx_v_P.crossings);

  /* "cython/core/tail.pyx":793
 *     free(P.crossings)
 * 
 *     if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Could not create the triangulation.')
 * 
*/
  __pyx_t_10 = (__pyx_v_c_triangulation == NULL);
  if (unlikely(__pyx_t_10)) {

    /* "cython/core/tail.pyx":794
 * 
 *     if c_triangulation == NULL:
 *         raise RuntimeError('Could not create the triangulation.')             # <<<<<<<<<<<<<<
 * 
 *     # The triangulation must have a name or SnapPea will segfault when
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_RuntimeError);
    __pyx_t_4 = __pyx_builtin_RuntimeError; 
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Could_not_create_the_triangulati};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 794, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(3, 794, __pyx_L1_error)

    /* "cython/core/tail.pyx":793
 *     free(P.crossings)
 * 
 *     if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Could not create the triangulation.')
 * 
*/
  }

  /* "cython/core/tail.pyx":798
 *     # The triangulation must have a name or SnapPea will segfault when
 *     #   trying to copy the triangulation.
 *     tri_name = to_byte_str('unnamed link')             # <<<<<<<<<<<<<<
 *     set_triangulation_name(c_triangulation, tri_name)
 *     return c_triangulation
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_to_byte_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_unnamed_link};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_tri_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":799
 *     #   trying to copy the triangulation.
 *     tri_name = to_byte_str('unnamed link')
 *     set_triangulation_name(c_triangulation, tri_name)             # <<<<<<<<<<<<<<
 *     return c_triangulation
*/
  __pyx_t_18 = __Pyx_PyObject_AsWritableString(__pyx_v_tri_name); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(3, 799, __pyx_L1_error)
  set_triangulation_name(__pyx_v_c_triangulation, __pyx_t_18); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 799, __pyx_L1_error)

  /* "cython/core/tail.pyx":800
 *     tri_name = to_byte_str('unnamed link')
 *     set_triangulation_name(c_triangulation, tri_name)
 *     return c_triangulation             # <<<<<<<<<<<<<<
*/
  __pyx_r = __pyx_v_c_triangulation;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":756
 * signtype = {'R': KLPHalfTwistCL, 'L': KLPHalfTwistCCL}
 * 
 * cdef c_Triangulation* get_triangulation_from_PythonKLP(pythonklp, remove_finite_vertices=True) except *:             # <<<<<<<<<<<<<<
 *     cdef KLPProjection P
 *     cdef c_Triangulation *c_triangulation
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPyHP.get_triangulation_from_PythonKLP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Pycrossings);
  __Pyx_XDECREF(__pyx_v_cr_dict);
  __Pyx_XDECREF(__pyx_v_neighbor);
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XDECREF(__pyx_v_sign);
  __Pyx_XDECREF(__pyx_v_tri_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_PresentationMatrix(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

/* Python wrapper */
static PyObject *__pyx_pw_8SnapPyHP_61__pyx_unpickle_PresentationMatrix(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_8SnapPyHP_61__pyx_unpickle_PresentationMatrix = {"__pyx_unpickle_PresentationMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_61__pyx_unpickle_PresentationMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8SnapPyHP_61__pyx_unpickle_PresentationMatrix(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_PresentationMatrix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(7, 1, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_PresentationMatrix", 0) < 0) __PYX_ERR(7, 1, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PresentationMatrix", 1, 3, 3, i); __PYX_ERR(7, 1, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 1, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 1, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 1, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(7, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PresentationMatrix", 1, 3, 3, __pyx_nargs); __PYX_ERR(7, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("SnapPyHP.__pyx_unpickle_PresentationMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8SnapPyHP_60__pyx_unpickle_PresentationMatrix(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_8SnapPyHP_60__pyx_unpickle_PresentationMatrix(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;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_PresentationMatrix", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59cf8a3, 0x3a22a1e, 0x3df3bb8):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[31], Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 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 (0x59cf8a3, 0x3a22a1e, 0x3df3bb8):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum
 *     __pyx_result = PresentationMatrix.__new__(__pyx_type)
*/
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_PickleError) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pickle_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 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_mstate_global->__pyx_n_u_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 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 (0x59cf8a3, 0x3a22a1e, 0x3df3bb8):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = PresentationMatrix.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 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(7, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59cf8a3, 0x3a22a1e, 0x3df3bb8):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum
*/
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum
 *     __pyx_result = PresentationMatrix.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_PresentationMatrix__set_state(<PresentationMatrix> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum
 *     __pyx_result = PresentationMatrix.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_PresentationMatrix__set_state(<PresentationMatrix> __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 = PresentationMatrix.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_PresentationMatrix__set_state(<PresentationMatrix> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_PresentationMatrix__set_state(PresentationMatrix __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(7, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_8SnapPyHP___pyx_unpickle_PresentationMatrix__set_state(((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 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 (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum
 *     __pyx_result = PresentationMatrix.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_PresentationMatrix__set_state(<PresentationMatrix> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_PresentationMatrix__set_state(<PresentationMatrix> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_PresentationMatrix__set_state(PresentationMatrix __pyx_result, tuple __pyx_state):
 *     __pyx_result._col_support = __pyx_state[0]; __pyx_result._entries = __pyx_state[1]; __pyx_result._row_support = __pyx_state[2]; __pyx_result._units = __pyx_state[3]; __pyx_result.cols = __pyx_state[4]; __pyx_result.dead_columns = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]
*/
  __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_PresentationMatrix(__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_AddTraceback("SnapPyHP.__pyx_unpickle_PresentationMatrix", __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_PresentationMatrix__set_state(<PresentationMatrix> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_PresentationMatrix__set_state(PresentationMatrix __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._col_support = __pyx_state[0]; __pyx_result._entries = __pyx_state[1]; __pyx_result._row_support = __pyx_state[2]; __pyx_result._units = __pyx_state[3]; __pyx_result.cols = __pyx_state[4]; __pyx_result.dead_columns = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
*/

static PyObject *__pyx_f_8SnapPyHP___pyx_unpickle_PresentationMatrix__set_state(struct __pyx_obj_8SnapPyHP_PresentationMatrix *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_PresentationMatrix__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_PresentationMatrix__set_state(PresentationMatrix __pyx_result, tuple __pyx_state):
 *     __pyx_result._col_support = __pyx_state[0]; __pyx_result._entries = __pyx_state[1]; __pyx_result._row_support = __pyx_state[2]; __pyx_result._units = __pyx_state[3]; __pyx_result.cols = __pyx_state[4]; __pyx_result.dead_columns = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(7, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 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(7, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_col_support);
  __Pyx_DECREF(__pyx_v___pyx_result->_col_support);
  __pyx_v___pyx_result->_col_support = ((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(7, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 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(7, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_entries);
  __Pyx_DECREF(__pyx_v___pyx_result->_entries);
  __pyx_v___pyx_result->_entries = ((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(7, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 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(7, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_row_support);
  __Pyx_DECREF(__pyx_v___pyx_result->_row_support);
  __pyx_v___pyx_result->_row_support = ((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(7, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_units);
  __Pyx_DECREF(__pyx_v___pyx_result->_units);
  __pyx_v___pyx_result->_units = ((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(7, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cols = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(7, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->dead_columns);
  __Pyx_DECREF(__pyx_v___pyx_result->dead_columns);
  __pyx_v___pyx_result->dead_columns = ((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(7, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rows = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_PresentationMatrix__set_state(PresentationMatrix __pyx_result, tuple __pyx_state):
 *     __pyx_result._col_support = __pyx_state[0]; __pyx_result._entries = __pyx_state[1]; __pyx_result._row_support = __pyx_state[2]; __pyx_result._units = __pyx_state[3]; __pyx_result.cols = __pyx_state[4]; __pyx_result.dead_columns = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(7, 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(7, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 > 7);
  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_mstate_global->__pyx_n_u_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 13, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result._col_support = __pyx_state[0]; __pyx_result._entries = __pyx_state[1]; __pyx_result._row_support = __pyx_state[2]; __pyx_result._units = __pyx_state[3]; __pyx_result.cols = __pyx_state[4]; __pyx_result.dead_columns = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __pyx_t_7;
    __Pyx_INCREF(__pyx_t_6);
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(7, 14, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_PresentationMatrix__set_state(PresentationMatrix __pyx_result, tuple __pyx_state):
 *     __pyx_result._col_support = __pyx_state[0]; __pyx_result._entries = __pyx_state[1]; __pyx_result._row_support = __pyx_state[2]; __pyx_result._units = __pyx_state[3]; __pyx_result.cols = __pyx_state[4]; __pyx_result.dead_columns = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
*/
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_PresentationMatrix__set_state(<PresentationMatrix> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_PresentationMatrix__set_state(PresentationMatrix __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._col_support = __pyx_state[0]; __pyx_result._entries = __pyx_state[1]; __pyx_result._row_support = __pyx_state[2]; __pyx_result._units = __pyx_state[3]; __pyx_result.cols = __pyx_state[4]; __pyx_result.dead_columns = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]
 *     if len(__pyx_state) > 7 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("SnapPyHP.__pyx_unpickle_PresentationMatrix__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */
static struct __pyx_vtabstruct_8SnapPyHP_Triangulation __pyx_vtable_8SnapPyHP_Triangulation;

static PyObject *__pyx_tp_new_8SnapPyHP_Triangulation(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8SnapPyHP_Triangulation *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_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_8SnapPyHP_Triangulation *)o);
  p->__pyx_vtab = __pyx_vtabptr_8SnapPyHP_Triangulation;
  p->_DTcode = Py_None; Py_INCREF(Py_None);
  p->_PDcode = Py_None; Py_INCREF(Py_None);
  p->_cover_info = Py_None; Py_INCREF(Py_None);
  p->_cache = Py_None; Py_INCREF(Py_None);
  p->LE = Py_None; Py_INCREF(Py_None);
  p->_link_file_full_path = Py_None; Py_INCREF(Py_None);
  p->hyperbolic_structure_initialized = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8SnapPyHP_13Triangulation_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8SnapPyHP_Triangulation(PyObject *o) {
  struct __pyx_obj_8SnapPyHP_Triangulation *p = (struct __pyx_obj_8SnapPyHP_Triangulation *)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_8SnapPyHP_Triangulation) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_8SnapPyHP_13Triangulation_67__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_DTcode);
  Py_CLEAR(p->_PDcode);
  Py_CLEAR(p->_cover_info);
  Py_CLEAR(p->_cache);
  Py_CLEAR(p->LE);
  Py_CLEAR(p->_link_file_full_path);
  Py_CLEAR(p->hyperbolic_structure_initialized);
  #if CYTHON_USE_TYPE_SLOTS
  (*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_8SnapPyHP_Triangulation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP_Triangulation *p = (struct __pyx_obj_8SnapPyHP_Triangulation *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_DTcode) {
    e = (*v)(p->_DTcode, a); if (e) return e;
  }
  if (p->_PDcode) {
    e = (*v)(p->_PDcode, a); if (e) return e;
  }
  if (p->_cover_info) {
    e = (*v)(p->_cover_info, a); if (e) return e;
  }
  if (p->_cache) {
    e = (*v)(p->_cache, a); if (e) return e;
  }
  if (p->LE) {
    e = (*v)(p->LE, a); if (e) return e;
  }
  if (p->_link_file_full_path) {
    e = (*v)(p->_link_file_full_path, a); if (e) return e;
  }
  if (p->hyperbolic_structure_initialized) {
    e = (*v)(p->hyperbolic_structure_initialized, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP_Triangulation(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP_Triangulation *p = (struct __pyx_obj_8SnapPyHP_Triangulation *)o;
  tmp = ((PyObject*)p->_DTcode);
  p->_DTcode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_PDcode);
  p->_PDcode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_cover_info);
  p->_cover_info = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_cache);
  p->_cache = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->LE);
  p->LE = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_link_file_full_path);
  p->_link_file_full_path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hyperbolic_structure_initialized);
  p->hyperbolic_structure_initialized = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_8SnapPyHP_13Triangulation__cache(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8SnapPyHP_13Triangulation_6_cache_1__get__(o);
}

static PyObject *__pyx_getprop_8SnapPyHP_13Triangulation_LE(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8SnapPyHP_13Triangulation_2LE_1__get__(o);
}

static PyMethodDef __pyx_methods_8SnapPyHP_Triangulation[] = {
  {"_get_from_link_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_3_get_from_link_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_remove_finite_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_5_remove_finite_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_4_remove_finite_vertices},
  {"cover_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_7cover_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_6cover_info},
  {"plink", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_9plink, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_8plink},
  {"link", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_11link, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_10link},
  {"num_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_13num_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_12num_cusps},
  {"_num_fake_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_15_num_fake_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_14_num_fake_cusps},
  {"orientation_cover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_17orientation_cover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_16orientation_cover},
  {"is_orientable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_19is_orientable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_18is_orientable},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_21copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_20copy},
  {"randomize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_23randomize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_22randomize},
  {"simplify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_25simplify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_24simplify},
  {"_two_to_three", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_27_two_to_three, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_26_two_to_three},
  {"_three_to_two", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_29_three_to_two, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_28_three_to_two},
  {"with_hyperbolic_structure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_31with_hyperbolic_structure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_30with_hyperbolic_structure},
  {"_polish_hyperbolic_structures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_33_polish_hyperbolic_structures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_32_polish_hyperbolic_structures},
  {"_empty_save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_35_empty_save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_34_empty_save},
  {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_37save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_36save},
  {"_to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_39_to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_38_to_string},
  {"_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_41_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_40_from_string},
  {"_to_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_43_to_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_42_to_bytes},
  {"_from_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_45_from_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_44_from_bytes},
  {"_from_pickle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_47_from_pickle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_46_from_pickle},
  {"_from_tetrahedra_gluing_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_49_from_tetrahedra_gluing_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_48_from_tetrahedra_gluing_data},
  {"_from_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_51_from_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_50_from_isosig},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_53__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_52__reduce__},
  {"pickle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_55pickle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_reindex_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_57_reindex_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_56_reindex_cusps},
  {"_get_cusp_indices_and_peripheral_curve_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_59_get_cusp_indices_and_peripheral_curve_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_get_tetrahedra_gluing_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_61_get_tetrahedra_gluing_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_isomorphisms_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_63_isomorphisms_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_62_isomorphisms_to},
  {"isomorphisms_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_65isomorphisms_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_64isomorphisms_to},
  {"name", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_73name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_72name},
  {"set_name", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_75set_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_74set_name},
  {"DT_code", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_77DT_code, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_76DT_code},
  {"_set_DTcode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_79_set_DTcode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_set_PDcode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_81_set_PDcode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"num_tetrahedra", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_83num_tetrahedra, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_82num_tetrahedra},
  {"dehn_fill", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_85dehn_fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_84dehn_fill},
  {"cusp_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_87cusp_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_86cusp_info},
  {"reverse_orientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_89reverse_orientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_88reverse_orientation},
  {"filled_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_91filled_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_90filled_triangulation},
  {"_unsimplified_filled_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_93_unsimplified_filled_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_92_unsimplified_filled_triangulation},
  {"_marked_tetrahedra", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_95_marked_tetrahedra, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"edge_valences", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_97edge_valences, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_96edge_valences},
  {"gluing_equations_pgl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_99gluing_equations_pgl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_98gluing_equations_pgl},
  {"_ptolemy_equations_identified_face_classes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_101_ptolemy_equations_identified_face_classes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_100_ptolemy_equations_identified_face_classes},
  {"_ptolemy_equations_identified_coordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_103_ptolemy_equations_identified_coordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_102_ptolemy_equations_identified_coordinates},
  {"_ptolemy_equations_action_by_decoration_change", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_105_ptolemy_equations_action_by_decoration_change, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_104_ptolemy_equations_action_by_decoration_change},
  {"_ptolemy_equations_boundary_map_3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_107_ptolemy_equations_boundary_map_3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_106_ptolemy_equations_boundary_map_3},
  {"_ptolemy_equations_boundary_map_2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_109_ptolemy_equations_boundary_map_2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_108_ptolemy_equations_boundary_map_2},
  {"_ptolemy_equations_boundary_map_1", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_111_ptolemy_equations_boundary_map_1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_110_ptolemy_equations_boundary_map_1},
  {"ptolemy_obstruction_classes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_113ptolemy_obstruction_classes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_112ptolemy_obstruction_classes},
  {"ptolemy_generalized_obstruction_classes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_115ptolemy_generalized_obstruction_classes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_114ptolemy_generalized_obstruction_classes},
  {"ptolemy_variety", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_117ptolemy_variety, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_116ptolemy_variety},
  {"gluing_equations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_119gluing_equations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_118gluing_equations},
  {"_presentation_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_121_presentation_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_120_presentation_matrix},
  {"homology", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_123homology, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_122homology},
  {"fundamental_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_125fundamental_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_124fundamental_group},
  {"cover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_127cover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_126cover},
  {"covers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_129covers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_128covers},
  {"_covers_low_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_131_covers_low_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_130_covers_low_index},
  {"_covers_gap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_133_covers_gap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_132_covers_gap},
  {"_covers_magma", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_135_covers_magma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_134_covers_magma},
  {"_covers_snappea", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_137_covers_snappea, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_136_covers_snappea},
  {"set_peripheral_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_139set_peripheral_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_138set_peripheral_curves},
  {"has_finite_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_141has_finite_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_140has_finite_vertices},
  {"triangulation_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_143triangulation_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_142triangulation_isosig},
  {"_undecorated_triangulation_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_145_undecorated_triangulation_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_symplectic_form", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_147_symplectic_form, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_is_symplectic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_149_is_symplectic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_148_is_symplectic},
  {"symplectic_basis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13Triangulation_151symplectic_basis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13Triangulation_150symplectic_basis},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8SnapPyHP_Triangulation[] = {
  {"_cache", __pyx_getprop_8SnapPyHP_13Triangulation__cache, 0, 0, 0},
  {"LE", __pyx_getprop_8SnapPyHP_13Triangulation_LE, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_Triangulation_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP_Triangulation},
  {Py_tp_repr, (void *)__pyx_pw_8SnapPyHP_13Triangulation_71__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A Triangulation object represents a compact 3-manifold with torus\n    boundary components, given as an ideal triangulation of the\n    manifold's interior.  A Dehn-filling can be specified for each\n    boundary component, allowing the description of closed 3-manifolds\n    and some orbifolds.  For non-orientable 3-manifolds, the boundary\n    components can also be Klein bottles. Two Triangulations are equal\n    ('==') if they represent combinatorially isomorphic\n    triangulations.  A Triangulation does *not* have any geometric\n    structure, and usually one works with the subclass Manifold which\n    adds this.  Here's a quick example:\n\n    >>> M = Triangulation('9_42')\n    >>> M.num_tetrahedra()\n    5\n    >>> M.is_orientable()\n    True\n\n    A Triangulation can be specified in a number of ways, e.g.\n\n    - Triangulation('9_42') : The complement of the knot 9_42 in S^3.\n    - Triangulation('m125(1,2)(4,5)') : The SnapPea census manifold m125\n      where the first cusp has Dehn filling (1,2) and the second cusp has\n      filling (4,5).\n    - Triangulation() : Opens a link editor window where can you\n      specify a link complement.\n\n    In general, the specification can be from among the below, with\n    information on Dehn fillings added.\n\n    - SnapPea cusped census manifolds: e.g. 'm123', 's123', 'v123'.\n\n    - Link complements:\n\n        + Rolfsen's table: e.g. '4_1', '04_1', '5^2_6', '6_4^7', 'L20935', 'l104001'.\n        + Knots and links up to 14 crossings from tabulations by Hoste\n          and Thistlethwaite: e.g. 'K12a456' or 'L13n579'.\n        + Hoste-Thistlethwaite Knotscape table:  e.g. '11a17' or '12n345'\n        + Dowker-Thistlethwaite code: e.g. 'DT:[(6,8,2,4)]', 'DT:dadbcda'\n\n    - Once-punctured torus bundles: e.g. 'b++LLR', 'b+-llR', 'bo-RRL', 'bn+LRLR'\n\n    - Fibered manifold associated to a braid: 'Braid:[1,2,-3,4]'\n\n      Here, the braid is thought of as a mapping class of the\n      punctured disc, and"" this manifold is the corresponding\n      mapping torus.  If you want the braid closure, do (1,0) filling\n      of the last cusp.\n\n    - From mapping class group data using Twister:\n\n      'Bundle(S_{1,1}, [a0, B1])' or 'Splitting(S_{1,0}, [b1, A0], [a0,B1])'\n\n      See the help for the 'twister' module for more.\n\n    - A SnapPea triangulation or link projection file: 'filename'\n\n      The file will be loaded if found in the current directory or the\n      path given by the shell variable SNAPPEA_MANIFOLD_DIRECTORY.\n\n    - A Regina-style isomorphism signature, such as 'dLQbcccdxwb'.\n\n    - A string containing the contents of a SnapPea triangulation or link\n      projection file.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_Triangulation},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_Triangulation},
  {Py_tp_richcompare, (void *)__pyx_pw_8SnapPyHP_13Triangulation_69__richcmp__},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_Triangulation},
  {Py_tp_getset, (void *)__pyx_getsets_8SnapPyHP_Triangulation},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_Triangulation},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_Triangulation_spec = {
  "SnapPyHP.Triangulation",
  sizeof(struct __pyx_obj_8SnapPyHP_Triangulation),
  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_8SnapPyHP_Triangulation_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP_Triangulation = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""Triangulation", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_Triangulation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_Triangulation, /*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*/
  0, /*tp_as_async*/
  __pyx_pw_8SnapPyHP_13Triangulation_71__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    A Triangulation object represents a compact 3-manifold with torus\n    boundary components, given as an ideal triangulation of the\n    manifold's interior.  A Dehn-filling can be specified for each\n    boundary component, allowing the description of closed 3-manifolds\n    and some orbifolds.  For non-orientable 3-manifolds, the boundary\n    components can also be Klein bottles. Two Triangulations are equal\n    ('==') if they represent combinatorially isomorphic\n    triangulations.  A Triangulation does *not* have any geometric\n    structure, and usually one works with the subclass Manifold which\n    adds this.  Here's a quick example:\n\n    >>> M = Triangulation('9_42')\n    >>> M.num_tetrahedra()\n    5\n    >>> M.is_orientable()\n    True\n\n    A Triangulation can be specified in a number of ways, e.g.\n\n    - Triangulation('9_42') : The complement of the knot 9_42 in S^3.\n    - Triangulation('m125(1,2)(4,5)') : The SnapPea census manifold m125\n      where the first cusp has Dehn filling (1,2) and the second cusp has\n      filling (4,5).\n    - Triangulation() : Opens a link editor window where can you\n      specify a link complement.\n\n    In general, the specification can be from among the below, with\n    information on Dehn fillings added.\n\n    - SnapPea cusped census manifolds: e.g. 'm123', 's123', 'v123'.\n\n    - Link complements:\n\n        + Rolfsen's table: e.g. '4_1', '04_1', '5^2_6', '6_4^7', 'L20935', 'l104001'.\n        + Knots and links up to 14 crossings from tabulations by Hoste\n          and Thistlethwaite: e.g. 'K12a456' or 'L13n579'.\n        + Hoste-Thistlethwaite Knotscape table:  e.g. '11a17' or '12n345'\n        + Dowker-Thistlethwaite code: e.g. 'DT:[(6,8,2,4)]', 'DT:dadbcda'\n\n    - Once-punctured torus bundles: e.g. 'b++LLR', 'b+-llR', 'bo-RRL', 'bn+LRLR'\n\n    - Fibered manifold associated to a braid: 'Braid:[1,2,-3,4]'\n\n      Here, the braid is thought of as a mapping class of the\n      punctured disc, and"" this manifold is the corresponding\n      mapping torus.  If you want the braid closure, do (1,0) filling\n      of the last cusp.\n\n    - From mapping class group data using Twister:\n\n      'Bundle(S_{1,1}, [a0, B1])' or 'Splitting(S_{1,0}, [b1, A0], [a0,B1])'\n\n      See the help for the 'twister' module for more.\n\n    - A SnapPea triangulation or link projection file: 'filename'\n\n      The file will be loaded if found in the current directory or the\n      path given by the shell variable SNAPPEA_MANIFOLD_DIRECTORY.\n\n    - A Regina-style isomorphism signature, such as 'dLQbcccdxwb'.\n\n    - A string containing the contents of a SnapPea triangulation or link\n      projection file.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_Triangulation, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_Triangulation, /*tp_clear*/
  __pyx_pw_8SnapPyHP_13Triangulation_69__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_Triangulation, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8SnapPyHP_Triangulation, /*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_8SnapPyHP_Triangulation, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 struct __pyx_vtabstruct_8SnapPyHP_Manifold __pyx_vtable_8SnapPyHP_Manifold;

static PyObject *__pyx_tp_new_8SnapPyHP_Manifold(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8SnapPyHP_Manifold *p;
  PyObject *o = __pyx_tp_new_8SnapPyHP_Triangulation(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8SnapPyHP_Manifold *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8SnapPyHP_Triangulation*)__pyx_vtabptr_8SnapPyHP_Manifold;
  return o;
}

static PyMethodDef __pyx_methods_8SnapPyHP_Manifold[] = {
  {"_number_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_3_number_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"use_field_conversion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_5use_field_conversion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_4use_field_conversion},
  {"init_hyperbolic_structure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_7init_hyperbolic_structure, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"canonize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_9canonize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_8canonize},
  {"_canonical_retriangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_11_canonical_retriangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_10_canonical_retriangulation},
  {"_canonical_cells_are_tetrahedra", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_13_canonical_cells_are_tetrahedra, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_12_canonical_cells_are_tetrahedra},
  {"_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_15_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_14_from_string},
  {"_from_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_17_from_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_16_from_bytes},
  {"_from_isosig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_19_from_isosig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_18_from_isosig},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_21copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_20copy},
  {"cusp_neighborhood", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_23cusp_neighborhood, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_22cusp_neighborhood},
  {"dirichlet_domain", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_25dirichlet_domain, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_24dirichlet_domain},
  {"browse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_27browse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_26browse},
  {"filled_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_29filled_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_28filled_triangulation},
  {"fundamental_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_31fundamental_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_30fundamental_group},
  {"symmetry_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_33symmetry_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_32symmetry_group},
  {"symmetric_triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_35symmetric_triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_34symmetric_triangulation},
  {"cover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_37cover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_36cover},
  {"covers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_39covers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_38covers},
  {"_complex_volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_41_complex_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_43volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_42volume},
  {"chern_simons", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_45chern_simons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_44chern_simons},
  {"without_hyperbolic_structure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_47without_hyperbolic_structure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_46without_hyperbolic_structure},
  {"_polish_hyperbolic_structures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_49_polish_hyperbolic_structures, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"tetrahedra_shapes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_51tetrahedra_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_50tetrahedra_shapes},
  {"_get_tetrahedra_shapes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_53_get_tetrahedra_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_52_get_tetrahedra_shapes},
  {"set_tetrahedra_shapes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_55set_tetrahedra_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_54set_tetrahedra_shapes},
  {"solution_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_57solution_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_56solution_type},
  {"set_target_holonomy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_59set_target_holonomy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_58set_target_holonomy},
  {"cusp_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_61cusp_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_60cusp_info},
  {"dehn_fill", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_63dehn_fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_62dehn_fill},
  {"set_peripheral_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_65set_peripheral_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_64set_peripheral_curves},
  {"dual_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_67dual_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_66dual_curves},
  {"length_spectrum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_69length_spectrum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_68length_spectrum},
  {"drill", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_71drill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_70drill},
  {"_is_isometric_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_73_is_isometric_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_72_is_isometric_to},
  {"is_isometric_to", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_75is_isometric_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_74is_isometric_to},
  {"is_two_bridge", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_77is_two_bridge, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_76is_two_bridge},
  {"_choose_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_79_choose_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_choose_generators_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_81_choose_generators_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_80_choose_generators_info},
  {"splitting_surfaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_83splitting_surfaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_82splitting_surfaces},
  {"split", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_85split, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_8Manifold_84split},
  {"_identify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_87_identify, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_cusp_cross_section_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_89_cusp_cross_section_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_precision", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_8Manifold_91_precision, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_Manifold_slots[] = {
  {Py_tp_doc, (void *)PyDoc_STR("\n    A Manifold is a :class:`Triangulation` together with a geometric structure.\n    That is, a Manifold is an ideal triangulation of the interior of a\n    compact 3-manifold with torus and Klein-bottle boundary components, where\n    each tetrahedron has been assigned the geometry of an ideal tetrahedron\n    in hyperbolic 3-space. A Dehn-filling can be specified for each\n    boundary component, allowing the description of closed 3-manifolds,\n    some orbifolds and cone 3-manifolds. Here's a quick example:\n\n    >>> M = Manifold('9_42')\n    >>> M.volume()  # doctest: +NUMERIC6\n    4.05686022\n    >>> M.cusp_info('shape') # doctest: +NUMERIC6\n    [-4.278936315 + 1.95728679*I]\n\n    This is an example for running SnapPy inside Sage::\n\n      sage: import snappy\n      sage: M = snappy.Manifold('m125(1,2)(4,5)')\n      sage: M.is_orientable()\n      True\n\n    An alternative way of running SnapPy inside Sage::\n\n      sage: from snappy import *\n      sage: M = Manifold('m123')\n      sage: M.num_cusps()\n      1\n\n\n    A Manifold can be specified in a number of ways, e.g.\n\n    - Manifold('9_42') : The complement of the knot 9_42 in S^3.\n    - Manifold('m125(1,2)(4,5)') : The SnapPea census manifold m125\n      where the first cusp has Dehn filling (1,2) and the second cusp has\n      filling (4,5).\n    - Manifold() : Opens a link editor window where can you\n      specify a link complement.\n\n    In general, the specification can be from among the below, with\n    information on Dehn fillings added.\n\n    - SnapPea cusped census manifolds: e.g. 'm123', 's123', 'v123'.\n\n    - Link complements:\n\n       + Rolfsen's table: e.g. '4_1', '04_1', '5^2_6', '6_4^7', 'L20935', 'l104001'.\n       + Hoste-Thistlethwaite Knotscape table:  e.g. '11a17' or '12n345'\n       + Callahan-Dean-Weeks-Champanerkar-Kofman-Patterson knots: e.g. 'K6_21'.\n       + Dowker-Thistlethwaite code: e.g. 'DT:[(6,8,2,4)]'\n\n    - Once-punctured torus bundles: e.g. 'b++LLR', '""b+-llR', 'bo-RRL', 'bn+LRLR'\n\n    - Fibered manifold associated to a braid: 'Braid[1,2,-3,4]'\n\n      Here, the braid is thought of as a mapping class of the\n      punctured disc, and this manifold is the corresponding\n      mapping torus.  If you want the braid closure, do (1,0) filling\n      of the last cusp.\n\n    - From mapping class group data using Twister:\n\n      'Bundle(S_{1,1}, [a0, B1])' or 'Splitting(S_{1,0}, [b1, A0], [a0,B1])'\n\n      See the help for the 'twister' module for more.\n\n    - A SnapPea triangulation or link projection file: 'filename'\n\n      The file will be loaded if found in the current directory or the\n      path given by the shell variable ``SNAPPEA_MANIFOLD_DIRECTORY``.\n      See :py:meth:`Manifold.save` for details.\n\n    - A string containing the contents of a SnapPea triangulation or link\n      projection file.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_Triangulation},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_Triangulation},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_Manifold},
  {Py_tp_init, (void *)__pyx_pw_8SnapPyHP_8Manifold_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_Manifold},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_Manifold_spec = {
  "SnapPyHP.Manifold",
  sizeof(struct __pyx_obj_8SnapPyHP_Manifold),
  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_8SnapPyHP_Manifold_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP_Manifold = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""Manifold", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_Manifold), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_Triangulation, /*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*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_8SnapPyHP_13Triangulation_71__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    A Manifold is a :class:`Triangulation` together with a geometric structure.\n    That is, a Manifold is an ideal triangulation of the interior of a\n    compact 3-manifold with torus and Klein-bottle boundary components, where\n    each tetrahedron has been assigned the geometry of an ideal tetrahedron\n    in hyperbolic 3-space. A Dehn-filling can be specified for each\n    boundary component, allowing the description of closed 3-manifolds,\n    some orbifolds and cone 3-manifolds. Here's a quick example:\n\n    >>> M = Manifold('9_42')\n    >>> M.volume()  # doctest: +NUMERIC6\n    4.05686022\n    >>> M.cusp_info('shape') # doctest: +NUMERIC6\n    [-4.278936315 + 1.95728679*I]\n\n    This is an example for running SnapPy inside Sage::\n\n      sage: import snappy\n      sage: M = snappy.Manifold('m125(1,2)(4,5)')\n      sage: M.is_orientable()\n      True\n\n    An alternative way of running SnapPy inside Sage::\n\n      sage: from snappy import *\n      sage: M = Manifold('m123')\n      sage: M.num_cusps()\n      1\n\n\n    A Manifold can be specified in a number of ways, e.g.\n\n    - Manifold('9_42') : The complement of the knot 9_42 in S^3.\n    - Manifold('m125(1,2)(4,5)') : The SnapPea census manifold m125\n      where the first cusp has Dehn filling (1,2) and the second cusp has\n      filling (4,5).\n    - Manifold() : Opens a link editor window where can you\n      specify a link complement.\n\n    In general, the specification can be from among the below, with\n    information on Dehn fillings added.\n\n    - SnapPea cusped census manifolds: e.g. 'm123', 's123', 'v123'.\n\n    - Link complements:\n\n       + Rolfsen's table: e.g. '4_1', '04_1', '5^2_6', '6_4^7', 'L20935', 'l104001'.\n       + Hoste-Thistlethwaite Knotscape table:  e.g. '11a17' or '12n345'\n       + Callahan-Dean-Weeks-Champanerkar-Kofman-Patterson knots: e.g. 'K6_21'.\n       + Dowker-Thistlethwaite code: e.g. 'DT:[(6,8,2,4)]'\n\n    - Once-punctured torus bundles: e.g. 'b++LLR', '""b+-llR', 'bo-RRL', 'bn+LRLR'\n\n    - Fibered manifold associated to a braid: 'Braid[1,2,-3,4]'\n\n      Here, the braid is thought of as a mapping class of the\n      punctured disc, and this manifold is the corresponding\n      mapping torus.  If you want the braid closure, do (1,0) filling\n      of the last cusp.\n\n    - From mapping class group data using Twister:\n\n      'Bundle(S_{1,1}, [a0, B1])' or 'Splitting(S_{1,0}, [b1, A0], [a0,B1])'\n\n      See the help for the 'twister' module for more.\n\n    - A SnapPea triangulation or link projection file: 'filename'\n\n      The file will be loaded if found in the current directory or the\n      path given by the shell variable ``SNAPPEA_MANIFOLD_DIRECTORY``.\n      See :py:meth:`Manifold.save` for details.\n\n    - A string containing the contents of a SnapPea triangulation or link\n      projection file.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_Triangulation, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_Triangulation, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_Manifold, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8SnapPyHP_8Manifold_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8SnapPyHP_Manifold, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP_AbelianGroup(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8SnapPyHP_AbelianGroup *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_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_8SnapPyHP_AbelianGroup *)o);
  p->divisors = Py_None; Py_INCREF(Py_None);
  p->coefficients = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8SnapPyHP_AbelianGroup(PyObject *o) {
  struct __pyx_obj_8SnapPyHP_AbelianGroup *p = (struct __pyx_obj_8SnapPyHP_AbelianGroup *)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_8SnapPyHP_AbelianGroup) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->divisors);
  Py_CLEAR(p->coefficients);
  #if CYTHON_USE_TYPE_SLOTS
  (*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_8SnapPyHP_AbelianGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP_AbelianGroup *p = (struct __pyx_obj_8SnapPyHP_AbelianGroup *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->divisors) {
    e = (*v)(p->divisors, a); if (e) return e;
  }
  if (p->coefficients) {
    e = (*v)(p->coefficients, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP_AbelianGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP_AbelianGroup *p = (struct __pyx_obj_8SnapPyHP_AbelianGroup *)o;
  tmp = ((PyObject*)p->divisors);
  p->divisors = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->coefficients);
  p->coefficients = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_sq_item_8SnapPyHP_AbelianGroup(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_8SnapPyHP_12AbelianGroup_coefficients(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_1__get__(o);
}

static int __pyx_setprop_8SnapPyHP_12AbelianGroup_coefficients(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_3__set__(o, v);
  }
  else {
    return __pyx_pw_8SnapPyHP_12AbelianGroup_12coefficients_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_8SnapPyHP_AbelianGroup[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_9__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_8__reduce__},
  {"elementary_divisors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_15elementary_divisors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_14elementary_divisors},
  {"rank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_17rank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_16rank},
  {"betti_number", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_19betti_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_18betti_number},
  {"order", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_12AbelianGroup_21order, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_12AbelianGroup_20order},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8SnapPyHP_AbelianGroup[] = {
  {"coefficients", __pyx_getprop_8SnapPyHP_12AbelianGroup_coefficients, __pyx_setprop_8SnapPyHP_12AbelianGroup_coefficients, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_AbelianGroup_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP_AbelianGroup},
  {Py_tp_repr, (void *)__pyx_pw_8SnapPyHP_12AbelianGroup_3__repr__},
  {Py_sq_length, (void *)__pyx_pw_8SnapPyHP_12AbelianGroup_5__len__},
  {Py_sq_item, (void *)__pyx_sq_item_8SnapPyHP_AbelianGroup},
  {Py_mp_length, (void *)__pyx_pw_8SnapPyHP_12AbelianGroup_5__len__},
  {Py_mp_subscript, (void *)__pyx_pw_8SnapPyHP_12AbelianGroup_7__getitem__},
  {Py_tp_call, (void *)__pyx_pw_8SnapPyHP_12AbelianGroup_13__call__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    An AbelianGroup object represents a finitely generated abelian group,\n    usually the first homology group of a snappy Manifold.\n\n    Instantiate an abelian group by its elementary divisors:\n\n    >>> A = AbelianGroup(elementary_divisors=[5,15,0,0])\n    >>> A\n    Z/5 + Z/15 + Z + Z\n    >>> A[0]\n    5\n\n    Alternatively, instantiate an abelian group as AbelianGroup(P) where P is a\n    presentation matrix given as a list of lists of integers.\n    Snappy stores an abelian group as a list of elementary divisors:\n\n    >>> B = AbelianGroup([[1,3,2],[2,0,6]])\n    >>> B\n    Z/2 + Z\n    >>> B.elementary_divisors()\n    [2, 0]\n    >>> B[1]\n    0\n    >>> len(B)\n    2\n    >>> B.rank()\n    2\n    >>> B.betti_number()\n    1\n    >>> B.order()\n    'infinite'\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_AbelianGroup},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_AbelianGroup},
  {Py_tp_richcompare, (void *)__pyx_pw_8SnapPyHP_12AbelianGroup_11__richcmp__},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_AbelianGroup},
  {Py_tp_getset, (void *)__pyx_getsets_8SnapPyHP_AbelianGroup},
  {Py_tp_init, (void *)__pyx_pw_8SnapPyHP_12AbelianGroup_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_AbelianGroup},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_AbelianGroup_spec = {
  "SnapPyHP.AbelianGroup",
  sizeof(struct __pyx_obj_8SnapPyHP_AbelianGroup),
  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_8SnapPyHP_AbelianGroup_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_AbelianGroup = {
  __pyx_pw_8SnapPyHP_12AbelianGroup_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_8SnapPyHP_AbelianGroup, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_AbelianGroup = {
  __pyx_pw_8SnapPyHP_12AbelianGroup_5__len__, /*mp_length*/
  __pyx_pw_8SnapPyHP_12AbelianGroup_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_8SnapPyHP_AbelianGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""AbelianGroup", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_AbelianGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_AbelianGroup, /*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*/
  0, /*tp_as_async*/
  __pyx_pw_8SnapPyHP_12AbelianGroup_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_AbelianGroup, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_AbelianGroup, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_8SnapPyHP_12AbelianGroup_13__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    An AbelianGroup object represents a finitely generated abelian group,\n    usually the first homology group of a snappy Manifold.\n\n    Instantiate an abelian group by its elementary divisors:\n\n    >>> A = AbelianGroup(elementary_divisors=[5,15,0,0])\n    >>> A\n    Z/5 + Z/15 + Z + Z\n    >>> A[0]\n    5\n\n    Alternatively, instantiate an abelian group as AbelianGroup(P) where P is a\n    presentation matrix given as a list of lists of integers.\n    Snappy stores an abelian group as a list of elementary divisors:\n\n    >>> B = AbelianGroup([[1,3,2],[2,0,6]])\n    >>> B\n    Z/2 + Z\n    >>> B.elementary_divisors()\n    [2, 0]\n    >>> B[1]\n    0\n    >>> len(B)\n    2\n    >>> B.rank()\n    2\n    >>> B.betti_number()\n    1\n    >>> B.order()\n    'infinite'\n    "), /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_AbelianGroup, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_AbelianGroup, /*tp_clear*/
  __pyx_pw_8SnapPyHP_12AbelianGroup_11__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_AbelianGroup, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8SnapPyHP_AbelianGroup, /*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_8SnapPyHP_12AbelianGroup_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8SnapPyHP_AbelianGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 struct __pyx_vtabstruct_8SnapPyHP_PresentationMatrix __pyx_vtable_8SnapPyHP_PresentationMatrix;

static PyObject *__pyx_tp_new_8SnapPyHP_PresentationMatrix(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8SnapPyHP_PresentationMatrix *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_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_8SnapPyHP_PresentationMatrix *)o);
  p->__pyx_vtab = __pyx_vtabptr_8SnapPyHP_PresentationMatrix;
  p->_row_support = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_col_support = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_entries = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_units = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->dead_columns = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8SnapPyHP_PresentationMatrix(PyObject *o) {
  struct __pyx_obj_8SnapPyHP_PresentationMatrix *p = (struct __pyx_obj_8SnapPyHP_PresentationMatrix *)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_8SnapPyHP_PresentationMatrix) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_row_support);
  Py_CLEAR(p->_col_support);
  Py_CLEAR(p->_entries);
  Py_CLEAR(p->_units);
  Py_CLEAR(p->dead_columns);
  #if CYTHON_USE_TYPE_SLOTS
  (*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_8SnapPyHP_PresentationMatrix(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP_PresentationMatrix *p = (struct __pyx_obj_8SnapPyHP_PresentationMatrix *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_row_support) {
    e = (*v)(p->_row_support, a); if (e) return e;
  }
  if (p->_col_support) {
    e = (*v)(p->_col_support, a); if (e) return e;
  }
  if (p->_entries) {
    e = (*v)(p->_entries, a); if (e) return e;
  }
  if (p->_units) {
    e = (*v)(p->_units, a); if (e) return e;
  }
  if (p->dead_columns) {
    e = (*v)(p->dead_columns, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP_PresentationMatrix(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP_PresentationMatrix *p = (struct __pyx_obj_8SnapPyHP_PresentationMatrix *)o;
  tmp = ((PyObject*)p->_row_support);
  p->_row_support = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_col_support);
  p->_col_support = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_entries);
  p->_entries = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_units);
  p->_units = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dead_columns);
  p->dead_columns = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_sq_item_8SnapPyHP_PresentationMatrix(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_8SnapPyHP_PresentationMatrix(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_8SnapPyHP_18PresentationMatrix_5__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_8SnapPyHP_PresentationMatrix[] = {
  {"get_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_3get_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_2get_data},
  {"add_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_11add_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"row_op", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_13row_op, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_12row_op},
  {"explode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_15explode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_14explode},
  {"simplify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_17simplify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_16simplify},
  {"simplified_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_19simplified_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_18PresentationMatrix_18simplified_matrix},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_18PresentationMatrix_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_PresentationMatrix_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP_PresentationMatrix},
  {Py_tp_repr, (void *)__pyx_pw_8SnapPyHP_18PresentationMatrix_9__repr__},
  {Py_sq_item, (void *)__pyx_sq_item_8SnapPyHP_PresentationMatrix},
  {Py_mp_subscript, (void *)__pyx_pw_8SnapPyHP_18PresentationMatrix_7__getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_8SnapPyHP_PresentationMatrix},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A sparse representation of the presentation matrix of an abelian group.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_PresentationMatrix},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_PresentationMatrix},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_PresentationMatrix},
  {Py_tp_init, (void *)__pyx_pw_8SnapPyHP_18PresentationMatrix_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_PresentationMatrix},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_PresentationMatrix_spec = {
  "SnapPyHP.PresentationMatrix",
  sizeof(struct __pyx_obj_8SnapPyHP_PresentationMatrix),
  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_8SnapPyHP_PresentationMatrix_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_PresentationMatrix = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_8SnapPyHP_PresentationMatrix, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_PresentationMatrix = {
  0, /*mp_length*/
  __pyx_pw_8SnapPyHP_18PresentationMatrix_7__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_8SnapPyHP_PresentationMatrix, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_8SnapPyHP_PresentationMatrix = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""PresentationMatrix", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_PresentationMatrix), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_PresentationMatrix, /*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*/
  0, /*tp_as_async*/
  __pyx_pw_8SnapPyHP_18PresentationMatrix_9__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_PresentationMatrix, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_PresentationMatrix, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    A sparse representation of the presentation matrix of an abelian group.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_PresentationMatrix, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_PresentationMatrix, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_PresentationMatrix, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8SnapPyHP_18PresentationMatrix_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8SnapPyHP_PresentationMatrix, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP_CFundamentalGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8SnapPyHP_CFundamentalGroup *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_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)o);
  p->num_cusps = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8SnapPyHP_17CFundamentalGroup_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8SnapPyHP_CFundamentalGroup(PyObject *o) {
  struct __pyx_obj_8SnapPyHP_CFundamentalGroup *p = (struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)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_8SnapPyHP_CFundamentalGroup) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_8SnapPyHP_17CFundamentalGroup_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->num_cusps);
  #if CYTHON_USE_TYPE_SLOTS
  (*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_8SnapPyHP_CFundamentalGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP_CFundamentalGroup *p = (struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->num_cusps) {
    e = (*v)(p->num_cusps, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP_CFundamentalGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP_CFundamentalGroup *p = (struct __pyx_obj_8SnapPyHP_CFundamentalGroup *)o;
  tmp = ((PyObject*)p->num_cusps);
  p->num_cusps = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_8SnapPyHP_17CFundamentalGroup_num_cusps(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8SnapPyHP_17CFundamentalGroup_9num_cusps_1__get__(o);
}

static PyMethodDef __pyx_methods_8SnapPyHP_CFundamentalGroup[] = {
  {"num_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_7num_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_6num_generators},
  {"num_relators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_9num_relators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_8num_relators},
  {"num_original_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_11num_original_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_10num_original_generators},
  {"original_generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_13original_generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_12original_generators},
  {"generators_in_originals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_15generators_in_originals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_14generators_in_originals},
  {"_word_moves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_17_word_moves, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"generators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_19generators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_18generators},
  {"relators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_21relators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_20relators},
  {"meridian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_23meridian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_22meridian},
  {"longitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_25longitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_24longitude},
  {"peripheral_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_27peripheral_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_26peripheral_curves},
  {"magma_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_29magma_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_28magma_string},
  {"gap_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_31gap_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_30gap_string},
  {"_gap_init_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_33_gap_init_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_magma_init_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_35_magma_init_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"sage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_37sage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_36sage},
  {"character_variety_vars_and_polys", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_39character_variety_vars_and_polys, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CFundamentalGroup_38character_variety_vars_and_polys},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_41__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CFundamentalGroup_43__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8SnapPyHP_CFundamentalGroup[] = {
  {"num_cusps", __pyx_getprop_8SnapPyHP_17CFundamentalGroup_num_cusps, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_CFundamentalGroup_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP_CFundamentalGroup},
  {Py_tp_repr, (void *)__pyx_pw_8SnapPyHP_17CFundamentalGroup_5__repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_CFundamentalGroup},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_CFundamentalGroup},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_CFundamentalGroup},
  {Py_tp_getset, (void *)__pyx_getsets_8SnapPyHP_CFundamentalGroup},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_CFundamentalGroup},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_CFundamentalGroup_spec = {
  "SnapPyHP.CFundamentalGroup",
  sizeof(struct __pyx_obj_8SnapPyHP_CFundamentalGroup),
  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_8SnapPyHP_CFundamentalGroup_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP_CFundamentalGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""CFundamentalGroup", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_CFundamentalGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_CFundamentalGroup, /*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*/
  0, /*tp_as_async*/
  __pyx_pw_8SnapPyHP_17CFundamentalGroup_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_CFundamentalGroup, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_CFundamentalGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_CFundamentalGroup, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8SnapPyHP_CFundamentalGroup, /*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_8SnapPyHP_CFundamentalGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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_8SnapPyHP_CHolonomyGroup[] = {
  {"_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_1_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup__matrix},
  {"SL2C", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_3SL2C, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup_2SL2C},
  {"O31", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_5O31, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup_4O31},
  {"complex_length", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_7complex_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_14CHolonomyGroup_6complex_length},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_14CHolonomyGroup_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_CHolonomyGroup_slots[] = {
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_CFundamentalGroup},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_CFundamentalGroup},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_CHolonomyGroup},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_CFundamentalGroup},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_CHolonomyGroup_spec = {
  "SnapPyHP.CHolonomyGroup",
  sizeof(struct __pyx_obj_8SnapPyHP_CHolonomyGroup),
  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_8SnapPyHP_CHolonomyGroup_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP_CHolonomyGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""CHolonomyGroup", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_CHolonomyGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_CFundamentalGroup, /*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*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_8SnapPyHP_17CFundamentalGroup_5__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_CFundamentalGroup, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_CFundamentalGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_CHolonomyGroup, /*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_8SnapPyHP_CFundamentalGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 struct __pyx_vtabstruct_8SnapPyHP_SymmetryGroup __pyx_vtable_8SnapPyHP_SymmetryGroup;

static PyObject *__pyx_tp_new_8SnapPyHP_SymmetryGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *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_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_8SnapPyHP_SymmetryGroup *)o);
  p->__pyx_vtab = __pyx_vtabptr_8SnapPyHP_SymmetryGroup;
  p->_is_full_group = Py_None; Py_INCREF(Py_None);
  p->_owns_c_symmetry_group = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8SnapPyHP_13SymmetryGroup_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8SnapPyHP_SymmetryGroup(PyObject *o) {
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *p = (struct __pyx_obj_8SnapPyHP_SymmetryGroup *)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_8SnapPyHP_SymmetryGroup) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_8SnapPyHP_13SymmetryGroup_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_is_full_group);
  Py_CLEAR(p->_owns_c_symmetry_group);
  #if CYTHON_USE_TYPE_SLOTS
  (*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_8SnapPyHP_SymmetryGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *p = (struct __pyx_obj_8SnapPyHP_SymmetryGroup *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_is_full_group) {
    e = (*v)(p->_is_full_group, a); if (e) return e;
  }
  if (p->_owns_c_symmetry_group) {
    e = (*v)(p->_owns_c_symmetry_group, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP_SymmetryGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP_SymmetryGroup *p = (struct __pyx_obj_8SnapPyHP_SymmetryGroup *)o;
  tmp = ((PyObject*)p->_is_full_group);
  p->_is_full_group = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_owns_c_symmetry_group);
  p->_owns_c_symmetry_group = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_8SnapPyHP_13SymmetryGroup__is_full_group(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8SnapPyHP_13SymmetryGroup_14_is_full_group_1__get__(o);
}

static PyObject *__pyx_getprop_8SnapPyHP_13SymmetryGroup__owns_c_symmetry_group(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8SnapPyHP_13SymmetryGroup_22_owns_c_symmetry_group_1__get__(o);
}

static PyMethodDef __pyx_methods_8SnapPyHP_SymmetryGroup[] = {
  {"is_full_group", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_5is_full_group, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_4is_full_group},
  {"order", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_9order, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_8order},
  {"is_abelian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_11is_abelian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_10is_abelian},
  {"abelian_description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_13abelian_description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_12abelian_description},
  {"is_dihedral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_15is_dihedral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_14is_dihedral},
  {"is_polyhedral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_17is_polyhedral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_16is_polyhedral},
  {"polyhedral_description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_19polyhedral_description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_18polyhedral_description},
  {"is_S5", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_21is_S5, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_20is_S5},
  {"is_direct_product", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_23is_direct_product, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_22is_direct_product},
  {"direct_product_description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_25direct_product_description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_24direct_product_description},
  {"is_amphicheiral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_27is_amphicheiral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_26is_amphicheiral},
  {"is_invertible_knot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_29is_invertible_knot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_28is_invertible_knot},
  {"commutator_subgroup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_31commutator_subgroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_30commutator_subgroup},
  {"abelianization", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_33abelianization, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_32abelianization},
  {"center", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_35center, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_34center},
  {"multiply_elements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_37multiply_elements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_36multiply_elements},
  {"isometries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_39isometries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_13SymmetryGroup_38isometries},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_41__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_13SymmetryGroup_43__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8SnapPyHP_SymmetryGroup[] = {
  {"_is_full_group", __pyx_getprop_8SnapPyHP_13SymmetryGroup__is_full_group, 0, 0, 0},
  {"_owns_c_symmetry_group", __pyx_getprop_8SnapPyHP_13SymmetryGroup__owns_c_symmetry_group, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_SymmetryGroup_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP_SymmetryGroup},
  {Py_tp_repr, (void *)__pyx_pw_8SnapPyHP_13SymmetryGroup_7__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A SymmetryGroup is a group of self-isometries of hyperbolic\n    3-manifold.  Instantiate as follows:\n\n    >>> M = Manifold('m004')\n    >>> M.symmetry_group()\n    D4\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_SymmetryGroup},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_SymmetryGroup},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_SymmetryGroup},
  {Py_tp_getset, (void *)__pyx_getsets_8SnapPyHP_SymmetryGroup},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_SymmetryGroup},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_SymmetryGroup_spec = {
  "SnapPyHP.SymmetryGroup",
  sizeof(struct __pyx_obj_8SnapPyHP_SymmetryGroup),
  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_8SnapPyHP_SymmetryGroup_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP_SymmetryGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""SymmetryGroup", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_SymmetryGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_SymmetryGroup, /*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*/
  0, /*tp_as_async*/
  __pyx_pw_8SnapPyHP_13SymmetryGroup_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    A SymmetryGroup is a group of self-isometries of hyperbolic\n    3-manifold.  Instantiate as follows:\n\n    >>> M = Manifold('m004')\n    >>> M.symmetry_group()\n    D4\n    "), /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_SymmetryGroup, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_SymmetryGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_SymmetryGroup, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8SnapPyHP_SymmetryGroup, /*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_8SnapPyHP_SymmetryGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 struct __pyx_vtabstruct_8SnapPyHP_CDirichletDomain __pyx_vtable_8SnapPyHP_CDirichletDomain;

static PyObject *__pyx_tp_new_8SnapPyHP_CDirichletDomain(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8SnapPyHP_CDirichletDomain *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_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)o);
  p->__pyx_vtab = __pyx_vtabptr_8SnapPyHP_CDirichletDomain;
  if (unlikely(__pyx_pw_8SnapPyHP_16CDirichletDomain_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8SnapPyHP_CDirichletDomain(PyObject *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)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8SnapPyHP_CDirichletDomain) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_8SnapPyHP_16CDirichletDomain_5__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  #if CYTHON_USE_TYPE_SLOTS
  (*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 PyMethodDef __pyx_methods_8SnapPyHP_CDirichletDomain[] = {
  {"_number_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_1_number_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"num_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_9num_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_8num_vertices},
  {"num_finite_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_11num_finite_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_10num_finite_vertices},
  {"num_ideal_vertices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_13num_ideal_vertices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_12num_ideal_vertices},
  {"num_edges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_15num_edges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_14num_edges},
  {"num_faces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_17num_faces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_16num_faces},
  {"in_radius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_19in_radius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_18in_radius},
  {"out_radius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_21out_radius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_20out_radius},
  {"spine_radius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_23spine_radius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_22spine_radius},
  {"length_spectrum_dicts", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_25length_spectrum_dicts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_24length_spectrum_dicts},
  {"vertex_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_27vertex_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_26vertex_list},
  {"_vertex_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_29_vertex_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_vertex_data_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_31_vertex_data_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_vertex_to_index_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_33_vertex_to_index_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_32_vertex_to_index_dict},
  {"_edge_to_index_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_35_edge_to_index_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_34_edge_to_index_dict},
  {"face_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_37face_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_36face_list},
  {"edge_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_39edge_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_38edge_list},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_41view, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"manifold", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_43manifold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_42manifold},
  {"triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_45triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_44triangulation},
  {"volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_47volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_46volume},
  {"pairing_matrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_49pairing_matrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_48pairing_matrices},
  {"pairing_words", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_51pairing_words, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_50pairing_words},
  {"_to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_53_to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_ex__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_55__reduce_ex__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_57save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_56save},
  {"export_stl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_16CDirichletDomain_59export_stl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_16CDirichletDomain_58export_stl},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_CDirichletDomain_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP_CDirichletDomain},
  {Py_tp_repr, (void *)__pyx_pw_8SnapPyHP_16CDirichletDomain_7__repr__},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_CDirichletDomain},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_CDirichletDomain},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_CDirichletDomain_spec = {
  "SnapPyHP.CDirichletDomain",
  sizeof(struct __pyx_obj_8SnapPyHP_CDirichletDomain),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_8SnapPyHP_CDirichletDomain_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP_CDirichletDomain = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""CDirichletDomain", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_CDirichletDomain), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_CDirichletDomain, /*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*/
  0, /*tp_as_async*/
  __pyx_pw_8SnapPyHP_16CDirichletDomain_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_CDirichletDomain, /*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_8SnapPyHP_CDirichletDomain, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP_CCuspNeighborhood(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *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_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)o);
  p->original_indices = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8SnapPyHP_17CCuspNeighborhood_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8SnapPyHP_CCuspNeighborhood(PyObject *o) {
  struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *p = (struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)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_8SnapPyHP_CCuspNeighborhood) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_8SnapPyHP_17CCuspNeighborhood_5__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->original_indices);
  #if CYTHON_USE_TYPE_SLOTS
  (*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_8SnapPyHP_CCuspNeighborhood(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *p = (struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->original_indices) {
    e = (*v)(p->original_indices, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP_CCuspNeighborhood(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *p = (struct __pyx_obj_8SnapPyHP_CCuspNeighborhood *)o;
  tmp = ((PyObject*)p->original_indices);
  p->original_indices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8SnapPyHP_CCuspNeighborhood[] = {
  {"_number_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_1_number_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"manifold", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_9manifold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_8manifold},
  {"original_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_11original_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_10original_index},
  {"check_index", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_13check_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_12check_index},
  {"num_cusps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_15num_cusps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_14num_cusps},
  {"topology", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_17topology, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_16topology},
  {"get_displacement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_19get_displacement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_18get_displacement},
  {"set_displacement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_21set_displacement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_20set_displacement},
  {"stopping_displacement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_23stopping_displacement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_22stopping_displacement},
  {"stopper", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_25stopper, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_24stopper},
  {"reach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_27reach, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_26reach},
  {"max_reach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_29max_reach, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_28max_reach},
  {"get_tie", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_31get_tie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_30get_tie},
  {"set_tie", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_33set_tie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_32set_tie},
  {"volume", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_35volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_34volume},
  {"translations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_37translations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_36translations},
  {"horoballs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_39horoballs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_38horoballs},
  {"Ford_domain", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_41Ford_domain, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_40Ford_domain},
  {"triangulation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_43triangulation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_42triangulation},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_45view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8SnapPyHP_17CCuspNeighborhood_44view},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP_CCuspNeighborhood_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP_CCuspNeighborhood},
  {Py_tp_repr, (void *)__pyx_pw_8SnapPyHP_17CCuspNeighborhood_7__repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP_CCuspNeighborhood},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP_CCuspNeighborhood},
  {Py_tp_methods, (void *)__pyx_methods_8SnapPyHP_CCuspNeighborhood},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP_CCuspNeighborhood},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP_CCuspNeighborhood_spec = {
  "SnapPyHP.CCuspNeighborhood",
  sizeof(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood),
  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_8SnapPyHP_CCuspNeighborhood_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP_CCuspNeighborhood = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""CCuspNeighborhood", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP_CCuspNeighborhood), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP_CCuspNeighborhood, /*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*/
  0, /*tp_as_async*/
  __pyx_pw_8SnapPyHP_17CCuspNeighborhood_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP_CCuspNeighborhood, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP_CCuspNeighborhood, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8SnapPyHP_CCuspNeighborhood, /*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_8SnapPyHP_CCuspNeighborhood, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP___pyx_defaults(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
  o = (*t->tp_alloc)(t, 0);
  if (unlikely(!o)) return 0;
  #endif
  return o;
}

static void __pyx_tp_dealloc_8SnapPyHP___pyx_defaults(PyObject *o) {
  struct __pyx_defaults *p = (struct __pyx_defaults *)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_8SnapPyHP___pyx_defaults) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->arg0);
  #if CYTHON_USE_TYPE_SLOTS
  (*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_8SnapPyHP___pyx_defaults(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_defaults *p = (struct __pyx_defaults *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->arg0) {
    e = (*v)(p->arg0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP___pyx_defaults(PyObject *o) {
  PyObject* tmp;
  struct __pyx_defaults *p = (struct __pyx_defaults *)o;
  tmp = ((PyObject*)p->arg0);
  p->arg0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_defaults_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_defaults},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_defaults},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP___pyx_defaults},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_defaults},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_defaults_spec = {
  "SnapPyHP.__pyx_defaults",
  sizeof(struct __pyx_defaults),
  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_8SnapPyHP___pyx_defaults_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_defaults = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_defaults", /*tp_name*/
  sizeof(struct __pyx_defaults), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___pyx_defaults, /*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*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___pyx_defaults, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP___pyx_defaults, /*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_8SnapPyHP___pyx_defaults, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP___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_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct__genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr *p = (struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___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_e);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, 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;
  }
  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_8SnapPyHP___pyx_scope_struct__genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct__genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct__genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct__genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct__genexpr_spec = {
  "SnapPyHP.__pyx_scope_struct__genexpr",
  sizeof(struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct__genexpr_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct__genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___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*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___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_8SnapPyHP___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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #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 PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation(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_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation));
    (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_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *)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_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, 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_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_8SnapPyHP_Triangulation *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation_spec = {
  "SnapPyHP.__pyx_scope_struct_1__unsimplified_filled_triangulation",
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation),
  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_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_1__unsimplified_filled_triangulation", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation, /*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*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation, /*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_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP___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_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___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_c);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_2_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_2_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_2_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr_spec = {
  "SnapPyHP.__pyx_scope_struct_2_genexpr",
  sizeof(struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct_2_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___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*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___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_8SnapPyHP___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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #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 PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_3_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_p);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_3_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_3_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_3_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr_spec = {
  "SnapPyHP.__pyx_scope_struct_3_genexpr",
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8SnapPyHP___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #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 PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_4_list_as_word(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_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_4_list_as_word > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_4_list_as_word[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_4_list_as_word];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word));
    (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_8SnapPyHP___pyx_scope_struct_4_list_as_word(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *)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_8SnapPyHP___pyx_scope_struct_4_list_as_word) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_verbose_form);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_4_list_as_word < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_4_list_as_word[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_4_list_as_word++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_4_list_as_word(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_verbose_form) {
    e = (*v)(p->__pyx_v_verbose_form, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8SnapPyHP___pyx_scope_struct_4_list_as_word(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word *)o;
  tmp = ((PyObject*)p->__pyx_v_verbose_form);
  p->__pyx_v_verbose_form = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_4_list_as_word},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_4_list_as_word},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP___pyx_scope_struct_4_list_as_word},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_4_list_as_word},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word_spec = {
  "SnapPyHP.__pyx_scope_struct_4_list_as_word",
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word),
  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_8SnapPyHP___pyx_scope_struct_4_list_as_word_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_4_list_as_word", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_4_list_as_word), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_4_list_as_word, /*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*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_4_list_as_word, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP___pyx_scope_struct_4_list_as_word, /*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_8SnapPyHP___pyx_scope_struct_4_list_as_word, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_5_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_g);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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_g) {
    e = (*v)(p->__pyx_v_g, 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_8SnapPyHP___pyx_scope_struct_5_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_5_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_5_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_5_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr_spec = {
  "SnapPyHP.__pyx_scope_struct_5_genexpr",
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8SnapPyHP___pyx_scope_struct_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #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 PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_6_face_list(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_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_6_face_list > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_6_face_list[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_6_face_list];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list));
    (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_8SnapPyHP___pyx_scope_struct_6_face_list(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *)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_8SnapPyHP___pyx_scope_struct_6_face_list) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_6_face_list < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_6_face_list[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_6_face_list++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_6_face_list(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, 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_8SnapPyHP___pyx_scope_struct_6_face_list(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_8SnapPyHP_CDirichletDomain *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_6_face_list},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_6_face_list},
  {Py_tp_clear, (void *)__pyx_tp_clear_8SnapPyHP___pyx_scope_struct_6_face_list},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_6_face_list},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list_spec = {
  "SnapPyHP.__pyx_scope_struct_6_face_list",
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list),
  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_8SnapPyHP___pyx_scope_struct_6_face_list_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_6_face_list", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_6_face_list), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_6_face_list, /*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*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_6_face_list, /*tp_traverse*/
  __pyx_tp_clear_8SnapPyHP___pyx_scope_struct_6_face_list, /*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_8SnapPyHP___pyx_scope_struct_6_face_list, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if 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 PyObject *__pyx_tp_new_8SnapPyHP___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_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_7_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_7_genexpr[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct_7_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_7_genexpr[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_7_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_7_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_7_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr_spec = {
  "SnapPyHP.__pyx_scope_struct_7_genexpr",
  sizeof(struct __pyx_obj_8SnapPyHP___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_8SnapPyHP___pyx_scope_struct_7_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___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*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___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_8SnapPyHP___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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #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 PyObject *__pyx_tp_new_8SnapPyHP___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_8_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_8_genexpr[--__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_8_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_x);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_8_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_8SnapPyHP___pyx_scope_struct_8_genexpr[__pyx_mstate_global->__pyx_freecount_8SnapPyHP___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*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_8SnapPyHP___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, 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_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_8_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_8_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_8SnapPyHP___pyx_scope_struct_8_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr_spec = {
  "SnapPyHP.__pyx_scope_struct_8_genexpr",
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPyHP.""__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8SnapPyHP___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8SnapPyHP___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8SnapPyHP___pyx_scope_struct_8_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8SnapPyHP___pyx_scope_struct_8_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #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}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  gLongComputationTicker = Py_None; Py_INCREF(Py_None);
  __pyx_v_8SnapPyHP_IS_HUGE = Py_None; Py_INCREF(Py_None);
  __pyx_v_8SnapPyHP_IS_BIG = Py_None; Py_INCREF(Py_None);
  __pyx_v_8SnapPyHP_IS_COMPLETE = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_8SnapPyHP_Triangulation = &__pyx_vtable_8SnapPyHP_Triangulation;
  __pyx_vtable_8SnapPyHP_Triangulation.get_from_new_plink = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_new_plink *__pyx_optional_args))__pyx_f_8SnapPyHP_13Triangulation_get_from_new_plink;
  __pyx_vtable_8SnapPyHP_Triangulation.get_triangulation = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation *__pyx_optional_args))__pyx_f_8SnapPyHP_13Triangulation_get_triangulation;
  __pyx_vtable_8SnapPyHP_Triangulation.get_triangulation_from_name = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_triangulation_from_name *__pyx_optional_args))__pyx_f_8SnapPyHP_13Triangulation_get_triangulation_from_name;
  __pyx_vtable_8SnapPyHP_Triangulation.get_HT_knot = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_8SnapPyHP_13Triangulation_get_HT_knot;
  __pyx_vtable_8SnapPyHP_Triangulation.get_punctured_torus_bundle = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *))__pyx_f_8SnapPyHP_13Triangulation_get_punctured_torus_bundle;
  __pyx_vtable_8SnapPyHP_Triangulation.get_from_file = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *, struct __pyx_opt_args_8SnapPyHP_13Triangulation_get_from_file *__pyx_optional_args))__pyx_f_8SnapPyHP_13Triangulation_get_from_file;
  __pyx_vtable_8SnapPyHP_Triangulation.set_c_triangulation = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, Triangulation *))__pyx_f_8SnapPyHP_13Triangulation_set_c_triangulation;
  __pyx_vtable_8SnapPyHP_Triangulation.big_homology = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *))__pyx_f_8SnapPyHP_13Triangulation_big_homology;
  __pyx_vtable_8SnapPyHP_Triangulation.c_presentation_matrix = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *))__pyx_f_8SnapPyHP_13Triangulation_c_presentation_matrix;
  __pyx_vtable_8SnapPyHP_Triangulation.csmall_homology = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *))__pyx_f_8SnapPyHP_13Triangulation_csmall_homology;
  __pyx_vtable_8SnapPyHP_Triangulation.build_rep_into_Sn = (RepresentationIntoSn *(*)(struct __pyx_obj_8SnapPyHP_Triangulation *, PyObject *))__pyx_f_8SnapPyHP_13Triangulation_build_rep_into_Sn;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_Triangulation_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation)) __PYX_ERR(4, 4, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_Triangulation_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation = &__pyx_type_8SnapPyHP_Triangulation;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_vtabptr_8SnapPyHP_Triangulation) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Triangulation_2, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_Triangulation) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
  __pyx_vtabptr_8SnapPyHP_Manifold = &__pyx_vtable_8SnapPyHP_Manifold;
  __pyx_vtable_8SnapPyHP_Manifold.__pyx_base = *__pyx_vtabptr_8SnapPyHP_Triangulation;
  __pyx_vtable_8SnapPyHP_Manifold._real_volume = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Manifold *))__pyx_f_8SnapPyHP_8Manifold__real_volume;
  __pyx_vtable_8SnapPyHP_Manifold._cusped_complex_volume = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Manifold *, Complex *, int *))__pyx_f_8SnapPyHP_8Manifold__cusped_complex_volume;
  __pyx_vtable_8SnapPyHP_Manifold._old_chern_simons = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Manifold *))__pyx_f_8SnapPyHP_8Manifold__old_chern_simons;
  __pyx_vtable_8SnapPyHP_Manifold._chern_simons = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_Manifold *))__pyx_f_8SnapPyHP_8Manifold__chern_simons;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_Manifold_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold)) __PYX_ERR(2, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_Manifold_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold = &__pyx_type_8SnapPyHP_Manifold;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold->tp_base = __pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold, __pyx_vtabptr_8SnapPyHP_Manifold) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Manifold, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_Manifold) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_AbelianGroup_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup)) __PYX_ERR(5, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_AbelianGroup_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup) < 0) __PYX_ERR(5, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup = &__pyx_type_8SnapPyHP_AbelianGroup;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup) < 0) __PYX_ERR(5, 3, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_AbelianGroup, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_AbelianGroup) < 0) __PYX_ERR(5, 3, __pyx_L1_error)
  __pyx_vtabptr_8SnapPyHP_PresentationMatrix = &__pyx_vtable_8SnapPyHP_PresentationMatrix;
  __pyx_vtable_8SnapPyHP_PresentationMatrix._set = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_PresentationMatrix *, PyObject *, PyObject *))__pyx_f_8SnapPyHP_18PresentationMatrix__set;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_PresentationMatrix_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix)) __PYX_ERR(5, 142, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_PresentationMatrix_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix) < 0) __PYX_ERR(5, 142, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix = &__pyx_type_8SnapPyHP_PresentationMatrix;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix) < 0) __PYX_ERR(5, 142, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_vtabptr_8SnapPyHP_PresentationMatrix) < 0) __PYX_ERR(5, 142, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix) < 0) __PYX_ERR(5, 142, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PresentationMatrix, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix) < 0) __PYX_ERR(5, 142, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_PresentationMatrix) < 0) __PYX_ERR(5, 142, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_CFundamentalGroup_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup)) __PYX_ERR(8, 103, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_CFundamentalGroup_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup) < 0) __PYX_ERR(8, 103, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup = &__pyx_type_8SnapPyHP_CFundamentalGroup;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup) < 0) __PYX_ERR(8, 103, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup) < 0) __PYX_ERR(8, 103, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_CFundamentalGroup) < 0) __PYX_ERR(8, 103, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_CHolonomyGroup_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup)) __PYX_ERR(8, 485, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_CHolonomyGroup_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup) < 0) __PYX_ERR(8, 485, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup = &__pyx_type_8SnapPyHP_CHolonomyGroup;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8SnapPyHP_CHolonomyGroup->tp_base = __pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup) < 0) __PYX_ERR(8, 485, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CHolonomyGroup, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup) < 0) __PYX_ERR(8, 485, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_CHolonomyGroup) < 0) __PYX_ERR(8, 485, __pyx_L1_error)
  __pyx_vtabptr_8SnapPyHP_SymmetryGroup = &__pyx_vtable_8SnapPyHP_SymmetryGroup;
  __pyx_vtable_8SnapPyHP_SymmetryGroup._set_c_symmetry_group = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_SymmetryGroup *, SymmetryGroup *))__pyx_f_8SnapPyHP_13SymmetryGroup__set_c_symmetry_group;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_SymmetryGroup_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup)) __PYX_ERR(9, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_SymmetryGroup_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup = &__pyx_type_8SnapPyHP_SymmetryGroup;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_vtabptr_8SnapPyHP_SymmetryGroup) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SymmetryGroup, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_SymmetryGroup) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
  __pyx_vtabptr_8SnapPyHP_CDirichletDomain = &__pyx_vtable_8SnapPyHP_CDirichletDomain;
  __pyx_vtable_8SnapPyHP_CDirichletDomain.triangulate = (PyObject *(*)(struct __pyx_obj_8SnapPyHP_CDirichletDomain *, PyObject *))__pyx_f_8SnapPyHP_16CDirichletDomain_triangulate;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_CDirichletDomain_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain)) __PYX_ERR(10, 97, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_CDirichletDomain_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain) < 0) __PYX_ERR(10, 97, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain = &__pyx_type_8SnapPyHP_CDirichletDomain;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain) < 0) __PYX_ERR(10, 97, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_vtabptr_8SnapPyHP_CDirichletDomain) < 0) __PYX_ERR(10, 97, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain) < 0) __PYX_ERR(10, 97, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CDirichletDomain, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_CDirichletDomain) < 0) __PYX_ERR(10, 97, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP_CCuspNeighborhood_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood)) __PYX_ERR(11, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP_CCuspNeighborhood_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood) < 0) __PYX_ERR(11, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood = &__pyx_type_8SnapPyHP_CCuspNeighborhood;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood) < 0) __PYX_ERR(11, 3, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood, (PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood) < 0) __PYX_ERR(11, 3, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_8SnapPyHP_CCuspNeighborhood) < 0) __PYX_ERR(11, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_defaults_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults)) __PYX_ERR(3, 376, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_defaults_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults) < 0) __PYX_ERR(3, 376, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults = &__pyx_type_8SnapPyHP___pyx_defaults;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults) < 0) __PYX_ERR(3, 376, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_defaults->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr)) __PYX_ERR(1, 551, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr = &__pyx_type_8SnapPyHP___pyx_scope_struct__genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation)) __PYX_ERR(4, 1353, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation) < 0) __PYX_ERR(4, 1353, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation = &__pyx_type_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation) < 0) __PYX_ERR(4, 1353, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_1__unsimplified_filled_triangulation->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr)) __PYX_ERR(4, 1393, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(4, 1393, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr = &__pyx_type_8SnapPyHP___pyx_scope_struct_2_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(4, 1393, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr)) __PYX_ERR(4, 2466, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(4, 2466, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr = &__pyx_type_8SnapPyHP___pyx_scope_struct_3_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(4, 2466, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word)) __PYX_ERR(8, 98, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word) < 0) __PYX_ERR(8, 98, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word = &__pyx_type_8SnapPyHP___pyx_scope_struct_4_list_as_word;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word) < 0) __PYX_ERR(8, 98, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_4_list_as_word->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr)) __PYX_ERR(8, 100, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(8, 100, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr = &__pyx_type_8SnapPyHP___pyx_scope_struct_5_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(8, 100, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list)) __PYX_ERR(10, 380, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list) < 0) __PYX_ERR(10, 380, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list = &__pyx_type_8SnapPyHP___pyx_scope_struct_6_face_list;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list) < 0) __PYX_ERR(10, 380, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_6_face_list->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr)) __PYX_ERR(10, 434, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(10, 434, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr = &__pyx_type_8SnapPyHP___pyx_scope_struct_7_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(10, 434, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_7_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr)) __PYX_ERR(10, 636, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr_spec, __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(10, 636, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr = &__pyx_type_8SnapPyHP___pyx_scope_struct_8_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(10, 636, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8SnapPyHP___pyx_scope_struct_8_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_SnapPyHP(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_SnapPyHP},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, Py_MOD_GIL_USED},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "SnapPyHP",
      0, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit_SnapPyHP(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_SnapPyHP(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_SnapPyHP(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *(*__pyx_t_21)(PyObject *);
  PyObject *__pyx_t_22 = 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 'SnapPyHP' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "SnapPyHP" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif

__Pyx_RefNannySetupContext("PyInit_SnapPyHP", 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_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED)
  if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #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
  /*--- Library function declarations ---*/
  if (__pyx_module_is_main_SnapPyHP) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "SnapPyHP")) {
      if (unlikely((PyDict_SetItemString(modules, "SnapPyHP", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/

  /* "cython/numbers/qd.pyx":1
 * from .number import Number as RawNumber             # <<<<<<<<<<<<<<
 * 
 * class Number(RawNumber):
*/
  __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_number, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1, __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_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RawNumber, __pyx_t_2) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/numbers/qd.pyx":3
 * from .number import Number as RawNumber
 * 
 * class Number(RawNumber):             # <<<<<<<<<<<<<<
 *     _default_precision=212
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_RawNumber); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Number, __pyx_mstate_global->__pyx_n_u_Number, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(6, 3, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/numbers/qd.pyx":4
 * 
 * class Number(RawNumber):
 *     _default_precision=212             # <<<<<<<<<<<<<<
 * 
 * from libcpp cimport bool as cpp_bool
*/
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_default_precision, __pyx_mstate_global->__pyx_int_212) < 0) __PYX_ERR(6, 4, __pyx_L1_error)

  /* "cython/numbers/qd.pyx":3
 * from .number import Number as RawNumber
 * 
 * class Number(RawNumber):             # <<<<<<<<<<<<<<
 *     _default_precision=212
 * 
*/
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Number, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Number, __pyx_t_2) < 0) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":2
 * # Python modules
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * import operator
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_os, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_3) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":3
 * # Python modules
 * import os
 * import sys             # <<<<<<<<<<<<<<
 * import operator
 * import types
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":4
 * import os
 * import sys
 * import operator             # <<<<<<<<<<<<<<
 * import types
 * import re
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_operator, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_operator, __pyx_t_3) < 0) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":5
 * import sys
 * import operator
 * import types             # <<<<<<<<<<<<<<
 * import re
 * import gzip
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_types, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_types, __pyx_t_3) < 0) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":6
 * import operator
 * import types
 * import re             # <<<<<<<<<<<<<<
 * import gzip
 * import struct
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_re, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_3) < 0) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":7
 * import types
 * import re
 * import gzip             # <<<<<<<<<<<<<<
 * import struct
 * import tempfile
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_gzip, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gzip, __pyx_t_3) < 0) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":8
 * import re
 * import gzip
 * import struct             # <<<<<<<<<<<<<<
 * import tempfile
 * import tarfile
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_struct, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_struct, __pyx_t_3) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":9
 * import gzip
 * import struct
 * import tempfile             # <<<<<<<<<<<<<<
 * import tarfile
 * import atexit
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_tempfile, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_tempfile, __pyx_t_3) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":10
 * import struct
 * import tempfile
 * import tarfile             # <<<<<<<<<<<<<<
 * import atexit
 * import math
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_tarfile, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_tarfile, __pyx_t_3) < 0) __PYX_ERR(1, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":11
 * import tempfile
 * import tarfile
 * import atexit             # <<<<<<<<<<<<<<
 * import math
 * import string
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_atexit, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_atexit, __pyx_t_3) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":12
 * import tarfile
 * import atexit
 * import math             # <<<<<<<<<<<<<<
 * import string
 * import time
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_math, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_math, __pyx_t_3) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":13
 * import atexit
 * import math
 * import string             # <<<<<<<<<<<<<<
 * import time
 * import typing
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_string, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_string, __pyx_t_3) < 0) __PYX_ERR(1, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":14
 * import math
 * import string
 * import time             # <<<<<<<<<<<<<<
 * import typing
 * python_major_version = sys.version_info.major
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_time, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_time, __pyx_t_3) < 0) __PYX_ERR(1, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":15
 * import string
 * import time
 * import typing             # <<<<<<<<<<<<<<
 * python_major_version = sys.version_info.major
 * 
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_typing, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_typing, __pyx_t_3) < 0) __PYX_ERR(1, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":16
 * import time
 * import typing
 * python_major_version = sys.version_info.major             # <<<<<<<<<<<<<<
 * 
 * # Sage interaction
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_version_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_major); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_python_major_version, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":19
 * 
 * # Sage interaction
 * from .sage_helper import _within_sage, SageNotAvailable             # <<<<<<<<<<<<<<
 * from .pari import pari as pari
 * try:
*/
  __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_within_sage, __pyx_mstate_global->__pyx_n_u_SageNotAvailable); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_helper, __pyx_t_3, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_within_sage, __pyx_t_3) < 0) __PYX_ERR(1, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SageNotAvailable); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SageNotAvailable, __pyx_t_3) < 0) __PYX_ERR(1, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":20
 * # Sage interaction
 * from .sage_helper import _within_sage, SageNotAvailable
 * from .pari import pari as pari             # <<<<<<<<<<<<<<
 * try:
 *     import sage.structure.sage_object
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pari, __pyx_t_4, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pari, __pyx_t_4) < 0) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":21
 * from .sage_helper import _within_sage, SageNotAvailable
 * from .pari import pari as pari
 * try:             # <<<<<<<<<<<<<<
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cython/core/basic.pyx":22
 * from .pari import pari as pari
 * try:
 *     import sage.structure.sage_object             # <<<<<<<<<<<<<<
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
*/
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_structure_sage_object, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sage, __pyx_t_3) < 0) __PYX_ERR(1, 22, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/basic.pyx":23
 * try:
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement             # <<<<<<<<<<<<<<
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
 *     from sage.groups.free_group import FreeGroup
*/
      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_PermutationGroupElement); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_groups_perm_gps_permgroup_e, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 23, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PermutationGroupElement); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PermutationGroupElement, __pyx_t_3) < 0) __PYX_ERR(1, 23, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":24
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
 *     from sage.groups.perm_gps.permgroup import PermutationGroup             # <<<<<<<<<<<<<<
 *     from sage.groups.free_group import FreeGroup
 *     from sage.interfaces.gap import gap
*/
      __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_PermutationGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_groups_perm_gps_permgroup, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PermutationGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PermutationGroup, __pyx_t_4) < 0) __PYX_ERR(1, 24, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/basic.pyx":25
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
 *     from sage.groups.free_group import FreeGroup             # <<<<<<<<<<<<<<
 *     from sage.interfaces.gap import gap
 *     from sage.interfaces.magma import magma
*/
      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_FreeGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_groups_free_group, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FreeGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FreeGroup, __pyx_t_3) < 0) __PYX_ERR(1, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":26
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
 *     from sage.groups.free_group import FreeGroup
 *     from sage.interfaces.gap import gap             # <<<<<<<<<<<<<<
 *     from sage.interfaces.magma import magma
 *     try:
*/
      __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_gap); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_interfaces_gap, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_gap); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gap, __pyx_t_4) < 0) __PYX_ERR(1, 26, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/basic.pyx":27
 *     from sage.groups.free_group import FreeGroup
 *     from sage.interfaces.gap import gap
 *     from sage.interfaces.magma import magma             # <<<<<<<<<<<<<<
 *     try:
 *         from sage.interfaces.abc import GapElement, MagmaElement
*/
      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_magma); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 27, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_interfaces_magma, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 27, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_magma); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 27, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_magma, __pyx_t_3) < 0) __PYX_ERR(1, 27, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":28
 *     from sage.interfaces.gap import gap
 *     from sage.interfaces.magma import magma
 *     try:             # <<<<<<<<<<<<<<
 *         from sage.interfaces.abc import GapElement, MagmaElement
 * 
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "cython/core/basic.pyx":29
 *     from sage.interfaces.magma import magma
 *     try:
 *         from sage.interfaces.abc import GapElement, MagmaElement             # <<<<<<<<<<<<<<
 * 
 *         def is_GapElement(elt):
*/
          __pyx_t_4 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_GapElement, __pyx_mstate_global->__pyx_n_u_MagmaElement); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_interfaces_abc, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_GapElement); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_GapElement, __pyx_t_4) < 0) __PYX_ERR(1, 29, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MagmaElement); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MagmaElement, __pyx_t_4) < 0) __PYX_ERR(1, 29, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "cython/core/basic.pyx":31
 *         from sage.interfaces.abc import GapElement, MagmaElement
 * 
 *         def is_GapElement(elt):             # <<<<<<<<<<<<<<
 *             return isinstance(elt, GapElement)
 * 
*/
          __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_1is_GapElement, 0, __pyx_mstate_global->__pyx_n_u_is_GapElement, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 31, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_GapElement, __pyx_t_3) < 0) __PYX_ERR(1, 31, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "cython/core/basic.pyx":34
 *             return isinstance(elt, GapElement)
 * 
 *         def is_MagmaElement(elt):             # <<<<<<<<<<<<<<
 *             return isinstance(elt, MagmaElement)
 *     except:
*/
          __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_3is_MagmaElement, 0, __pyx_mstate_global->__pyx_n_u_is_MagmaElement, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_MagmaElement, __pyx_t_3) < 0) __PYX_ERR(1, 34, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "cython/core/basic.pyx":28
 *     from sage.interfaces.gap import gap
 *     from sage.interfaces.magma import magma
 *     try:             # <<<<<<<<<<<<<<
 *         from sage.interfaces.abc import GapElement, MagmaElement
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L13_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cython/core/basic.pyx":36
 *         def is_MagmaElement(elt):
 *             return isinstance(elt, MagmaElement)
 *     except:             # <<<<<<<<<<<<<<
 *         from sage.interfaces.gap import is_GapElement
 *         from sage.interfaces.magma import is_MagmaElement
*/
        /*except:*/ {
          __Pyx_AddTraceback("SnapPyHP", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(1, 36, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_5);

          /* "cython/core/basic.pyx":37
 *             return isinstance(elt, MagmaElement)
 *     except:
 *         from sage.interfaces.gap import is_GapElement             # <<<<<<<<<<<<<<
 *         from sage.interfaces.magma import is_MagmaElement
 *     # for testing:
*/
          __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_is_GapElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_interfaces_gap, __pyx_t_2, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 37, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_is_GapElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_GapElement, __pyx_t_2) < 0) __PYX_ERR(1, 37, __pyx_L10_except_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "cython/core/basic.pyx":38
 *     except:
 *         from sage.interfaces.gap import is_GapElement
 *         from sage.interfaces.magma import is_MagmaElement             # <<<<<<<<<<<<<<
 *     # for testing:
 *     from sage.matrix.constructor import matrix as sage_matrix
*/
          __pyx_t_11 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_is_MagmaElement); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 38, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_interfaces_magma, __pyx_t_11, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_MagmaElement); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 38, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_MagmaElement, __pyx_t_11) < 0) __PYX_ERR(1, 38, __pyx_L10_except_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L9_exception_handled;
        }

        /* "cython/core/basic.pyx":28
 *     from sage.interfaces.gap import gap
 *     from sage.interfaces.magma import magma
 *     try:             # <<<<<<<<<<<<<<
 *         from sage.interfaces.abc import GapElement, MagmaElement
 * 
*/
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L2_error;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L13_try_end:;
      }

      /* "cython/core/basic.pyx":40
 *         from sage.interfaces.magma import is_MagmaElement
 *     # for testing:
 *     from sage.matrix.constructor import matrix as sage_matrix             # <<<<<<<<<<<<<<
 * except ImportError:
 *     pass
*/
      __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 40, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_matrix_constructor, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 40, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 40, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sage_matrix, __pyx_t_5) < 0) __PYX_ERR(1, 40, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":21
 * from .sage_helper import _within_sage, SageNotAvailable
 * from .pari import pari as pari
 * try:             # <<<<<<<<<<<<<<
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":41
 *     # for testing:
 *     from sage.matrix.constructor import matrix as sage_matrix
 * except ImportError:             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;

    /* "cython/core/basic.pyx":21
 * from .sage_helper import _within_sage, SageNotAvailable
 * from .pari import pari as pari
 * try:             # <<<<<<<<<<<<<<
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
*/
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    __pyx_L7_try_end:;
  }

  /* "cython/core/basic.pyx":44
 *     pass
 * 
 * from .matrix import matrix             # <<<<<<<<<<<<<<
 * from . import number
 * 
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_matrix, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_matrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_matrix, __pyx_t_4) < 0) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":45
 * 
 * from .matrix import matrix
 * from . import number             # <<<<<<<<<<<<<<
 * 
 * # SnapPy components
*/
  __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_number); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__10, __pyx_t_5, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_number); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_number, __pyx_t_5) < 0) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":48
 * 
 * # SnapPy components
 * import spherogram             # <<<<<<<<<<<<<<
 * from .manifolds import __path__ as manifold_paths
 * from . import database
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_spherogram, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_spherogram, __pyx_t_4) < 0) __PYX_ERR(1, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":49
 * # SnapPy components
 * import spherogram
 * from .manifolds import __path__ as manifold_paths             # <<<<<<<<<<<<<<
 * from . import database
 * from . import twister
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_path_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_manifolds, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_path_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_manifold_paths, __pyx_t_4) < 0) __PYX_ERR(1, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":50
 * import spherogram
 * from .manifolds import __path__ as manifold_paths
 * from . import database             # <<<<<<<<<<<<<<
 * from . import twister
 * from . import snap
*/
  __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__10, __pyx_t_5, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_database, __pyx_t_5) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":51
 * from .manifolds import __path__ as manifold_paths
 * from . import database
 * from . import twister             # <<<<<<<<<<<<<<
 * from . import snap
 * from . import verify
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_twister); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__10, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_twister); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_twister, __pyx_t_4) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":52
 * from . import database
 * from . import twister
 * from . import snap             # <<<<<<<<<<<<<<
 * from . import verify
 * from .verify import complex_volume as verify_complex_volume
*/
  __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_snap); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__10, __pyx_t_5, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_snap); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_snap, __pyx_t_5) < 0) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":53
 * from . import twister
 * from . import snap
 * from . import verify             # <<<<<<<<<<<<<<
 * from .verify import complex_volume as verify_complex_volume
 * from .cusps import compute_cusp_shapes as cusps_compute_cusp_shapes
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_verify); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__10, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_verify); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_verify, __pyx_t_4) < 0) __PYX_ERR(1, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":54
 * from . import snap
 * from . import verify
 * from .verify import complex_volume as verify_complex_volume             # <<<<<<<<<<<<<<
 * from .cusps import compute_cusp_shapes as cusps_compute_cusp_shapes
 * from . import decorated_isosig
*/
  __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_complex_volume); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_verify, __pyx_t_5, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_complex_volume); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_verify_complex_volume, __pyx_t_5) < 0) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":55
 * from . import verify
 * from .verify import complex_volume as verify_complex_volume
 * from .cusps import compute_cusp_shapes as cusps_compute_cusp_shapes             # <<<<<<<<<<<<<<
 * from . import decorated_isosig
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_compute_cusp_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_cusps, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_compute_cusp_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cusps_compute_cusp_shapes, __pyx_t_4) < 0) __PYX_ERR(1, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":56
 * from .verify import complex_volume as verify_complex_volume
 * from .cusps import compute_cusp_shapes as cusps_compute_cusp_shapes
 * from . import decorated_isosig             # <<<<<<<<<<<<<<
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
 * from .export_stl import stl
*/
  __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_decorated_isosig); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__10, __pyx_t_5, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_decorated_isosig); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_decorated_isosig, __pyx_t_5) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":57
 * from .cusps import compute_cusp_shapes as cusps_compute_cusp_shapes
 * from . import decorated_isosig
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods             # <<<<<<<<<<<<<<
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_manifoldMethods); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ptolemy, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_manifoldMethods); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ptolemyManifoldMethods, __pyx_t_4) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":58
 * from . import decorated_isosig
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
 * from .export_stl import stl             # <<<<<<<<<<<<<<
 * from .exceptions import SnapPeaFatalError
 * try:
*/
  __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_stl); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_export_stl, __pyx_t_5, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stl); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_stl, __pyx_t_5) < 0) __PYX_ERR(1, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":59
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError             # <<<<<<<<<<<<<<
 * try:
 *     from plink import LinkEditor, LinkManager
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_SnapPeaFatalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_exceptions, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SnapPeaFatalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SnapPeaFatalError, __pyx_t_4) < 0) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":60
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
 * try:             # <<<<<<<<<<<<<<
 *     from plink import LinkEditor, LinkManager
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "cython/core/basic.pyx":61
 * from .exceptions import SnapPeaFatalError
 * try:
 *     from plink import LinkEditor, LinkManager             # <<<<<<<<<<<<<<
 * except ImportError:
 *     LinkEditor, LinkManager = None, None
*/
      __pyx_t_5 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_LinkEditor, __pyx_mstate_global->__pyx_n_u_LinkManager); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_plink, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 61, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LinkEditor); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LinkEditor, __pyx_t_5) < 0) __PYX_ERR(1, 61, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LinkManager); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LinkManager, __pyx_t_5) < 0) __PYX_ERR(1, 61, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":60
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
 * try:             # <<<<<<<<<<<<<<
 *     from plink import LinkEditor, LinkManager
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L23_try_end;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":62
 * try:
 *     from plink import LinkEditor, LinkManager
 * except ImportError:             # <<<<<<<<<<<<<<
 *     LinkEditor, LinkManager = None, None
 * try:
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("SnapPyHP", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(1, 62, __pyx_L20_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);

      /* "cython/core/basic.pyx":63
 *     from plink import LinkEditor, LinkManager
 * except ImportError:
 *     LinkEditor, LinkManager = None, None             # <<<<<<<<<<<<<<
 * try:
 *     from .gui import ViewerWindow
*/
      __pyx_t_2 = Py_None;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_11 = Py_None;
      __Pyx_INCREF(__pyx_t_11);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LinkEditor, __pyx_t_2) < 0) __PYX_ERR(1, 63, __pyx_L20_except_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LinkManager, __pyx_t_11) < 0) __PYX_ERR(1, 63, __pyx_L20_except_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L19_exception_handled;
    }
    goto __pyx_L20_except_error;

    /* "cython/core/basic.pyx":60
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
 * try:             # <<<<<<<<<<<<<<
 *     from plink import LinkEditor, LinkManager
 * except ImportError:
*/
    __pyx_L20_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L19_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_1);
    __pyx_L23_try_end:;
  }

  /* "cython/core/basic.pyx":64
 * except ImportError:
 *     LinkEditor, LinkManager = None, None
 * try:             # <<<<<<<<<<<<<<
 *     from .gui import ViewerWindow
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cython/core/basic.pyx":65
 *     LinkEditor, LinkManager = None, None
 * try:
 *     from .gui import ViewerWindow             # <<<<<<<<<<<<<<
 * except ImportError:
 *     ViewerWindow = None
*/
      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_ViewerWindow); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 65, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gui, __pyx_t_3, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 65, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ViewerWindow); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 65, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ViewerWindow, __pyx_t_3) < 0) __PYX_ERR(1, 65, __pyx_L26_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":64
 * except ImportError:
 *     LinkEditor, LinkManager = None, None
 * try:             # <<<<<<<<<<<<<<
 *     from .gui import ViewerWindow
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L31_try_end;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":66
 * try:
 *     from .gui import ViewerWindow
 * except ImportError:             # <<<<<<<<<<<<<<
 *     ViewerWindow = None
 * try:
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("SnapPyHP", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(1, 66, __pyx_L28_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "cython/core/basic.pyx":67
 *     from .gui import ViewerWindow
 * except ImportError:
 *     ViewerWindow = None             # <<<<<<<<<<<<<<
 * try:
 *     from .polyviewer import PolyhedronViewer
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ViewerWindow, Py_None) < 0) __PYX_ERR(1, 67, __pyx_L28_except_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L27_exception_handled;
    }
    goto __pyx_L28_except_error;

    /* "cython/core/basic.pyx":64
 * except ImportError:
 *     LinkEditor, LinkManager = None, None
 * try:             # <<<<<<<<<<<<<<
 *     from .gui import ViewerWindow
 * except ImportError:
*/
    __pyx_L28_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L27_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    __pyx_L31_try_end:;
  }

  /* "cython/core/basic.pyx":68
 * except ImportError:
 *     ViewerWindow = None
 * try:             # <<<<<<<<<<<<<<
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "cython/core/basic.pyx":69
 *     ViewerWindow = None
 * try:
 *     from .polyviewer import PolyhedronViewer             # <<<<<<<<<<<<<<
 * except ImportError:
 *     PolyhedronViewer = None
*/
      __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_PolyhedronViewer); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 69, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_polyviewer, __pyx_t_4, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PolyhedronViewer); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 69, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PolyhedronViewer, __pyx_t_4) < 0) __PYX_ERR(1, 69, __pyx_L34_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/basic.pyx":68
 * except ImportError:
 *     ViewerWindow = None
 * try:             # <<<<<<<<<<<<<<
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L39_try_end;
    __pyx_L34_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":70
 * try:
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:             # <<<<<<<<<<<<<<
 *     PolyhedronViewer = None
 * try:
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("SnapPyHP", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(1, 70, __pyx_L36_except_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "cython/core/basic.pyx":71
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
 *     PolyhedronViewer = None             # <<<<<<<<<<<<<<
 * try:
 *     from .horoviewer import HoroballViewer
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PolyhedronViewer, Py_None) < 0) __PYX_ERR(1, 71, __pyx_L36_except_error)
      __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_L35_exception_handled;
    }
    goto __pyx_L36_except_error;

    /* "cython/core/basic.pyx":68
 * except ImportError:
 *     ViewerWindow = None
 * try:             # <<<<<<<<<<<<<<
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
*/
    __pyx_L36_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L35_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_1);
    __pyx_L39_try_end:;
  }

  /* "cython/core/basic.pyx":72
 * except ImportError:
 *     PolyhedronViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .horoviewer import HoroballViewer
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cython/core/basic.pyx":73
 *     PolyhedronViewer = None
 * try:
 *     from .horoviewer import HoroballViewer             # <<<<<<<<<<<<<<
 * except ImportError:
 *     HoroballViewer = None
*/
      __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_HoroballViewer); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 73, __pyx_L42_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_horoviewer, __pyx_t_5, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 73, __pyx_L42_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HoroballViewer); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 73, __pyx_L42_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HoroballViewer, __pyx_t_5) < 0) __PYX_ERR(1, 73, __pyx_L42_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":72
 * except ImportError:
 *     PolyhedronViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .horoviewer import HoroballViewer
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L47_try_end;
    __pyx_L42_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":74
 * try:
 *     from .horoviewer import HoroballViewer
 * except ImportError:             # <<<<<<<<<<<<<<
 *     HoroballViewer = None
 * try:
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("SnapPyHP", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(1, 74, __pyx_L44_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);

      /* "cython/core/basic.pyx":75
 *     from .horoviewer import HoroballViewer
 * except ImportError:
 *     HoroballViewer = None             # <<<<<<<<<<<<<<
 * try:
 *     from .browser import Browser
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HoroballViewer, Py_None) < 0) __PYX_ERR(1, 75, __pyx_L44_except_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L43_exception_handled;
    }
    goto __pyx_L44_except_error;

    /* "cython/core/basic.pyx":72
 * except ImportError:
 *     PolyhedronViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .horoviewer import HoroballViewer
 * except ImportError:
*/
    __pyx_L44_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L43_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    __pyx_L47_try_end:;
  }

  /* "cython/core/basic.pyx":76
 * except ImportError:
 *     HoroballViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .browser import Browser
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "cython/core/basic.pyx":77
 *     HoroballViewer = None
 * try:
 *     from .browser import Browser             # <<<<<<<<<<<<<<
 * except ImportError:
 *     Browser = None
*/
      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Browser); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 77, __pyx_L50_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_browser, __pyx_t_3, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 77, __pyx_L50_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Browser); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 77, __pyx_L50_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Browser, __pyx_t_3) < 0) __PYX_ERR(1, 77, __pyx_L50_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":76
 * except ImportError:
 *     HoroballViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .browser import Browser
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L55_try_end;
    __pyx_L50_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":78
 * try:
 *     from .browser import Browser
 * except ImportError:             # <<<<<<<<<<<<<<
 *     Browser = None
 * try:
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("SnapPyHP", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(1, 78, __pyx_L52_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "cython/core/basic.pyx":79
 *     from .browser import Browser
 * except ImportError:
 *     Browser = None             # <<<<<<<<<<<<<<
 * try:
 *     from .filedialog import asksaveasfile
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Browser, Py_None) < 0) __PYX_ERR(1, 79, __pyx_L52_except_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L51_exception_handled;
    }
    goto __pyx_L52_except_error;

    /* "cython/core/basic.pyx":76
 * except ImportError:
 *     HoroballViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .browser import Browser
 * except ImportError:
*/
    __pyx_L52_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L51_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_1);
    __pyx_L55_try_end:;
  }

  /* "cython/core/basic.pyx":80
 * except ImportError:
 *     Browser = None
 * try:             # <<<<<<<<<<<<<<
 *     from .filedialog import asksaveasfile
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cython/core/basic.pyx":81
 *     Browser = None
 * try:
 *     from .filedialog import asksaveasfile             # <<<<<<<<<<<<<<
 * except ImportError:
 *     asksaveasfile = None
*/
      __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_asksaveasfile); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 81, __pyx_L58_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_filedialog, __pyx_t_4, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L58_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asksaveasfile); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 81, __pyx_L58_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asksaveasfile, __pyx_t_4) < 0) __PYX_ERR(1, 81, __pyx_L58_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/basic.pyx":80
 * except ImportError:
 *     Browser = None
 * try:             # <<<<<<<<<<<<<<
 *     from .filedialog import asksaveasfile
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L63_try_end;
    __pyx_L58_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":82
 * try:
 *     from .filedialog import asksaveasfile
 * except ImportError:             # <<<<<<<<<<<<<<
 *     asksaveasfile = None
 * 
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("SnapPyHP", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(1, 82, __pyx_L60_except_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "cython/core/basic.pyx":83
 *     from .filedialog import asksaveasfile
 * except ImportError:
 *     asksaveasfile = None             # <<<<<<<<<<<<<<
 * 
 * def valid_index(i, n, format_str):
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asksaveasfile, Py_None) < 0) __PYX_ERR(1, 83, __pyx_L60_except_error)
      __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_L59_exception_handled;
    }
    goto __pyx_L60_except_error;

    /* "cython/core/basic.pyx":80
 * except ImportError:
 *     Browser = None
 * try:             # <<<<<<<<<<<<<<
 *     from .filedialog import asksaveasfile
 * except ImportError:
*/
    __pyx_L60_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L59_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7);
    __pyx_L63_try_end:;
  }

  /* "cython/core/basic.pyx":85
 *     asksaveasfile = None
 * 
 * def valid_index(i, n, format_str):             # <<<<<<<<<<<<<<
 *     """
 *     Return range(n)[i] or raises a nicely formatted IndexError
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_5valid_index, 0, __pyx_mstate_global->__pyx_n_u_valid_index, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_valid_index, __pyx_t_5) < 0) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":108
 * 
 * # A stream for asynchronous messages
 * class MsgIO():             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         if sys.stdout is None:
*/
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_MsgIO, __pyx_mstate_global->__pyx_n_u_MsgIO, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "cython/core/basic.pyx":109
 * # A stream for asynchronous messages
 * class MsgIO():
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         if sys.stdout is None:
 *             self.write = None
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_5MsgIO_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MsgIO___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(1, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":108
 * 
 * # A stream for asynchronous messages
 * class MsgIO():             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         if sys.stdout is None:
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_MsgIO, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MsgIO, __pyx_t_4) < 0) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":118
 * 
 * 
 * msg_stream = MsgIO()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MsgIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_msg_stream, __pyx_t_5) < 0) __PYX_ERR(1, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":121
 * 
 * 
 * def to_str(s):             # <<<<<<<<<<<<<<
 *     return s.decode()
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_7to_str, 0, __pyx_mstate_global->__pyx_n_u_to_str, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_to_str, __pyx_t_5) < 0) __PYX_ERR(1, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":125
 * 
 * 
 * def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *     return bytes(x)
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_9bytearray_to_bytes, 0, __pyx_mstate_global->__pyx_n_u_bytearray_to_bytes, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_bytearray_to_bytes, __pyx_t_5) < 0) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":129
 * 
 * 
 * def to_byte_str(s):             # <<<<<<<<<<<<<<
 *     return s.encode('utf-8') if type(s) != bytes else s
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_11to_byte_str, 0, __pyx_mstate_global->__pyx_n_u_to_byte_str, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_to_byte_str, __pyx_t_5) < 0) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":134
 * 
 * # Types of covering spaces
 * cover_types = {1: "irregular", 2: "regular", 3: "cyclic"}             # <<<<<<<<<<<<<<
 * 
 * # Paths
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_n_u_irregular) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_n_u_regular) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_n_u_cyclic) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cover_types, __pyx_t_5) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":137
 * 
 * # Paths
 * manifold_path = manifold_paths[0] + os.sep             # <<<<<<<<<<<<<<
 * 
 * # Obsolete data
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_manifold_paths); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sep); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __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 (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_manifold_path, __pyx_t_5) < 0) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":140
 * 
 * # Obsolete data
 * closed_census_directory = os.path.join(manifold_path, 'ClosedCensusData')             # <<<<<<<<<<<<<<
 * link_directory = os.path.join(manifold_path, 'ChristyLinks')
 * link_archive = os.path.join(manifold_path, 'ChristyLinks.tgz')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_t_11;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ClosedCensusData};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_closed_census_directory, __pyx_t_5) < 0) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":141
 * # Obsolete data
 * closed_census_directory = os.path.join(manifold_path, 'ClosedCensusData')
 * link_directory = os.path.join(manifold_path, 'ChristyLinks')             # <<<<<<<<<<<<<<
 * link_archive = os.path.join(manifold_path, 'ChristyLinks.tgz')
 * census_knot_archive = os.path.join(manifold_path, 'CensusKnots.tgz')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ChristyLinks};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_link_directory, __pyx_t_5) < 0) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":142
 * closed_census_directory = os.path.join(manifold_path, 'ClosedCensusData')
 * link_directory = os.path.join(manifold_path, 'ChristyLinks')
 * link_archive = os.path.join(manifold_path, 'ChristyLinks.tgz')             # <<<<<<<<<<<<<<
 * census_knot_archive = os.path.join(manifold_path, 'CensusKnots.tgz')
 * # Still in use
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_t_11;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_kp_u_ChristyLinks_tgz};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_link_archive, __pyx_t_5) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":143
 * link_directory = os.path.join(manifold_path, 'ChristyLinks')
 * link_archive = os.path.join(manifold_path, 'ChristyLinks.tgz')
 * census_knot_archive = os.path.join(manifold_path, 'CensusKnots.tgz')             # <<<<<<<<<<<<<<
 * # Still in use
 * table_directory = os.path.join(manifold_path, 'HTWKnots')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_3, __pyx_mstate_global->__pyx_kp_u_CensusKnots_tgz};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_census_knot_archive, __pyx_t_5) < 0) __PYX_ERR(1, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":145
 * census_knot_archive = os.path.join(manifold_path, 'CensusKnots.tgz')
 * # Still in use
 * table_directory = os.path.join(manifold_path, 'HTWKnots')             # <<<<<<<<<<<<<<
 * morwen_link_directory = os.path.join(manifold_path, 'MTLinks')
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_t_11;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_HTWKnots};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_table_directory, __pyx_t_5) < 0) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":146
 * # Still in use
 * table_directory = os.path.join(manifold_path, 'HTWKnots')
 * morwen_link_directory = os.path.join(manifold_path, 'MTLinks')             # <<<<<<<<<<<<<<
 * 
 * # These are the gzipped files holding the knot tables.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MTLinks};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_morwen_link_directory, __pyx_t_5) < 0) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":149
 * 
 * # These are the gzipped files holding the knot tables.
 * Alternating_table = gzip.open(os.path.join(table_directory, 'alternating.gz') )             # <<<<<<<<<<<<<<
 * Nonalternating_table = gzip.open(os.path.join(table_directory, 'nonalternating.gz') )
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_gzip); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_2 = __pyx_t_15;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_table_directory); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_14, __pyx_mstate_global->__pyx_kp_u_alternating_gz};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Alternating_table, __pyx_t_5) < 0) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":150
 * # These are the gzipped files holding the knot tables.
 * Alternating_table = gzip.open(os.path.join(table_directory, 'alternating.gz') )
 * Nonalternating_table = gzip.open(os.path.join(table_directory, 'nonalternating.gz') )             # <<<<<<<<<<<<<<
 * 
 * # This flag can be used when testing algorithms in extension
*/
  __pyx_t_11 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_gzip); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_15 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_15);
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_table_directory); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_14, __pyx_mstate_global->__pyx_kp_u_nonalternating_gz};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_3};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Nonalternating_table, __pyx_t_5) < 0) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":156
 * # extern int SnapPy_test_flag
 * 
 * cdef public int SnapPy_test_flag = 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  SnapPy_test_flag = 0;

  /* "cython/core/basic.pyx":159
 * 
 * 
 * def set_test_flag(int value):             # <<<<<<<<<<<<<<
 *     cdef int old
 *     global SnapPy_test_flag
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13set_test_flag, 0, __pyx_mstate_global->__pyx_n_u_set_test_flag, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_set_test_flag, __pyx_t_5) < 0) __PYX_ERR(1, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":183
 * # If not None, this will be called in gLongComputationContinues.
 * # This enables a GUI to do updates during long computations.
 * UI_callback = None             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_UI_callback, Py_None) < 0) __PYX_ERR(1, 183, __pyx_L1_error)

  /* "cython/core/basic.pyx":186
 * 
 * 
 * def SnapPea_interrupt():             # <<<<<<<<<<<<<<
 *     """
 *     The UI can call this to stop SnapPea.  Returns True if SnapPea s busy.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_15SnapPea_interrupt, 0, __pyx_mstate_global->__pyx_n_u_SnapPea_interrupt, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SnapPea_interrupt, __pyx_t_5) < 0) __PYX_ERR(1, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":232
 * 
 * 
 * show_uAcknowledge = False             # <<<<<<<<<<<<<<
 * 
 * cdef public void uAcknowledge(const_char_ptr message):
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_show_uAcknowledge, Py_False) < 0) __PYX_ERR(1, 232, __pyx_L1_error)

  /* "cython/core/basic.pyx":256
 * 
 * 
 * def cy_eval(s):             # <<<<<<<<<<<<<<
 *     return eval(s)
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17cy_eval, 0, __pyx_mstate_global->__pyx_n_u_cy_eval, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cy_eval, __pyx_t_5) < 0) __PYX_ERR(1, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":260
 * 
 * 
 * def smith_form(M):             # <<<<<<<<<<<<<<
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_19smith_form, 0, __pyx_mstate_global->__pyx_n_u_smith_form, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_smith_form, __pyx_t_5) < 0) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":289
 * 
 * # Enum conversions
 * CuspTopology = ['torus cusp', 'Klein bottle cusp', 'unknown']             # <<<<<<<<<<<<<<
 * MatrixParity = ['orientation-reversing', 'orientation-preserving']
 * Orientability = ['orientable', 'nonorientable', 'unknown']
*/
  __pyx_t_5 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_kp_u_torus_cusp, __pyx_mstate_global->__pyx_kp_u_Klein_bottle_cusp, __pyx_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CuspTopology, __pyx_t_5) < 0) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":290
 * # Enum conversions
 * CuspTopology = ['torus cusp', 'Klein bottle cusp', 'unknown']
 * MatrixParity = ['orientation-reversing', 'orientation-preserving']             # <<<<<<<<<<<<<<
 * Orientability = ['orientable', 'nonorientable', 'unknown']
 * Orbifold1 = ['unknown', 'circle', 'mirrored arc']
*/
  __pyx_t_5 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_orientation_reversing, __pyx_mstate_global->__pyx_kp_u_orientation_preserving); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatrixParity, __pyx_t_5) < 0) __PYX_ERR(1, 290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":291
 * CuspTopology = ['torus cusp', 'Klein bottle cusp', 'unknown']
 * MatrixParity = ['orientation-reversing', 'orientation-preserving']
 * Orientability = ['orientable', 'nonorientable', 'unknown']             # <<<<<<<<<<<<<<
 * Orbifold1 = ['unknown', 'circle', 'mirrored arc']
 * FuncResult = ['func_OK', 'func_cancelled', 'func_failed', 'func_bad_input']
*/
  __pyx_t_5 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_orientable, __pyx_mstate_global->__pyx_n_u_nonorientable, __pyx_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Orientability, __pyx_t_5) < 0) __PYX_ERR(1, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":292
 * MatrixParity = ['orientation-reversing', 'orientation-preserving']
 * Orientability = ['orientable', 'nonorientable', 'unknown']
 * Orbifold1 = ['unknown', 'circle', 'mirrored arc']             # <<<<<<<<<<<<<<
 * FuncResult = ['func_OK', 'func_cancelled', 'func_failed', 'func_bad_input']
 * SolutionType = [
*/
  __pyx_t_5 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_unknown, __pyx_mstate_global->__pyx_n_u_circle, __pyx_mstate_global->__pyx_kp_u_mirrored_arc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Orbifold1, __pyx_t_5) < 0) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":293
 * Orientability = ['orientable', 'nonorientable', 'unknown']
 * Orbifold1 = ['unknown', 'circle', 'mirrored arc']
 * FuncResult = ['func_OK', 'func_cancelled', 'func_failed', 'func_bad_input']             # <<<<<<<<<<<<<<
 * SolutionType = [
 *     'not attempted',
*/
  __pyx_t_5 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_n_u_func_OK, __pyx_mstate_global->__pyx_n_u_func_cancelled, __pyx_mstate_global->__pyx_n_u_func_failed, __pyx_mstate_global->__pyx_n_u_func_bad_input); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FuncResult, __pyx_t_5) < 0) __PYX_ERR(1, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":294
 * Orbifold1 = ['unknown', 'circle', 'mirrored arc']
 * FuncResult = ['func_OK', 'func_cancelled', 'func_failed', 'func_bad_input']
 * SolutionType = [             # <<<<<<<<<<<<<<
 *     'not attempted',
 *     'all tetrahedra positively oriented',
*/
  __pyx_t_5 = __Pyx_PyList_Pack(8, __pyx_mstate_global->__pyx_kp_u_not_attempted, __pyx_mstate_global->__pyx_kp_u_all_tetrahedra_positively_orient, __pyx_mstate_global->__pyx_kp_u_contains_negatively_oriented_tet, __pyx_mstate_global->__pyx_kp_u_contains_flat_tetrahedra, __pyx_mstate_global->__pyx_kp_u_contains_degenerate_tetrahedra, __pyx_mstate_global->__pyx_kp_u_unrecognized_solution_type, __pyx_mstate_global->__pyx_kp_u_no_solution_found, __pyx_mstate_global->__pyx_kp_u_tetrahedra_shapes_were_inserted); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SolutionType, __pyx_t_5) < 0) __PYX_ERR(1, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":306
 * 
 * # SnapPea memory usage
 * def check_SnapPea_memory():             # <<<<<<<<<<<<<<
 *     verify_my_malloc_usage()
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_21check_SnapPea_memory, 0, __pyx_mstate_global->__pyx_n_u_check_SnapPea_memory, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_check_SnapPea_memory, __pyx_t_5) < 0) __PYX_ERR(1, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":310
 * 
 * 
 * def set_rand_seed(seed):             # <<<<<<<<<<<<<<
 *     """
 *     Set seed of the random number generator used for choosing
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_23set_rand_seed, 0, __pyx_mstate_global->__pyx_n_u_set_rand_seed, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_set_rand_seed, __pyx_t_5) < 0) __PYX_ERR(1, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":365
 * 
 * 
 * class MatrixWithExplanations():             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
*/
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "cython/core/basic.pyx":367
 * class MatrixWithExplanations():
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 * 
 *         self.matrix = mat
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_22MatrixWithExplanations_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(1, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":373
 *         self.explain_columns = explain_columns
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_22MatrixWithExplanations_3__repr__, 0, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations___repr_2, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[33]);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_4) < 0) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":365
 * 
 * 
 * class MatrixWithExplanations():             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations, __pyx_t_4) < 0) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":394
 * 
 * 
 * class NeumannZagierTypeEquations(MatrixWithExplanations):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MatrixWithExplanations); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_5 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(1, 394, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":396
 * class NeumannZagierTypeEquations(MatrixWithExplanations):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 *         MatrixWithExplanations.__init__(self,
 *                                         mat, explain_rows, explain_columns)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_26NeumannZagierTypeEquations_1__init__, 0, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations___ini, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":400
 *                                         mat, explain_rows, explain_columns)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return MatrixWithExplanations.__repr__(self,
 *                                                "NeumannZagierTypeEquations")
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_26NeumannZagierTypeEquations_3__repr__, 0, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations___rep, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_4) < 0) __PYX_ERR(1, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":394
 * 
 * 
 * class NeumannZagierTypeEquations(MatrixWithExplanations):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations, __pyx_t_5, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NeumannZagierTypeEquations, __pyx_t_4) < 0) __PYX_ERR(1, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":410
 * cdef func_real_to_obj Real2gen
 * 
 * if hasattr(pari, '_real_coerced_to_bits_prec'):  # Cypari             # <<<<<<<<<<<<<<
 *     Real2gen = Real2gen_direct
 * else:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pari); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_16 = __Pyx_HasAttr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_real_coerced_to_bits_prec); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(1, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_16) {

    /* "cython/core/basic.pyx":411
 * 
 * if hasattr(pari, '_real_coerced_to_bits_prec'):  # Cypari
 *     Real2gen = Real2gen_direct             # <<<<<<<<<<<<<<
 * else:
 *     Real2gen = Real2gen_string
*/
    __pyx_v_8SnapPyHP_Real2gen = __pyx_f_8SnapPyHP_Real2gen_direct;

    /* "cython/core/basic.pyx":410
 * cdef func_real_to_obj Real2gen
 * 
 * if hasattr(pari, '_real_coerced_to_bits_prec'):  # Cypari             # <<<<<<<<<<<<<<
 *     Real2gen = Real2gen_direct
 * else:
*/
    goto __pyx_L66;
  }

  /* "cython/core/basic.pyx":413
 *     Real2gen = Real2gen_direct
 * else:
 *     Real2gen = Real2gen_string             # <<<<<<<<<<<<<<
 * 
 * cdef Complex2gen(Complex C):
*/
  /*else*/ {
    __pyx_v_8SnapPyHP_Real2gen = __pyx_f_8SnapPyHP_Real2gen_string;
  }
  __pyx_L66:;

  /* "cython/core/basic.pyx":497
 * 
 * 
 * class Info(dict):             # <<<<<<<<<<<<<<
 *     """
 *     Immutable dictionary whose data can be accessed either as
*/
  __pyx_t_5 = PyTuple_Pack(1, ((PyObject *)(&PyDict_Type))); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Info, __pyx_mstate_global->__pyx_n_u_Info, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Immutable_dictionary_whose_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(1, 497, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":503
 *     Initialize with keyword arguments, or **dict.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_4Info_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Info___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(1, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":514
 *         self.__dict__.update(kwargs)
 * 
 *     def _immutable(self, *args):             # <<<<<<<<<<<<<<
 *         raise AttributeError('Info objects are immutable.')
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_4Info_3_immutable, 0, __pyx_mstate_global->__pyx_n_u_Info__immutable, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_immutable, __pyx_t_5) < 0) __PYX_ERR(1, 514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":517
 *         raise AttributeError('Info objects are immutable.')
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return self.__dict__.keys()
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_4Info_5keys, 0, __pyx_mstate_global->__pyx_n_u_Info_keys, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_keys, __pyx_t_5) < 0) __PYX_ERR(1, 517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":520
 *         return self.__dict__.keys()
 * 
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable             # <<<<<<<<<<<<<<
 *     pop = popitem = clear = update = _immutable
 *     _obsolete = {}
*/
  __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_immutable);
  if (unlikely(!__pyx_t_5)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_immutable);
  }
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_setattr, __pyx_t_5) < 0) __PYX_ERR(1, 520, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_delattr, __pyx_t_5) < 0) __PYX_ERR(1, 520, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_setitem, __pyx_t_5) < 0) __PYX_ERR(1, 520, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_delitem, __pyx_t_5) < 0) __PYX_ERR(1, 520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":521
 * 
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 *     pop = popitem = clear = update = _immutable             # <<<<<<<<<<<<<<
 *     _obsolete = {}
 * 
*/
  __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_immutable);
  if (unlikely(!__pyx_t_5)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_immutable);
  }
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pop, __pyx_t_5) < 0) __PYX_ERR(1, 521, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_popitem, __pyx_t_5) < 0) __PYX_ERR(1, 521, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_clear, __pyx_t_5) < 0) __PYX_ERR(1, 521, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_update, __pyx_t_5) < 0) __PYX_ERR(1, 521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":522
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 *     pop = popitem = clear = update = _immutable
 *     _obsolete = {}             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_obsolete, __pyx_t_5) < 0) __PYX_ERR(1, 522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":497
 * 
 * 
 * class Info(dict):             # <<<<<<<<<<<<<<
 *     """
 *     Immutable dictionary whose data can be accessed either as
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Info, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Info, __pyx_t_5) < 0) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":525
 * 
 * 
 * class CuspInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if self.is_complete:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_CuspInfo, __pyx_mstate_global->__pyx_n_u_CuspInfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(1, 525, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":526
 * 
 * class CuspInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_complete:
 *             if 'shape' in self:
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8CuspInfo_1__repr__, 0, __pyx_mstate_global->__pyx_n_u_CuspInfo___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_11) < 0) __PYX_ERR(1, 526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":537
 *             return ('Cusp %-2d: %s with Dehn filling coefficients (M, L) = %s'%
 *                     (self.index, self.topology, self.filling) )
 *     _obsolete = {'complete?'          : 'is_complete',             # <<<<<<<<<<<<<<
 *                  'holonomy precision' : 'holonomy_accuracy',
 *                  'shape precision'    : 'shape_accuracy'}
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_complete_3, __pyx_mstate_global->__pyx_n_u_is_complete) < 0) __PYX_ERR(1, 537, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_holonomy_precision, __pyx_mstate_global->__pyx_n_u_holonomy_accuracy) < 0) __PYX_ERR(1, 537, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_shape_precision, __pyx_mstate_global->__pyx_n_u_shape_accuracy) < 0) __PYX_ERR(1, 537, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_obsolete, __pyx_t_11) < 0) __PYX_ERR(1, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":525
 * 
 * 
 * class CuspInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if self.is_complete:
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CuspInfo, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CuspInfo, __pyx_t_11) < 0) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":542
 * 
 * 
 * class DualCurveInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return ('%3d: %s curve of length %s'%
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_DualCurveInfo, __pyx_mstate_global->__pyx_n_u_DualCurveInfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_3 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(1, 542, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":543
 * 
 * class DualCurveInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('%3d: %s curve of length %s'%
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13DualCurveInfo_1__repr__, 0, __pyx_mstate_global->__pyx_n_u_DualCurveInfo___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_4) < 0) __PYX_ERR(1, 543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":546
 *         return ('%3d: %s curve of length %s'%
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
 *     _obsolete = {'complete length' : 'complete_length',             # <<<<<<<<<<<<<<
 *                  'filled length' : 'filled_length'}
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_complete_length_2, __pyx_mstate_global->__pyx_n_u_complete_length) < 0) __PYX_ERR(1, 546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_filled_length_2, __pyx_mstate_global->__pyx_n_u_filled_length) < 0) __PYX_ERR(1, 546, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_obsolete, __pyx_t_4) < 0) __PYX_ERR(1, 546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":542
 * 
 * 
 * class DualCurveInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return ('%3d: %s curve of length %s'%
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DualCurveInfo, __pyx_t_3, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DualCurveInfo, __pyx_t_4) < 0) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":550
 * 
 * 
 * def _StrLongestLen(l):             # <<<<<<<<<<<<<<
 *     return str(max(len(e) for e in l))
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_25_StrLongestLen, 0, __pyx_mstate_global->__pyx_n_u_StrLongestLen, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_StrLongestLen, __pyx_t_3) < 0) __PYX_ERR(1, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":557
 *     '%-4s '                                   # Multiplicity
 *     '%-40s '                                  # Length
 *     '%-' + _StrLongestLen(Orbifold1) + 's ')  # Topology             # <<<<<<<<<<<<<<
 * 
 * LengthSpectrumFormatString = (
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_StrLongestLen); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Orbifold1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_4s_40s, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_s_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatStringBase, __pyx_t_3) < 0) __PYX_ERR(1, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":560
 * 
 * LengthSpectrumFormatString = (
 *     LengthSpectrumFormatStringBase +             # <<<<<<<<<<<<<<
 *     '%s')                                     # Parity
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatStringBase); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyNumber_Add(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_s_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatString, __pyx_t_11) < 0) __PYX_ERR(1, 559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":564
 * 
 * LengthSpectrumFormatStringWithWord = (
 *     LengthSpectrumFormatStringBase +             # <<<<<<<<<<<<<<
 *     '%-6s '                                   # Parity
 *     '%s')                                     # Word
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatStringBase); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_6s_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LengthSpectrumFormatStringWithWo, __pyx_t_3) < 0) __PYX_ERR(1, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":568
 *     '%s')                                     # Word
 * 
 * ShortMatrixParity = { MatrixParity[0] : '-', MatrixParity[1] : '+' }             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MatrixParity); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u__22) < 0) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MatrixParity); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_11, __pyx_mstate_global->__pyx_kp_u__23) < 0) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ShortMatrixParity, __pyx_t_3) < 0) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":571
 * 
 * 
 * class LengthSpectrumInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         lenStr = "%17.14f" % self.length.real()
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_LengthSpectrumInfo, __pyx_mstate_global->__pyx_n_u_LengthSpectrumInfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(1, 571, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":572
 * 
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         lenStr = "%17.14f" % self.length.real()
 *         absImag = abs(self.length.imag())
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18LengthSpectrumInfo_1__repr__, 0, __pyx_mstate_global->__pyx_n_u_LengthSpectrumInfo___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_11) < 0) __PYX_ERR(1, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":571
 * 
 * 
 * class LengthSpectrumInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         lenStr = "%17.14f" % self.length.real()
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LengthSpectrumInfo, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LengthSpectrumInfo, __pyx_t_11) < 0) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":597
 * 
 * 
 * class ShapeInfo(Info):             # <<<<<<<<<<<<<<
 *     _obsolete = {'precision' : 'accuracies'}
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ShapeInfo, __pyx_mstate_global->__pyx_n_u_ShapeInfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_3 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(1, 597, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":598
 * 
 * class ShapeInfo(Info):
 *     _obsolete = {'precision' : 'accuracies'}             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_precision_2, __pyx_mstate_global->__pyx_n_u_accuracies) < 0) __PYX_ERR(1, 598, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_obsolete, __pyx_t_4) < 0) __PYX_ERR(1, 598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":600
 *     _obsolete = {'precision' : 'accuracies'}
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.__dict__)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_9ShapeInfo_1__repr__, 0, __pyx_mstate_global->__pyx_n_u_ShapeInfo___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_4) < 0) __PYX_ERR(1, 600, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":597
 * 
 * 
 * class ShapeInfo(Info):             # <<<<<<<<<<<<<<
 *     _obsolete = {'precision' : 'accuracies'}
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ShapeInfo, __pyx_t_3, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ShapeInfo, __pyx_t_4) < 0) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":604
 * 
 * 
 * class NormalSurfaceInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_NormalSurfaceInfo, __pyx_mstate_global->__pyx_n_u_NormalSurfaceInfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(1, 604, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":605
 * 
 * class NormalSurfaceInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
 *         sided = 'two-sided' if self.two_sided else 'one-sided'
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17NormalSurfaceInfo_1__repr__, 0, __pyx_mstate_global->__pyx_n_u_NormalSurfaceInfo___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_5) < 0) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":604
 * 
 * 
 * class NormalSurfaceInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NormalSurfaceInfo, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NormalSurfaceInfo, __pyx_t_5) < 0) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":611
 * 
 * 
 * class LengthSpectrum(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if len(self) > 0 and 'word' in self[0]:
*/
  __pyx_t_3 = PyTuple_Pack(1, ((PyObject *)(&PyList_Type))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_LengthSpectrum, __pyx_mstate_global->__pyx_n_u_LengthSpectrum, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_11 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(1, 611, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":612
 * 
 * class LengthSpectrum(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if len(self) > 0 and 'word' in self[0]:
 *             base = LengthSpectrumFormatStringWithWord % (
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14LengthSpectrum_1__repr__, 0, __pyx_mstate_global->__pyx_n_u_LengthSpectrum___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_3) < 0) __PYX_ERR(1, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":611
 * 
 * 
 * class LengthSpectrum(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if len(self) > 0 and 'word' in self[0]:
*/
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LengthSpectrum, __pyx_t_11, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LengthSpectrum, __pyx_t_3) < 0) __PYX_ERR(1, 611, __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_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":622
 * 
 * 
 * class ListOnePerLine(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
*/
  __pyx_t_11 = PyTuple_Pack(1, ((PyObject *)(&PyList_Type))); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ListOnePerLine, __pyx_mstate_global->__pyx_n_u_ListOnePerLine, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_4 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(1, 622, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":623
 * 
 * class ListOnePerLine(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14ListOnePerLine_1__repr__, 0, __pyx_mstate_global->__pyx_n_u_ListOnePerLine___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_11) < 0) __PYX_ERR(1, 623, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/basic.pyx":622
 * 
 * 
 * class ListOnePerLine(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ListOnePerLine, __pyx_t_4, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ListOnePerLine, __pyx_t_11) < 0) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __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;

  /* "cython/core/basic.pyx":629
 * # Isometry
 * 
 * def format_two_by_two(mat):             # <<<<<<<<<<<<<<
 *     a,b,c,d = ['%d' % x for x in [mat[0,0], mat[0,1], mat[1,0], mat[1,1]]]
 *     w0 = max(len(a), len(c))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_27format_two_by_two, 0, __pyx_mstate_global->__pyx_n_u_format_two_by_two, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_format_two_by_two, __pyx_t_4) < 0) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":637
 * 
 * 
 * class Isometry():             # <<<<<<<<<<<<<<
 *     """
 *     Represents an isometry from one manifold to another.
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Isometry, __pyx_mstate_global->__pyx_n_u_Isometry, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Represents_an_isometry_from_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/basic.pyx":641
 *     Represents an isometry from one manifold to another.
 *     """
 *     def __init__(self, cusp_images, cusp_maps, extends_to_link):             # <<<<<<<<<<<<<<
 *         self._cusp_images, self._cusp_maps = cusp_images, cusp_maps
 *         self._extends_to_link = extends_to_link
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Isometry_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Isometry___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(1, 641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":645
 *         self._extends_to_link = extends_to_link
 * 
 *     def cusp_images(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_images
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Isometry_3cusp_images, 0, __pyx_mstate_global->__pyx_n_u_Isometry_cusp_images, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cusp_images, __pyx_t_5) < 0) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":648
 *         return self._cusp_images
 * 
 *     def cusp_maps(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_maps
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Isometry_5cusp_maps, 0, __pyx_mstate_global->__pyx_n_u_Isometry_cusp_maps, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cusp_maps, __pyx_t_5) < 0) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":651
 *         return self._cusp_maps
 * 
 *     def extends_to_link(self):             # <<<<<<<<<<<<<<
 *         return self._extends_to_link
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Isometry_7extends_to_link, 0, __pyx_mstate_global->__pyx_n_u_Isometry_extends_to_link, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_extends_to_link, __pyx_t_5) < 0) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":654
 *         return self._extends_to_link
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         return len(self.cusp_images())
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Isometry_9num_cusps, 0, __pyx_mstate_global->__pyx_n_u_Isometry_num_cusps, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_t_5) < 0) __PYX_ERR(1, 654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":657
 *         return len(self.cusp_images())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Isometry_11__repr__, 0, __pyx_mstate_global->__pyx_n_u_Isometry___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_5) < 0) __PYX_ERR(1, 657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":637
 * 
 * 
 * class Isometry():             # <<<<<<<<<<<<<<
 *     """
 *     Represents an isometry from one manifold to another.
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Isometry, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Isometry, __pyx_t_5) < 0) __PYX_ERR(1, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":697
 * # PLink communication
 * 
 * def _plink_callback(LE):             # <<<<<<<<<<<<<<
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_29_plink_callback, 0, __pyx_mstate_global->__pyx_n_u_plink_callback_2, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_plink_callback_2, __pyx_t_4) < 0) __PYX_ERR(1, 697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":723
 * # Conversion functions Manifold <-> Triangulation
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,             # <<<<<<<<<<<<<<
 *                                 manifold_class=None):
 *     cdef c_Triangulation *c_triangulation
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_31Manifold_from_Triangulation, 0, __pyx_mstate_global->__pyx_n_u_Manifold_from_Triangulation, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[34]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Manifold_from_Triangulation, __pyx_t_4) < 0) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":749
 * 
 * 
 * def Triangulation_from_Manifold(Manifold M):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Triangulation T
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_33Triangulation_from_Manifold, 0, __pyx_mstate_global->__pyx_n_u_Triangulation_from_Manifold, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Triangulation_from_Manifold, __pyx_t_4) < 0) __PYX_ERR(1, 749, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1
 * from .cache import SnapPyCache             # <<<<<<<<<<<<<<
 * import low_index
 * 
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_SnapPyCache); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_cache, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SnapPyCache); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SnapPyCache, __pyx_t_4) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2
 * from .cache import SnapPyCache
 * import low_index             # <<<<<<<<<<<<<<
 * 
 * cdef class Triangulation():
*/
  __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_low_index, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_low_index, __pyx_t_5) < 0) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":279
 *         free_LR_factorization(gluing)
 * 
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_3_get_from_link_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__get_from_link_dat, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_get_from_link_data, __pyx_t_5) < 0) __PYX_ERR(4, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":314
 *                 self._remove_finite_vertices()
 * 
 *     def _remove_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Removing any finite vertices by simplification and drilling.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_5_remove_finite_vertices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__remove_finite_ver, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_remove_finite_vertices_2, __pyx_t_5) < 0) __PYX_ERR(4, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":334
 *                 count_cusps(self.c_triangulation)
 * 
 *     def cover_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         If this is a manifold or triangulation which was constructed as
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_7cover_info, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_cover_info, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_cover_info, __pyx_t_5) < 0) __PYX_ERR(4, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":343
 *             return dict(self._cover_info)
 * 
 *     def plink(self):             # <<<<<<<<<<<<<<
 *         """
 *         Brings up a link editor window if the manifold is stored
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_9plink, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_plink, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_plink, __pyx_t_5) < 0) __PYX_ERR(4, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":369
 *             raise ValueError('No associated link known.')
 * 
 *     def link(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the manifold is stored as a link complement in your
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_11link, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_link, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_link, __pyx_t_5) < 0) __PYX_ERR(4, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":387
 *         self.c_triangulation = c_triangulation
 * 
 *     def num_cusps(self, cusp_type='all') -> int:             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of cusps.  By giving the optional argument
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(4, 387, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_13num_cusps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_num_cusps, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[36]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_t_4) < 0) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":406
 *                              "['all', 'orientable', 'nonorientable'].")
 * 
 *     def _num_fake_cusps(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of "fake" cusps, which is typically the number
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_15_num_fake_cusps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__num_fake_cusps, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_num_fake_cusps, __pyx_t_4) < 0) __PYX_ERR(4, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":422
 *         return get_num_fake_cusps(self.c_triangulation)
 * 
 *     def orientation_cover(self):             # <<<<<<<<<<<<<<
 *         """
 *         For a non-orientable Triangulation, returns the 2-fold cover which
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_17orientation_cover, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_orientation_cover, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_orientation_cover, __pyx_t_4) < 0) __PYX_ERR(4, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":451
 *         return new_tri
 * 
 *     def is_orientable(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the underlying 3-manifold is orientable.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 451, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_19is_orientable, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_is_orientable, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_is_orientable, __pyx_t_5) < 0) __PYX_ERR(4, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":466
 *         return None
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the triangulation.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_21copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_copy, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_5) < 0) __PYX_ERR(4, 466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":483
 *         return new_tri
 * 
 *     def randomize(self, blowup_multiple=4, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Perform random Pachner moves on the underlying triangulation,
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_23randomize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_randomize, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[37]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_randomize, __pyx_t_5) < 0) __PYX_ERR(4, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":497
 *         self._cache.clear(message='randomize')
 * 
 *     def simplify(self, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Try to simplify the triangulation by doing Pachner moves.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_25simplify, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_simplify, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[38]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_simplify, __pyx_t_5) < 0) __PYX_ERR(4, 497, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":528
 *         self._cache.clear(message='simplify')
 * 
 *     def _two_to_three(self, tet_num, face_index):             # <<<<<<<<<<<<<<
 *         """
 *         Performs a 2-3 move which removes a given face.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_27_two_to_three, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__two_to_three, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_two_to_three, __pyx_t_5) < 0) __PYX_ERR(4, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":563
 *         return result
 * 
 *     def _three_to_two(self, tet_num, edge_index):             # <<<<<<<<<<<<<<
 *         r"""
 *         Perform a 3-2 move which removes a given 3-valent edge.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_29_three_to_two, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__three_to_two, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_three_to_two, __pyx_t_5) < 0) __PYX_ERR(4, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":614
 *         return result
 * 
 *     def with_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Add a (possibly degenerate) hyperbolic structure, turning the
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_31with_hyperbolic_structure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_with_hyperbolic_st, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_with_hyperbolic_structure, __pyx_t_5) < 0) __PYX_ERR(4, 614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":626
 *         return Manifold_from_Triangulation(self)
 * 
 *     def _polish_hyperbolic_structures(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function does nothing for Triangulation. It is overloaded in
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_33_polish_hyperbolic_structures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__polish_hyperbolic, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_polish_hyperbolic_structures, __pyx_t_5) < 0) __PYX_ERR(4, 626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":633
 *         pass
 * 
 *     def _empty_save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Called by save when no file name is specified, so that in
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_35_empty_save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__empty_save, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_empty_save, __pyx_t_5) < 0) __PYX_ERR(4, 633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":653
 *         raise ValueError('Please specify a file name.')
 * 
 *     def save(self, file_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Save the triangulation as a SnapPea triangulation file.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_37save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_save, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[39]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_save, __pyx_t_5) < 0) __PYX_ERR(4, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":677
 *             write_triangulation(self.c_triangulation, b_file_name)
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a string containing the contents of a SnapPea triangulation
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_39_to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__to_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_to_string, __pyx_t_5) < 0) __PYX_ERR(4, 677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":699
 *             return to_str(result)
 * 
 *     def _from_string(self, string, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_41_from_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__from_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_from_string, __pyx_t_5) < 0) __PYX_ERR(4, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":723
 *             self._remove_finite_vertices()
 * 
 *     def _to_bytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a reasonably short byte sequence which encodes the
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_43_to_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__to_bytes, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_to_bytes, __pyx_t_5) < 0) __PYX_ERR(4, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":761
 *         return bytearray_to_bytes(byteseq)
 * 
 *     def _from_bytes(self, bytestring, *args):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty triangulation from a byte sequence generated by
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_45_from_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__from_bytes, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_from_bytes, __pyx_t_5) < 0) __PYX_ERR(4, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":780
 *         self.set_c_triangulation(c_triangulation)
 * 
 *     def _from_pickle(self, bytestring, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_47_from_pickle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__from_pickle, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_from_pickle, __pyx_t_5) < 0) __PYX_ERR(4, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":791
 *             self._remove_finite_vertices()
 * 
 *     def _from_tetrahedra_gluing_data(self, tetrahedra_data,             # <<<<<<<<<<<<<<
 *                                      num_or_cusps=0,
 *                                      num_nonor_cusps=0,
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_49_from_tetrahedra_gluing_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__from_tetrahedra_g, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[40]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_from_tetrahedra_gluing_data, __pyx_t_5) < 0) __PYX_ERR(4, 791, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":845
 *             self._remove_finite_vertices()
 * 
 *     def _from_isosig(self, isosig, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_51_from_isosig, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__from_isosig, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_from_isosig, __pyx_t_5) < 0) __PYX_ERR(4, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":888
 * 
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by pickle.dumps.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_53__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation___reduce, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_5) < 0) __PYX_ERR(4, 888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":923
 *         return (self.__class__, (self.pickle(),))
 * 
 *     def pickle(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return pickle_triangulation(self.c_triangulation)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_55pickle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_pickle, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_pickle_2, __pyx_t_5) < 0) __PYX_ERR(4, 923, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":932
 *             return self._to_string()
 * 
 *     def _reindex_cusps(self, permutation):             # <<<<<<<<<<<<<<
 *         """
 *         >>> import itertools
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_57_reindex_cusps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__reindex_cusps, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_reindex_cusps, __pyx_t_5) < 0) __PYX_ERR(4, 932, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":958
 *         free(indices)
 * 
 *     def _get_cusp_indices_and_peripheral_curve_data(self):             # <<<<<<<<<<<<<<
 *         cdef int i, j, k, v, f
 *         cdef TriangulationData* data
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_59_get_cusp_indices_and_peripheral_curve_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__get_cusp_indices, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_get_cusp_indices_and_peripheral, __pyx_t_5) < 0) __PYX_ERR(4, 958, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":980
 *         return (result_cusp_indices, result_curves)
 * 
 *     def _get_tetrahedra_gluing_data(self):             # <<<<<<<<<<<<<<
 *         cdef int i, j, k
 *         cdef TriangulationData* data
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_61_get_tetrahedra_gluing_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__get_tetrahedra_gl, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_get_tetrahedra_gluing_data, __pyx_t_5) < 0) __PYX_ERR(4, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":995
 *         return result
 * 
 *     def _isomorphisms_to(self, Triangulation other not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a complete list of combinatorial isomorphisms between
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_63_isomorphisms_to, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__isomorphisms_to, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_isomorphisms_to, __pyx_t_5) < 0) __PYX_ERR(4, 995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1033
 *         return result
 * 
 *     def isomorphisms_to(self, Triangulation other not None):             # <<<<<<<<<<<<<<
 *         """
 *         This is only here to make the tests that use SnapPy.Triangulation work.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_65isomorphisms_to, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_isomorphisms_to, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_isomorphisms_to_2, __pyx_t_5) < 0) __PYX_ERR(4, 1033, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1081
 *             return repr
 * 
 *     def name(self) -> str:             # <<<<<<<<<<<<<<
 *         """
 *         Return the name of the triangulation.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(4, 1081, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_73name, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_name, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_name, __pyx_t_4) < 0) __PYX_ERR(4, 1081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1093
 *         return to_str(get_triangulation_name(self.c_triangulation))
 * 
 *     def set_name(self, new_name : str) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Give the triangulation a new name.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_new_name, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(4, 1093, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(4, 1093, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_75set_name, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_set_name, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_set_name_2, __pyx_t_5) < 0) __PYX_ERR(4, 1093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1108
 *         set_triangulation_name(self.c_triangulation, c_new_name)
 * 
 *     def DT_code(self, alpha=False, flips=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Dowker-Thistlethwaite code of this link complement,
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_77DT_code, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_DT_code, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[41]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_DT_code, __pyx_t_5) < 0) __PYX_ERR(4, 1108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1140
 *                 return codec.code
 * 
 *     def _set_DTcode(self, code, lazy=True):             # <<<<<<<<<<<<<<
 *         if not lazy and not isinstance(code, spherogram.DTcodec):
 *             code = spherogram.DTcodec(code)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_79_set_DTcode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__set_DTcode, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_set_DTcode, __pyx_t_5) < 0) __PYX_ERR(4, 1140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1145
 *         self._DTcode = code
 * 
 *     def _set_PDcode(self, code):             # <<<<<<<<<<<<<<
 *         self._PDcode = code
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_81_set_PDcode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__set_PDcode, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_set_PDcode, __pyx_t_5) < 0) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1148
 *         self._PDcode = code
 * 
 *     def num_tetrahedra(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of tetrahedra in the triangulation.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(4, 1148, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_83num_tetrahedra, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_num_tetrahedra, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_num_tetrahedra, __pyx_t_4) < 0) __PYX_ERR(4, 1148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1160
 *         return get_num_tetrahedra(self.c_triangulation)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(4, 1160, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_85dehn_fill, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_dehn_fill, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[39]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_t_5) < 0) __PYX_ERR(4, 1160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1230
 *     # When doctesting, the M,L coefficients acquire an accuracy of 8.
 *     # So we have to include the zeros in the doctest string.
 *     def cusp_info(self, data_spec=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_87cusp_info, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_cusp_info, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[39]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_t_5) < 0) __PYX_ERR(4, 1230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1286
 *         return CuspInfo(**info)
 * 
 *     def reverse_orientation(self) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Reverses the orientation of the Triangulation, presuming that
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(4, 1286, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_89reverse_orientation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_reverse_orientatio, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_reverse_orientation, __pyx_t_4) < 0) __PYX_ERR(4, 1286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1303
 *         self._cache.clear(message='reverse_orientation')
 * 
 *     def filled_triangulation(             # <<<<<<<<<<<<<<
 *             self, cusps_to_fill='all') -> 'snappy.Triangulation':
 *         """
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_snappy_Triangulation) < 0) __PYX_ERR(4, 1303, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_91filled_triangulation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_filled_triangulati, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[36]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_filled_triangulation, __pyx_t_5) < 0) __PYX_ERR(4, 1303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1353
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self, method='fold'):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_93_unsimplified_filled_triangulation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__unsimplified_fill, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[42]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_unsimplified_filled_triangulati_2, __pyx_t_5) < 0) __PYX_ERR(4, 1353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1425
 *         return filled_tri
 * 
 *     def _marked_tetrahedra(self, clear_marks=False):             # <<<<<<<<<<<<<<
 *         cdef int *marked = NULL
 *         n = self.num_tetrahedra()
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_95_marked_tetrahedra, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__marked_tetrahedra, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_marked_tetrahedra, __pyx_t_5) < 0) __PYX_ERR(4, 1425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1436
 *         return ans
 * 
 *     def edge_valences(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary whose keys are the valences of the edges
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_97edge_valences, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_edge_valences, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_edge_valences, __pyx_t_5) < 0) __PYX_ERR(4, 1436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1457
 *         return ans
 * 
 *     def gluing_equations_pgl(self, N =2, equation_type='all'):             # <<<<<<<<<<<<<<
 * 
 *         """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_99gluing_equations_pgl, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_gluing_equations_p, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[44]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_gluing_equations_pgl, __pyx_t_5) < 0) __PYX_ERR(4, 1457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1637
 *                                           explain_cols)
 * 
 *     def _ptolemy_equations_identified_face_classes(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function returns an identification structure where s_f_t gets
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_101_ptolemy_equations_identified_face_classes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__ptolemy_equations, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_equations_identified_fa, __pyx_t_5) < 0) __PYX_ERR(4, 1637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1664
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,             # <<<<<<<<<<<<<<
 *                                                   obstruction_class = None):
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_103_ptolemy_equations_identified_coordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__ptolemy_equations_2, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[39]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_equations_identified_co, __pyx_t_5) < 0) __PYX_ERR(4, 1664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1699
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_action_by_decoration_change(self, int N):             # <<<<<<<<<<<<<<
 *         """
 *         We can change a decoration by multiplying a coset of a cusp by a
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_105_ptolemy_equations_action_by_decoration_change, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__ptolemy_equations_3, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_equations_action_by_dec, __pyx_t_5) < 0) __PYX_ERR(4, 1699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1723
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_3(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_3 -> C_2 in cellular homology represented as matrix
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_107_ptolemy_equations_boundary_map_3, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__ptolemy_equations_4, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_equations_boundary_map, __pyx_t_5) < 0) __PYX_ERR(4, 1723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1752
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_2 -> C_1 in cellular homology represented as matrix.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_109_ptolemy_equations_boundary_map_2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__ptolemy_equations_5, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[96])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_equations_boundary_map_2, __pyx_t_5) < 0) __PYX_ERR(4, 1752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1773
 *         return m, explain_rows, explain_cols
 * 
 *     def _ptolemy_equations_boundary_map_1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Boundary map C_1 -> C_0 in cellular homology represented as matrix.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_111_ptolemy_equations_boundary_map_1, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__ptolemy_equations_6, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_equations_boundary_map_3, __pyx_t_5) < 0) __PYX_ERR(4, 1773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1796
 *         return m, explain_rows, explain_cols
 * 
 *     def ptolemy_obstruction_classes(self):             # <<<<<<<<<<<<<<
 * 
 *         """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_113ptolemy_obstruction_classes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_ptolemy_obstructio, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_obstruction_classes, __pyx_t_5) < 0) __PYX_ERR(4, 1796, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1858
 *         return ptolemyManifoldMethods.get_ptolemy_obstruction_classes(self)
 * 
 *     def ptolemy_generalized_obstruction_classes(self, N):             # <<<<<<<<<<<<<<
 * 
 *         """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_115ptolemy_generalized_obstruction_classes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_ptolemy_generalize, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_generalized_obstruction, __pyx_t_5) < 0) __PYX_ERR(4, 1858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1923
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_117ptolemy_variety, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_ptolemy_variety, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[45]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_ptolemy_variety, __pyx_t_5) < 0) __PYX_ERR(4, 1923, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2108
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)
 * 
 *     def gluing_equations(self,form='log'):             # <<<<<<<<<<<<<<
 *         """
 *         In the default mode, this function returns a matrix with rows
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_119gluing_equations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_gluing_equations, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[46]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_gluing_equations, __pyx_t_5) < 0) __PYX_ERR(4, 2108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2271
 *         return relation_matrix
 * 
 *     def _presentation_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Computes the presentation matrix for the first integral
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_121_presentation_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__presentation_matr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_presentation_matrix, __pyx_t_5) < 0) __PYX_ERR(4, 2271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2311
 *         return AbelianGroup(relations)
 * 
 *     def homology(self) -> AbelianGroup:             # <<<<<<<<<<<<<<
 *         """
 *         Returns an :class:`AbelianGroup` representing the first integral
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_AbelianGroup) < 0) __PYX_ERR(4, 2311, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_123homology, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_homology, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_homology, __pyx_t_4) < 0) __PYX_ERR(4, 2311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2346
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_simplify_presentation, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2346, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fillings_may_affect_generators, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2346, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_minimize_number_of_generators, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2346, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_try_hard_to_shorten_relators, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2346, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_FundamentalGroup) < 0) __PYX_ERR(4, 2346, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_125fundamental_group, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_fundamental_group, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[47]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_t_5) < 0) __PYX_ERR(4, 2346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2395
 *                                 'fundamental_group', *args)
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Triangulation':             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`Triangulation` representing the finite cover specified
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_snappy_Triangulation) < 0) __PYX_ERR(4, 2395, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_127cover, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_cover, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_cover, __pyx_t_4) < 0) __PYX_ERR(4, 2395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2497
 *         return cover
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_method, __pyx_mstate_global->__pyx_kp_u_typing_Optional_str) < 0) __PYX_ERR(4, 2497, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cover_type, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(4, 2497, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_snappy_Triangulation) < 0) __PYX_ERR(4, 2497, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_129covers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_covers, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[48]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_covers, __pyx_t_5) < 0) __PYX_ERR(4, 2497, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2564
 *                          "and 'snappea'")
 * 
 *     def _covers_low_index(self, degree, num_threads=0):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using low_index.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_131_covers_low_index, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__covers_low_index, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_covers_low_index, __pyx_t_5) < 0) __PYX_ERR(4, 2564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2599
 *         return covers
 * 
 *     def _covers_gap(self, degree):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using gap.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_133_covers_gap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__covers_gap, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_covers_gap, __pyx_t_5) < 0) __PYX_ERR(4, 2599, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2614
 *         return covers
 * 
 *     def _covers_magma(self, degree):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using magma.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_135_covers_magma, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__covers_magma, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[109])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_covers_magma, __pyx_t_5) < 0) __PYX_ERR(4, 2614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2629
 *         return covers
 * 
 *     def _covers_snappea(self, degree, cover_type):             # <<<<<<<<<<<<<<
 *         """
 *         Compute cyclic or all covers using SnapPea kernel.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_137_covers_snappea, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__covers_snappea, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[110])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_covers_snappea, __pyx_t_5) < 0) __PYX_ERR(4, 2629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2776
 *         return c_repn_in_original_gens
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_139set_peripheral_curves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_set_peripheral_cur, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[111])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[50]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_set_peripheral_curves, __pyx_t_5) < 0) __PYX_ERR(4, 2776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":2911
 *                                  peripheral_data)
 * 
 *     def has_finite_vertices(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         Returns ``True`` if and only if the triangulation has finite (non-ideal)
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2911, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_141has_finite_vertices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_has_finite_vertice, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[112])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_has_finite_vertices, __pyx_t_4) < 0) __PYX_ERR(4, 2911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2938
 *         return get_num_fake_cusps(self.c_triangulation) > 0
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_decorated, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ignore_cusp_ordering, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ignore_curves, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ignore_curve_orientations, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ignore_filling_orientations, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ignore_orientation, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_143triangulation_isosig, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_triangulation_isos, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[113])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_triangulation_isosig, __pyx_t_5) < 0) __PYX_ERR(4, 2938, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":3222
 *         return self._cache.save(result, 'triangulation_isosig', *args)
 * 
 *     def _undecorated_triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                                           ignore_orientation : bool = False) -> str:
 *         if self.c_triangulation is NULL:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ignore_orientation, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 3222, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(4, 3222, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_145_undecorated_triangulation_isosig, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__undecorated_trian, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[114])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[43]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_undecorated_triangulation_isosi, __pyx_t_4) < 0) __PYX_ERR(4, 3222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":3235
 *             free(c_string)
 * 
 *     def _symplectic_form(self, u, v):             # <<<<<<<<<<<<<<
 *         return sum([u[2 * i] * v[2 * i + 1] - u[2 * i + 1] * v[2 * i] for i in range(len(u) // 2)])
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_147_symplectic_form, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__symplectic_form, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[115])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_symplectic_form, __pyx_t_4) < 0) __PYX_ERR(4, 3235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":3238
 *         return sum([u[2 * i] * v[2 * i + 1] - u[2 * i + 1] * v[2 * i] for i in range(len(u) // 2)])
 * 
 *     def _is_symplectic(self, M):             # <<<<<<<<<<<<<<
 *         """
 *         Test if the matrix M is symplectic
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_149_is_symplectic, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation__is_symplectic, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[116])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_is_symplectic, __pyx_t_4) < 0) __PYX_ERR(4, 3238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":3258
 *         return True
 * 
 *     def symplectic_basis(self, verify : bool = False):             # <<<<<<<<<<<<<<
 *         """
 *         Extend the Neumann-Zagier matrix to one which is symplectic
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_verify, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(4, 3258, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13Triangulation_151symplectic_basis, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangulation_symplectic_basis, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[117])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[43]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation, __pyx_mstate_global->__pyx_n_u_symplectic_basis, __pyx_t_5) < 0) __PYX_ERR(4, 3258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":85
 *             do_Dehn_filling(self.c_triangulation)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_3_number_, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__number, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[118])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_5) < 0) __PYX_ERR(2, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_3 = __pyx_builtin_staticmethod; 
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_number_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_5) < 0) __PYX_ERR(2, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":89
 *         return number.number_to_native_number(n)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def use_field_conversion(cls, func):
 *         """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_5use_field_conversion, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_use_field_conversion, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[119])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_use_field_conversion, __pyx_t_5) < 0) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_use_field_conversion); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_use_field_conversion, __pyx_t_3) < 0) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":137
 *         number.use_field_conversion(func)
 * 
 *     def init_hyperbolic_structure(self, force_recompute = False):             # <<<<<<<<<<<<<<
 *         if not self.c_triangulation:
 *             return
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_7init_hyperbolic_structure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_init_hyperbolic_structu, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[120])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_init_hyperbolic_structure, __pyx_t_3) < 0) __PYX_ERR(2, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":146
 *         self.hyperbolic_structure_initialized = True
 * 
 *     def canonize(self) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Change the triangulation to an arbitrary retriangulation of
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(2, 146, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_9canonize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_canonize, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[121])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_canonize, __pyx_t_5) < 0) __PYX_ERR(2, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":170
 *         self._cache.clear(message='canonize')
 * 
 *     def _canonical_retriangulation(self, opacities=None, top_level_tries=10):             # <<<<<<<<<<<<<<
 *         """
 *         If this triangulation is a subdivision of the canonical cell
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_11_canonical_retriangulation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__canonical_retriangulat, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[122])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[52]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_canonical_retriangulation, __pyx_t_5) < 0) __PYX_ERR(2, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":249
 *         return new_tri
 * 
 *     def _canonical_cells_are_tetrahedra(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if and only if the canonical
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_13_canonical_cells_are_tetrahedra, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__canonical_cells_are_te, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[123])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_canonical_cells_are_tetrahedra, __pyx_t_5) < 0) __PYX_ERR(2, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":267
 *         return get_num_fake_cusps(M.c_triangulation) == 0
 * 
 *     def _from_string(self, string, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         WARNING: Users should not use this function directly.  To create a
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_15_from_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__from_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[124])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_from_string, __pyx_t_5) < 0) __PYX_ERR(2, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":283
 *             self.init_hyperbolic_structure()
 * 
 *     def _from_bytes(self, bytestring, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty manifold from a byte sequence generated by
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_17_from_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__from_bytes, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[125])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_from_bytes, __pyx_t_5) < 0) __PYX_ERR(2, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":297
 *             self.init_hyperbolic_structure()
 * 
 *     def _from_isosig(self, isosig, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty manifold from an isosig generated by
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_19_from_isosig, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__from_isosig, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[126])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[35]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_from_isosig, __pyx_t_5) < 0) __PYX_ERR(2, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":308
 *             self.init_hyperbolic_structure()
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the manifold
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_21copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_copy, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[127])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_5) < 0) __PYX_ERR(2, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":320
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
 * 
 *     def cusp_neighborhood(self) -> CuspNeighborhood:             # <<<<<<<<<<<<<<
 *         """
 *         Returns information about the cusp neighborhoods of the
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_CuspNeighborhood) < 0) __PYX_ERR(2, 320, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_23cusp_neighborhood, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_cusp_neighborhood, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[128])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_cusp_neighborhood, __pyx_t_3) < 0) __PYX_ERR(2, 320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":337
 * 
 *     def dirichlet_domain(self,
 *                          vertex_epsilon=default_vertex_epsilon,             # <<<<<<<<<<<<<<
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin : bool = True,
*/
  __pyx_t_3 = PyFloat_FromDouble(default_vertex_epsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_mstate_global->__pyx_k__29 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":336
 *         return CuspNeighborhood(self)
 * 
 *     def dirichlet_domain(self,             # <<<<<<<<<<<<<<
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
*/
  __pyx_t_3 = PyFloat_FromDouble(default_vertex_epsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/manifold.pyx":341
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,
 *                          include_words : bool = False) -> DirichletDomain:             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`DirichletDomain` object representing a Dirichlet
*/
  __pyx_t_5 = PyTuple_Pack(5, __pyx_t_3, __pyx_mstate_global->__pyx_tuple[18], Py_True, Py_True, Py_False); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":336
 *         return CuspNeighborhood(self)
 * 
 *     def dirichlet_domain(self,             # <<<<<<<<<<<<<<
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_centroid_at_origin, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 336, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_maximize_injectivity_radius, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 336, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_include_words, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 336, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DirichletDomain) < 0) __PYX_ERR(2, 336, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_25dirichlet_domain, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_dirichlet_domain, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[129])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_dirichlet_domain, __pyx_t_11) < 0) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":386
 *                                 'dirichlet_domain', *args)
 * 
 *     def browse(self):             # <<<<<<<<<<<<<<
 *         """
 *         Opens browser window with a graphical interface, which allows to
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_27browse, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_browse, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[130])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_browse, __pyx_t_11) < 0) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":402
 *         return Browser(self)
 * 
 *     def filled_triangulation(             # <<<<<<<<<<<<<<
 *             self, cusps_to_fill='all') -> 'snappy.Manifold':
 *         """
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_snappy_Manifold) < 0) __PYX_ERR(2, 402, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_29filled_triangulation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_filled_triangulation, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[131])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[36]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_filled_triangulation, __pyx_t_3) < 0) __PYX_ERR(2, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":430
 *         return filled
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_simplify_presentation, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fillings_may_affect_generators, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_minimize_number_of_generators, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_try_hard_to_shorten_relators, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_HolonomyGroup) < 0) __PYX_ERR(2, 430, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_31fundamental_group, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_fundamental_group, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[132])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[47]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_fundamental_group, __pyx_t_11) < 0) __PYX_ERR(2, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":482
 *         return self._cache.save(result, 'fundamental_group', *args)
 * 
 *     def symmetry_group(self, of_link : bool = False) -> SymmetryGroup:             # <<<<<<<<<<<<<<
 *         """
 *         Returns the symmetry group of the Manifold.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_of_link, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 482, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SymmetryGroup) < 0) __PYX_ERR(2, 482, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_33symmetry_group, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_symmetry_group, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[133])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[43]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_symmetry_group, __pyx_t_3) < 0) __PYX_ERR(2, 482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":528
 *         return self._cache.save(symmetry_group, 'symmetry_group', of_link)
 * 
 *     def symmetric_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Dehn filling description of the manifold realizing
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_35symmetric_triangulation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_symmetric_triangulation, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[134])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_symmetric_triangulation, __pyx_t_3) < 0) __PYX_ERR(2, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":549
 *             return self._cache.lookup('symmetric_triangulation')
 * 
 *     def cover(self, permutation_rep) -> 'snappy.Manifold':             # <<<<<<<<<<<<<<
 *         """
 *         Returns a :class:`Manifold` representing the finite cover specified by a
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_snappy_Manifold) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_37cover, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_cover, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[135])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_cover, __pyx_t_11) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":618
 *                                            manifold_class=self.__class__)
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_method, __pyx_mstate_global->__pyx_kp_u_typing_Optional_str) < 0) __PYX_ERR(2, 618, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_cover_type, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(2, 618, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_snappy_Manifold) < 0) __PYX_ERR(2, 618, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_39covers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_covers, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[136])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[48]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_covers, __pyx_t_3) < 0) __PYX_ERR(2, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":714
 *         raise ValueError(err_msg)
 * 
 *     def _complex_volume(self):             # <<<<<<<<<<<<<<
 *         cdef Complex volume
 *         cdef int accuracy
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_41_complex_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__complex_volume, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[137])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_complex_volume_2, __pyx_t_3) < 0) __PYX_ERR(2, 714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":728
 *         return self._number_(result)
 * 
 *     def volume(self, accuracy=False, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the volume of the current solution to the hyperbolic
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_43volume, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_volume, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[138])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[53]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_volume, __pyx_t_3) < 0) __PYX_ERR(2, 728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":821
 *         return result
 * 
 *     def chern_simons(self, accuracy = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Chern-Simons invariant of the manifold (normalized by
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_45chern_simons, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_chern_simons, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[139])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_chern_simons, __pyx_t_3) < 0) __PYX_ERR(2, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":863
 *             return self._number_(cs)
 * 
 *     def without_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns self as a :class:`Triangulation`, forgetting the hyperbolic
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_47without_hyperbolic_structure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_without_hyperbolic_stru, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[140])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_without_hyperbolic_structure, __pyx_t_3) < 0) __PYX_ERR(2, 863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":875
 *         return Triangulation_from_Manifold(self)
 * 
 *     def _polish_hyperbolic_structures(self):             # <<<<<<<<<<<<<<
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_49_polish_hyperbolic_structures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__polish_hyperbolic_stru, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[141])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_polish_hyperbolic_structures, __pyx_t_3) < 0) __PYX_ERR(2, 875, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":878
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,             # <<<<<<<<<<<<<<
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_51tetrahedra_shapes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_tetrahedra_shapes, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[142])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[54]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_tetrahedra_shapes, __pyx_t_3) < 0) __PYX_ERR(2, 878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":997
 *             return ListOnePerLine(result)
 * 
 *     def _get_tetrahedra_shapes(self, which_solution):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the tetrahedra shapes from one of the two
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_53_get_tetrahedra_shapes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__get_tetrahedra_shapes, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[143])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_get_tetrahedra_shapes, __pyx_t_3) < 0) __PYX_ERR(2, 997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1025
 *         return result
 * 
 *     def set_tetrahedra_shapes(self,             # <<<<<<<<<<<<<<
 *                               filled_shapes=None,
 *                               complete_shapes=None,
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_55set_tetrahedra_shapes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_set_tetrahedra_shapes, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[144])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[23]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_set_tetrahedra_shapes, __pyx_t_3) < 0) __PYX_ERR(2, 1025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1063
 *         self._cache.clear(message='Manifold.set_tetrahedra_shapes')
 * 
 *     def solution_type(self, enum=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the type of the current solution to the gluing
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_57solution_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_solution_type, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[145])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_solution_type, __pyx_t_3) < 0) __PYX_ERR(2, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1113
 *             return SolutionType[solution_type]
 * 
 *     def set_target_holonomy(self, target, which_cusp=0, recompute=True):             # <<<<<<<<<<<<<<
 *         """
 *         M.set_target_holonomy(target, which_cusp=0, recompute=True)
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_59set_target_holonomy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_set_target_holonomy, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[146])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[55]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_set_target_holonomy, __pyx_t_3) < 0) __PYX_ERR(2, 1113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1128
 *                             which_cusp, c_target, recompute)
 * 
 *     def cusp_info(self, data_spec=None, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_61cusp_info, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_cusp_info, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[147])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[56]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_cusp_info, __pyx_t_3) < 0) __PYX_ERR(2, 1128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1251
 *         return CuspInfo(**info)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None) -> None:             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(2, 1251, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_63dehn_fill, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_dehn_fill, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[148])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[39]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_dehn_fill, __pyx_t_11) < 0) __PYX_ERR(2, 1251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1289
 *         self._cache.clear(message='Manifold.dehn_fill')
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_65set_peripheral_curves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_set_peripheral_curves, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[149])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[50]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_set_peripheral_curves, __pyx_t_11) < 0) __PYX_ERR(2, 1289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1403
 *                 self, peripheral_data, which_cusp,return_matrices)
 * 
 *     def dual_curves(self, max_segments=6):             # <<<<<<<<<<<<<<
 *         """
 *         Constructs a *reasonable* selection of simple closed curves in
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_67dual_curves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_dual_curves, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[150])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[38]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_dual_curves, __pyx_t_11) < 0) __PYX_ERR(2, 1403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1469
 *         return ListOnePerLine(result)
 * 
 *     def length_spectrum(self,             # <<<<<<<<<<<<<<
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_full_rigor, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 1469, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_grouped, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 1469, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_include_words, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 1469, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_69length_spectrum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_length_spectrum, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[151])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[57]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_length_spectrum, __pyx_t_3) < 0) __PYX_ERR(2, 1469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1505
 *             *args)
 * 
 *     def drill(self, which_curve, max_segments=6):             # <<<<<<<<<<<<<<
 *         """
 *         Drills out the specified dual curve from among all dual curves
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_71drill, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_drill, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[152])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[38]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_drill, __pyx_t_3) < 0) __PYX_ERR(2, 1505, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1552
 *             return result
 * 
 *     def _is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                          Manifold other,
 *                          return_isometries : bool = False):
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return_isometries, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 1552, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_73_is_isometric_to, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__is_isometric_to, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[153])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[43]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_is_isometric_to, __pyx_t_11) < 0) __PYX_ERR(2, 1552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1638
 *         return ans
 * 
 *     def is_isometric_to(self,             # <<<<<<<<<<<<<<
 *                         Manifold other,
 *                         return_isometries : bool = False):
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return_isometries, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 1638, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_75is_isometric_to, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_is_isometric_to, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[154])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[43]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_is_isometric_to_2, __pyx_t_3) < 0) __PYX_ERR(2, 1638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1647
 *             other, return_isometries = return_isometries)
 * 
 *     def is_two_bridge(self) -> bool:             # <<<<<<<<<<<<<<
 *         """
 *         If the manifold is the complement of a two-bridge knot or link
*/
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(2, 1647, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_77is_two_bridge, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_is_two_bridge, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[155])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_is_two_bridge, __pyx_t_11) < 0) __PYX_ERR(2, 1647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1681
 *             return False
 * 
 *     def _choose_generators(self, compute_corners, centroid_at_origin):             # <<<<<<<<<<<<<<
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_79_choose_generators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__choose_generators, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[156])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_choose_generators, __pyx_t_11) < 0) __PYX_ERR(2, 1681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1686
 *                           centroid_at_origin)
 * 
 *     def _choose_generators_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Extracts, from the bowels of SnapPea, the information about the
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_81_choose_generators_info, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__choose_generators_info, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[157])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_choose_generators_info, __pyx_t_11) < 0) __PYX_ERR(2, 1686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1724
 *         return ans
 * 
 *     def splitting_surfaces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Searches for connected closed normal surfaces of nonnegative Euler
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_83splitting_surfaces, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_splitting_surfaces, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[158])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_splitting_surfaces, __pyx_t_11) < 0) __PYX_ERR(2, 1724, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1768
 *         return ListOnePerLine(ans)
 * 
 *     def split(self, which_surface):             # <<<<<<<<<<<<<<
 *         """
 *         Split the manifold open along a surface of positive characteristic found
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_85split, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold_split, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[159])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_split, __pyx_t_11) < 0) __PYX_ERR(2, 1768, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1833
 *         return ans
 * 
 *     def _identify(self, extends_to_link=False):             # <<<<<<<<<<<<<<
 *         ans = []
 *         for table in database.__all_tables__.values():
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_87_identify, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__identify, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[160])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_identify_2, __pyx_t_11) < 0) __PYX_ERR(2, 1833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1841
 *         return ans
 * 
 *     def _cusp_cross_section_info(self):             # <<<<<<<<<<<<<<
 *         cdef c_Tetrahedron *tet
 *         allocate_cross_sections(self.c_triangulation)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_89_cusp_cross_section_info, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__cusp_cross_section_inf, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[161])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_cusp_cross_section_info, __pyx_t_11) < 0) __PYX_ERR(2, 1841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/manifold.pyx":1867
 *         return tilts, side_lengths
 * 
 *     def _precision(self):             # <<<<<<<<<<<<<<
 *         return Number._default_precision
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_8Manifold_91_precision, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Manifold__precision, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[162])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold, __pyx_mstate_global->__pyx_n_u_precision, __pyx_t_11) < 0) __PYX_ERR(2, 1867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":41
 *     cdef public coefficients
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):             # <<<<<<<<<<<<<<
 *         if presentation is not None:
 *             self.divisors = smith_form(presentation)
*/
  __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_mstate_global->__pyx_k__31 = __pyx_t_11;
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":82
 *         return self.divisors[i]
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by the pickle module to pickle an Abelian Group.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12AbelianGroup_9__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbelianGroup___reduce, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[163])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_11) < 0) __PYX_ERR(5, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":113
 *         return self
 * 
 *     def elementary_divisors(self):             # <<<<<<<<<<<<<<
 *         """
 *         The elementary divisors of this finitely generated abelian group.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12AbelianGroup_15elementary_divisors, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbelianGroup_elementary_divisors, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[164])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup, __pyx_mstate_global->__pyx_n_u_elementary_divisors, __pyx_t_11) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":119
 *         return self.divisors
 * 
 *     def rank(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the group.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12AbelianGroup_17rank, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbelianGroup_rank, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[165])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup, __pyx_mstate_global->__pyx_n_u_rank, __pyx_t_11) < 0) __PYX_ERR(5, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":125
 *         return len(self.divisors)
 * 
 *     def betti_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the maximal free abelian subgroup.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12AbelianGroup_19betti_number, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbelianGroup_betti_number, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[166])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup, __pyx_mstate_global->__pyx_n_u_betti_number, __pyx_t_11) < 0) __PYX_ERR(5, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":131
 *         return len([1 for n in self.divisors if n == 0])
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         """
 *         The order of the group.  Returns the string 'infinite' if the
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12AbelianGroup_21order, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbelianGroup_order, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[167])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_AbelianGroup, __pyx_mstate_global->__pyx_n_u_order, __pyx_t_11) < 0) __PYX_ERR(5, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":159
 *         self.dead_columns = set()
 * 
 *     def get_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a triple (number of rows, number of columns, entries)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_3get_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix_get_data, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[168])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_get_data, __pyx_t_11) < 0) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":213
 *         return repr(self.explode())
 * 
 *     def add_rows(self, n):             # <<<<<<<<<<<<<<
 *         self.rows += n
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_11add_rows, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix_add_rows, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[169])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_add_rows, __pyx_t_11) < 0) __PYX_ERR(5, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":216
 *         self.rows += n
 * 
 *     def row_op(self, i, j, m):             # <<<<<<<<<<<<<<
 *         """
 *         Subtract m * row_i from row_j
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_13row_op, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix_row_op, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[170])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_row_op, __pyx_t_11) < 0) __PYX_ERR(5, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":223
 *             self[j,k] -= m*self[i,k]
 * 
 *     def explode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the full matrix, including dead columns, as a list of lists.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_15explode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix_explode, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[171])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_explode, __pyx_t_11) < 0) __PYX_ERR(5, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":230
 *                 for i in range(self.rows)]
 * 
 *     def simplify(self):             # <<<<<<<<<<<<<<
 *         """
 *         If any entry is a unit, eliminate the corresponding generator.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_17simplify, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix_simplify, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[172])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_simplify, __pyx_t_11) < 0) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/abelian_group.pyx":254
 *             self.dead_columns.add(j)
 * 
 *     def simplified_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the simplified presentation as a matrix.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_19simplified_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix_simplified_ma, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[173])); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_simplified_matrix, __pyx_t_11) < 0) __PYX_ERR(5, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix___reduce_cyth, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[174])); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x59cf8a3, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_PresentationMatrix__set_state(self, __pyx_state)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_18PresentationMatrix_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PresentationMatrix___setstate_cy, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[175])); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_PresentationMatrix, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < 0) __PYX_ERR(7, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":4
 * # Fundamental Groups
 * 
 * Alphabet = '$abcdefghijklmnopqrstuvwxyzZYXWVUTSRQPONMLKJIHGFEDCBA'             # <<<<<<<<<<<<<<
 * 
 * # Helper functions for manipulating fg. words
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Alphabet, __pyx_mstate_global->__pyx_kp_u_abcdefghijklmnopqrstuvwxyzZYXWV) < 0) __PYX_ERR(8, 4, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":9
 * 
 * 
 * def inverse_list_word(word):             # <<<<<<<<<<<<<<
 *     return [ -x for x in word[::-1] ]
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_35inverse_list_word, 0, __pyx_mstate_global->__pyx_n_u_inverse_list_word, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[176])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_inverse_list_word, __pyx_t_11) < 0) __PYX_ERR(8, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":13
 * 
 * 
 * def reduce_list_word(word):             # <<<<<<<<<<<<<<
 *     """
 *     Cancels inverse generators.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_37reduce_list_word, 0, __pyx_mstate_global->__pyx_n_u_reduce_list_word, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[177])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_list_word, __pyx_t_11) < 0) __PYX_ERR(8, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":59
 * 
 * 
 * def _letter_seperator(verbose_form):             # <<<<<<<<<<<<<<
 *     return '*' if verbose_form else ''
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_39_letter_seperator, 0, __pyx_mstate_global->__pyx_n_u_letter_seperator, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[178])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_letter_seperator, __pyx_t_11) < 0) __PYX_ERR(8, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":73
 * 
 * 
 * def word_as_list(word, int num_generators):             # <<<<<<<<<<<<<<
 *     if not isinstance(word, str):
 *         raise TypeError('Words must be represented as Python strings.')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_41word_as_list, 0, __pyx_mstate_global->__pyx_n_u_word_as_list, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[179])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_word_as_list, __pyx_t_11) < 0) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":98
 *     return word_list
 * 
 * def list_as_word(int_list, int num_generators, verbose_form):             # <<<<<<<<<<<<<<
 *     return _letter_seperator(verbose_form).join(
 *         int_to_gen_string(g, num_generators, verbose_form)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_43list_as_word, 0, __pyx_mstate_global->__pyx_n_u_list_as_word, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[180])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_list_as_word, __pyx_t_11) < 0) __PYX_ERR(8, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":134
 *             '\n   '.join(self.relators()))
 * 
 *     def num_generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of generators for the presentation.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_7num_generators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_num_generators, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[181])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_num_generators, __pyx_t_11) < 0) __PYX_ERR(8, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":140
 *         return fg_get_num_generators(self.c_group_presentation)
 * 
 *     def num_relators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of generators for the presentation.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_9num_relators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_num_relators, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[182])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_num_relators, __pyx_t_11) < 0) __PYX_ERR(8, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":146
 *         return fg_get_num_relations(self.c_group_presentation)
 * 
 *     def num_original_generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of geometric generators (before simplification).
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_11num_original_generators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_num_original_g, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[183])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_num_original_generators, __pyx_t_11) < 0) __PYX_ERR(8, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":152
 *         return fg_get_num_orig_gens(self.c_group_presentation)
 * 
 *     def original_generators(self, verbose_form=False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the original geometric generators (before
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_13original_generators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_original_gener, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[184])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[41]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_original_generators, __pyx_t_11) < 0) __PYX_ERR(8, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":177
 *         return orig_gens
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form=False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the current generators in terms of the original
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_15generators_in_originals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_generators_in, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[185])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[58]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_generators_in_originals, __pyx_t_11) < 0) __PYX_ERR(8, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":232
 *             return [ list_as_word(word, n, verbose_form) for word in words[1:]]
 * 
 *     def _word_moves(self):             # <<<<<<<<<<<<<<
 *         cdef int *c_moves
 *         c_moves = fg_get_word_moves(self.c_group_presentation)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_17_word_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup__word_moves, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[186])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_word_moves, __pyx_t_11) < 0) __PYX_ERR(8, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":239
 *         return moves
 * 
 *     def generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the letters representing the generators in the presentation.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_19generators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_generators, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[187])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_generators, __pyx_t_11) < 0) __PYX_ERR(8, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":283
 *                  for i in range(1, 1+n) ]
 * 
 *     def relators(self, verbose_form = False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of words representing the relators in the presentation.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_21relators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_relators, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[188])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[41]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_relators, __pyx_t_11) < 0) __PYX_ERR(8, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":306
 *         return relation_list
 * 
 *     def meridian(self, int which_cusp=0, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a word representing a conjugate of the current
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_23meridian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_meridian, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[189])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[59]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_meridian, __pyx_t_11) < 0) __PYX_ERR(8, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":331
 *                verbose_form = False)
 * 
 *     def longitude(self, int which_cusp=0, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a word representing a conjugate of the current
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_25longitude, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_longitude, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[190])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[59]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_longitude, __pyx_t_11) < 0) __PYX_ERR(8, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":357
 *                verbose_form = False)
 * 
 *     def peripheral_curves(self, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of meridian-longitude pairs for all cusps.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_27peripheral_curves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_peripheral_cur, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[191])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_peripheral_curves, __pyx_t_11) < 0) __PYX_ERR(8, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":369
 *                  for n in range(self.num_cusps) ]
 * 
 *     def magma_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string which will define this group within MAGMA.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_29magma_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_magma_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[192])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_magma_string, __pyx_t_11) < 0) __PYX_ERR(8, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":376
 *                 ', '.join(self.relators(verbose_form=True)) + '>')
 * 
 *     def gap_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a string which will define this group within GAP:
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_31gap_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_gap_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[193])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_gap_string, __pyx_t_11) < 0) __PYX_ERR(8, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":404
 *                 )
 * 
 *     def _gap_init_(self):             # <<<<<<<<<<<<<<
 *         return self.gap_string()
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_33_gap_init_, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup__gap_init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[194])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_gap_init, __pyx_t_11) < 0) __PYX_ERR(8, 404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":407
 *         return self.gap_string()
 * 
 *     def _magma_init_(self, magma):             # <<<<<<<<<<<<<<
 *         return self.magma_string()
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_35_magma_init_, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup__magma_init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[195])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_magma_init, __pyx_t_11) < 0) __PYX_ERR(8, 407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":410
 *         return self.magma_string()
 * 
 *     def sage(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the corresponding Sage FinitelyPresentedGroup
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_37sage, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_sage, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[196])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_sage, __pyx_t_11) < 0) __PYX_ERR(8, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":420
 *         return F/rels
 * 
 *     def character_variety_vars_and_polys(self, as_ideal=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of variables and a list polynomials where the
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_39character_variety_vars_and_polys, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup_character_vari, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[197])); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup, __pyx_mstate_global->__pyx_n_u_character_variety_vars_and_polys, __pyx_t_11) < 0) __PYX_ERR(8, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_41__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[198])); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CFundamentalGroup_43__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CFundamentalGroup___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[199])); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < 0) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/fundamental_group.pyx":459
 * 
 * 
 * class FundamentalGroup(CFundamentalGroup):             # <<<<<<<<<<<<<<
 *     """
 *     A FundamentalGroup represents a presentation of the fundamental
*/
  __pyx_t_11 = PyTuple_Pack(1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CFundamentalGroup)); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_FundamentalGroup, __pyx_mstate_global->__pyx_n_u_FundamentalGroup, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_A_FundamentalGroup_represents_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(8, 459, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FundamentalGroup, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FundamentalGroup, __pyx_t_11) < 0) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/fundamental_group.pyx":479
 * 
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     from sage.structure.sage_object import SageObject
 *     FundamentalGroup.__bases__ += (SageObject,)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(8, 479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_16) {

    /* "cython/core/fundamental_group.pyx":480
 * 
 * if _within_sage:
 *     from sage.structure.sage_object import SageObject             # <<<<<<<<<<<<<<
 *     FundamentalGroup.__bases__ += (SageObject,)
 * 
*/
    __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_SageObject); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_structure_sage_object, __pyx_t_3, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SageObject); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SageObject, __pyx_t_3) < 0) __PYX_ERR(8, 480, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/fundamental_group.pyx":481
 * if _within_sage:
 *     from sage.structure.sage_object import SageObject
 *     FundamentalGroup.__bases__ += (SageObject,)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FundamentalGroup); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_bases); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SageObject); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 481, __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;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FundamentalGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bases, __pyx_t_5) < 0) __PYX_ERR(8, 481, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/fundamental_group.pyx":479
 * 
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     from sage.structure.sage_object import SageObject
 *     FundamentalGroup.__bases__ += (SageObject,)
*/
  }

  /* "cython/core/fundamental_group.pyx":486
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):
 *     def _matrix(self, word, group):             # <<<<<<<<<<<<<<
 *         """
 *         Returns  SL2C(word) if group == 'M' or O31(word) if group == 'O'
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14CHolonomyGroup_1_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CHolonomyGroup__matrix, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[200])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CHolonomyGroup, __pyx_mstate_global->__pyx_n_u_matrix_2, __pyx_t_4) < 0) __PYX_ERR(8, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/fundamental_group.pyx":512
 *             return None
 * 
 *     def SL2C(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_word, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(8, 512, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14CHolonomyGroup_3SL2C, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CHolonomyGroup_SL2C, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[201])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CHolonomyGroup, __pyx_mstate_global->__pyx_n_u_SL2C, __pyx_t_5) < 0) __PYX_ERR(8, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/fundamental_group.pyx":522
 *         return self._matrix(word, 'M')
 * 
 *     def O31(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_word, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(8, 522, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14CHolonomyGroup_5O31, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CHolonomyGroup_O31, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[202])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CHolonomyGroup, __pyx_mstate_global->__pyx_n_u_O31, __pyx_t_4) < 0) __PYX_ERR(8, 522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/fundamental_group.pyx":531
 *         return self._matrix(word, 'O')
 * 
 *     def complex_length(self, word : str):             # <<<<<<<<<<<<<<
 *         """
 *         Return the complex length of the isometry represented by the
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_word, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(8, 531, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14CHolonomyGroup_7complex_length, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CHolonomyGroup_complex_length, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[203])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CHolonomyGroup, __pyx_mstate_global->__pyx_n_u_complex_length, __pyx_t_5) < 0) __PYX_ERR(8, 531, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14CHolonomyGroup_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CHolonomyGroup___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[204])); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14CHolonomyGroup_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CHolonomyGroup___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[205])); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/fundamental_group.pyx":546
 *         return None
 * 
 * class HolonomyGroup(CHolonomyGroup):             # <<<<<<<<<<<<<<
 *     """
 *     A FundamentalGroup represents a presentation of the fundamental
*/
  __pyx_t_5 = PyTuple_Pack(1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CHolonomyGroup)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_HolonomyGroup, __pyx_mstate_global->__pyx_n_u_HolonomyGroup, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_A_FundamentalGroup_represents_a_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_4 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(8, 546, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/fundamental_group.pyx":600
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_14 = __pyx_builtin_staticmethod; 
  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13HolonomyGroup_1_number_, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_mstate_global->__pyx_n_u_HolonomyGroup__number, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[206])); if (unlikely(!__pyx_t_15)) __PYX_ERR(8, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_15};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_5) < 0) __PYX_ERR(8, 600, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/fundamental_group.pyx":546
 *         return None
 * 
 * class HolonomyGroup(CHolonomyGroup):             # <<<<<<<<<<<<<<
 *     """
 *     A FundamentalGroup represents a presentation of the fundamental
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_HolonomyGroup, __pyx_t_4, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HolonomyGroup, __pyx_t_5) < 0) __PYX_ERR(8, 546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/fundamental_group.pyx":605
 * 
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     from sage.structure.sage_object import SageObject
 *     HolonomyGroup.__bases__ += (SageObject,)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_within_sage); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(8, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_16) {

    /* "cython/core/fundamental_group.pyx":606
 * 
 * if _within_sage:
 *     from sage.structure.sage_object import SageObject             # <<<<<<<<<<<<<<
 *     HolonomyGroup.__bases__ += (SageObject,)
*/
    __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_SageObject); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sage_structure_sage_object, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SageObject); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SageObject, __pyx_t_4) < 0) __PYX_ERR(8, 606, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/fundamental_group.pyx":607
 * if _within_sage:
 *     from sage.structure.sage_object import SageObject
 *     HolonomyGroup.__bases__ += (SageObject,)             # <<<<<<<<<<<<<<
*/
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_HolonomyGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_bases); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SageObject); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_HolonomyGroup); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_bases, __pyx_t_3) < 0) __PYX_ERR(8, 607, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cython/core/fundamental_group.pyx":605
 * 
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     from sage.structure.sage_object import SageObject
 *     HolonomyGroup.__bases__ += (SageObject,)
*/
  }

  /* "cython/core/symmetry_group.pyx":30
 *         self.c_symmetry_group = c_symmetry_group
 * 
 *     def is_full_group(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the full symmetry group has been found.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_5is_full_group, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_full_group, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[207])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_full_group, __pyx_t_11) < 0) __PYX_ERR(9, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":62
 *         return thePretext + theText
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the order of the symmetry group
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_9order, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_order, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[208])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_order, __pyx_t_11) < 0) __PYX_ERR(9, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":72
 *         return symmetry_group_order(self.c_symmetry_group)
 * 
 *     def is_abelian(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is abelian.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_11is_abelian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_abelian, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[209])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_abelian, __pyx_t_11) < 0) __PYX_ERR(9, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":84
 *             self.c_symmetry_group, &abelian_description))
 * 
 *     def abelian_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is abelian, return it as an AbelianGroup
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_13abelian_description, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_abelian_descriptio, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[210])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_abelian_description, __pyx_t_11) < 0) __PYX_ERR(9, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":105
 *         return AbelianGroup(elementary_divisors=coeffs)
 * 
 *     def is_dihedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is dihedral.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_15is_dihedral, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_dihedral, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[211])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_dihedral, __pyx_t_11) < 0) __PYX_ERR(9, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":115
 *         return B2B(symmetry_group_is_dihedral(self.c_symmetry_group))
 * 
 *     def is_polyhedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns whether the symmetry group is a (possibly binary)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_17is_polyhedral, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_polyhedral, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[212])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_polyhedral, __pyx_t_11) < 0) __PYX_ERR(9, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":123
 *                                                 NULL, NULL, NULL, NULL))
 * 
 *     def polyhedral_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is a (possibly binary)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_19polyhedral_description, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_polyhedral_descrip, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[213])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_polyhedral_description, __pyx_t_11) < 0) __PYX_ERR(9, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":150
 *         return name
 * 
 *     def is_S5(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns whether the group is the symmetric group on five things.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_21is_S5, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_S5, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[214])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_S5, __pyx_t_11) < 0) __PYX_ERR(9, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":156
 *         return B2B(symmetry_group_is_S5(self.c_symmetry_group))
 * 
 *     def is_direct_product(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the SymmetryGroup is a nontrivial direct
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_23is_direct_product, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_direct_product, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[215])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_direct_product, __pyx_t_11) < 0) __PYX_ERR(9, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":169
 *         return B2B(symmetry_group_is_direct_product(self.c_symmetry_group))
 * 
 *     def direct_product_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the SymmetryGroup is a nontrivial direct product with at
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_25direct_product_description, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_direct_product_des, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[216])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_direct_product_description, __pyx_t_11) < 0) __PYX_ERR(9, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":197
 *         return (factor_0, factor_1)
 * 
 *     def is_amphicheiral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the manifold has an orientation reversing symmetry.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_27is_amphicheiral, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_amphicheiral, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[217])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_amphicheiral, __pyx_t_11) < 0) __PYX_ERR(9, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":207
 *         return B2B(symmetry_group_is_amphicheiral(self.c_symmetry_group))
 * 
 *     def is_invertible_knot(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether a one-cusped has a symmetry that acts on the
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_29is_invertible_knot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_is_invertible_knot, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[218])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_is_invertible_knot, __pyx_t_11) < 0) __PYX_ERR(9, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":218
 *         return B2B(symmetry_group_invertible_knot(self.c_symmetry_group))
 * 
 *     def commutator_subgroup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the commutator subgroup of the SymmetryGroup
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_31commutator_subgroup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_commutator_subgrou, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[219])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_commutator_subgroup, __pyx_t_11) < 0) __PYX_ERR(9, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":236
 *         return comm_subgroup
 * 
 *     def abelianization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the abelianization of the symmetry group
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_33abelianization, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_abelianization, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[220])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_abelianization, __pyx_t_11) < 0) __PYX_ERR(9, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":256
 *         return abelianization.abelian_description()
 * 
 *     def center(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the center of the symmetry group
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_35center, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_center, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[221])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_center, __pyx_t_11) < 0) __PYX_ERR(9, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":276
 *         return center.abelian_description()
 * 
 *     def multiply_elements(self, i, j):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the product of group elements i and j.  The convention
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_37multiply_elements, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_multiply_elements, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[222])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_multiply_elements, __pyx_t_11) < 0) __PYX_ERR(9, 276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/symmetry_group.pyx":295
 *         return symmetry_group_product(self.c_symmetry_group, i, j)
 * 
 *     def isometries(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a detailed list of all the isometries in the symmetry group.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_39isometries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup_isometries, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[223])); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_SymmetryGroup, __pyx_mstate_global->__pyx_n_u_isometries, __pyx_t_11) < 0) __PYX_ERR(9, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_41__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[224])); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13SymmetryGroup_43__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymmetryGroup___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[225])); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < 0) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":102
 *     cdef int c_num_generators
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_1_number_, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain__number, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[226])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_11) < 0) __PYX_ERR(10, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_4 = __pyx_builtin_staticmethod; 
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_number_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_11) < 0) __PYX_ERR(10, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":108
 *     def __cinit__(self,
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,             # <<<<<<<<<<<<<<
 *                   displacement=None,
 *                   centroid_at_origin=True,
*/
  __pyx_t_11 = PyFloat_FromDouble(default_vertex_epsilon); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_mstate_global->__pyx_k__38 = __pyx_t_11;
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":184
 *             )
 * 
 *     def num_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of vertices.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_9num_vertices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_num_vertices, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[227])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_num_vertices, __pyx_t_11) < 0) __PYX_ERR(10, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":190
 *         return self.c_dirichlet_domain.num_vertices
 * 
 *     def num_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of finite (non-ideal) vertices.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_11num_finite_vertices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_num_finite_vert, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[228])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_num_finite_vertices, __pyx_t_11) < 0) __PYX_ERR(10, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":196
 *         return self.c_dirichlet_domain.num_finite_vertices
 * 
 *     def num_ideal_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of ideal vertices.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_13num_ideal_vertices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_num_ideal_verti, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[229])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_num_ideal_vertices, __pyx_t_11) < 0) __PYX_ERR(10, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":202
 *         return self.c_dirichlet_domain.num_ideal_vertices
 * 
 *     def num_edges(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of edges.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_15num_edges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_num_edges, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[230])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_num_edges, __pyx_t_11) < 0) __PYX_ERR(10, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":208
 *         return self.c_dirichlet_domain.num_edges
 * 
 *     def num_faces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of faces.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_17num_faces, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_num_faces, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[231])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_num_faces, __pyx_t_11) < 0) __PYX_ERR(10, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":214
 *         return self.c_dirichlet_domain.num_faces
 * 
 *     def in_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the radius of the largest inscribed sphere.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_19in_radius, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_in_radius, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[232])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_in_radius, __pyx_t_11) < 0) __PYX_ERR(10, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":221
 *         return self._number_(radius)
 * 
 *     def out_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the radius of the smallest circubscribed sphere.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_21out_radius, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_out_radius, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[233])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_out_radius, __pyx_t_11) < 0) __PYX_ERR(10, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":228
 *         return self._number_(radius)
 * 
 *     def spine_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the infimum of the radii (measured from the origin) of all
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_23spine_radius, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_spine_radius, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[234])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_spine_radius, __pyx_t_11) < 0) __PYX_ERR(10, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":236
 *         return self._number_(radius)
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,             # <<<<<<<<<<<<<<
 *                               full_rigor=True,
 *                               multiplicities=True,
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_25length_spectrum_dicts, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_length_spectrum, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[235])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[60]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_length_spectrum_dicts, __pyx_t_11) < 0) __PYX_ERR(10, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":303
 *         return LengthSpectrum(spectrum)
 * 
 *     def vertex_list(self, details = False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the coordinates of the vertices.  These are
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_27vertex_list, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_vertex_list, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[236])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[43]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_vertex_list_2, __pyx_t_11) < 0) __PYX_ERR(10, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":323
 *             return self._vertex_list()
 * 
 *     def _vertex_list(self):             # <<<<<<<<<<<<<<
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_29_vertex_list, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain__vertex_list, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[237])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_vertex_list, __pyx_t_11) < 0) __PYX_ERR(10, 323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":335
 *         return vertices
 * 
 *     def _vertex_data_list(self):             # <<<<<<<<<<<<<<
 *         cdef WEVertex *vertex = &self.c_dirichlet_domain.vertex_list_begin
 *         vertices = []
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_31_vertex_data_list, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain__vertex_data_li, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[238])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_vertex_data_list, __pyx_t_11) < 0) __PYX_ERR(10, 335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":350
 *         return vertices
 * 
 *     def _vertex_to_index_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns dictionary from WEVertex pointer to index of vertex.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_33_vertex_to_index_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain__vertex_to_inde, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[239])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_vertex_to_index_dict, __pyx_t_11) < 0) __PYX_ERR(10, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":365
 *         return result
 * 
 *     def _edge_to_index_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns dictionary from WEEdge pointer to index of edge.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_35_edge_to_index_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain__edge_to_index, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[240])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_edge_to_index_dict, __pyx_t_11) < 0) __PYX_ERR(10, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":380
 *         return result
 * 
 *     def face_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of faces, each represented as a dictionary with
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_37face_list, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_face_list, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[241])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_face_list, __pyx_t_11) < 0) __PYX_ERR(10, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":474
 *         return faces
 * 
 *     def edge_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of edges, each represented as a dictionar with keys
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_39edge_list, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_edge_list, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[242])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_edge_list, __pyx_t_11) < 0) __PYX_ERR(10, 474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":502
 *         return edges
 * 
 *     def view(self):             # <<<<<<<<<<<<<<
 *         if PolyhedronViewer:
 *             return ViewerWindow(PolyhedronViewer, facedicts=self.face_list(),
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_41view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_view, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[243])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_11) < 0) __PYX_ERR(10, 502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":509
 *                            'was not imported.')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Manifold computed directly from the Dirichlet
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_43manifold, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_manifold, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[244])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_manifold, __pyx_t_11) < 0) __PYX_ERR(10, 509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":524
 *         return self.triangulate(_manifold_class)
 * 
 *     def triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Triangulation computed directly from the Dirichlet
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_45triangulation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_triangulation, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[245])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_triangulation, __pyx_t_11) < 0) __PYX_ERR(10, 524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":552
 *         return M
 * 
 *     def volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the approximate volume of the DirichletDomain.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_47volume, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_volume, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[246])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_volume, __pyx_t_11) < 0) __PYX_ERR(10, 552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":564
 *         return self._number_(volume)
 * 
 *     def pairing_matrices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of the O31Matrices which pair the faces of
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_49pairing_matrices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_pairing_matrice, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[247])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_pairing_matrices, __pyx_t_11) < 0) __PYX_ERR(10, 564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":593
 *         return matrices
 * 
 *     def pairing_words(self):             # <<<<<<<<<<<<<<
 *         """
 *         Group elements which pair the faces of this DirichletDomain
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_51pairing_words, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_pairing_words, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[248])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_pairing_words, __pyx_t_11) < 0) __PYX_ERR(10, 593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":631
 *         return words
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n' % len(matrices)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_53_to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain__to_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[249])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_to_string, __pyx_t_11) < 0) __PYX_ERR(10, 631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":640
 *         return result
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_name))
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_55__reduce_ex__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain___reduce_ex, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[250])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_reduce_ex, __pyx_t_11) < 0) __PYX_ERR(10, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":643
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_name))
 * 
 *     def save(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Save the Dirichlet domain as a text file in "% Generators" format.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_57save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_save, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[251])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_save, __pyx_t_11) < 0) __PYX_ERR(10, 643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":666
 *             output.write(self._to_string().encode('ascii'))
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,             # <<<<<<<<<<<<<<
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):
 *         """
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16CDirichletDomain_59export_stl, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CDirichletDomain_export_stl, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[252])); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[61]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain, __pyx_mstate_global->__pyx_n_u_export_stl, __pyx_t_11) < 0) __PYX_ERR(10, 666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/dirichlet.pyx":703
 * 
 * 
 * class DirichletDomain(CDirichletDomain):             # <<<<<<<<<<<<<<
 *     """
 *     A DirichletDomain object represents a Dirichlet Domain of
*/
  __pyx_t_11 = PyTuple_Pack(1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CDirichletDomain)); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_DirichletDomain, __pyx_mstate_global->__pyx_n_u_DirichletDomain, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_A_DirichletDomain_object_repres); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_4 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(10, 703, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DirichletDomain, __pyx_t_4, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DirichletDomain, __pyx_t_11) < 0) __PYX_ERR(10, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __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;

  /* "cython/core/dirichlet.pyx":742
 * 
 * 
 * def _unpickle_dirichlet_domain(string, name):             # <<<<<<<<<<<<<<
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=name)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_45_unpickle_dirichlet_domain, 0, __pyx_mstate_global->__pyx_n_u_unpickle_dirichlet_domain, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[253])); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_unpickle_dirichlet_domain, __pyx_t_4) < 0) __PYX_ERR(10, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":9
 *     cdef original_indices
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(n):
 *         return number.number_to_native_number(n)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_1_number_, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood__number, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[254])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_4) < 0) __PYX_ERR(11, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_3 = __pyx_builtin_staticmethod; 
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_number_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(11, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_number_2, __pyx_t_4) < 0) __PYX_ERR(11, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":39
 *             N, N != 1 and 's' or '')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Manifold built from the current canonical triangulation.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_9manifold, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_manifold, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[255])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_manifold, __pyx_t_4) < 0) __PYX_ERR(11, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":53
 *         return M
 * 
 *     def original_index(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the index by which the Manifold identifies this cusp.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_11original_index, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_original_index, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[256])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_original_index, __pyx_t_4) < 0) __PYX_ERR(11, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":59
 *         return self.original_indices[which_cusp]
 * 
 *     def check_index(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Raises an IndexError if the cusp index is invalid.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_13check_index, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_check_index, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[257])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_check_index, __pyx_t_4) < 0) __PYX_ERR(11, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":70
 *                              'exist.' % which_cusp)
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of cusps.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_15num_cusps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_num_cusps, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[258])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_t_4) < 0) __PYX_ERR(11, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":76
 *         return self._num_cusps
 * 
 *     def topology(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the topological type of the specified cusp.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_17topology, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_topology, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[259])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_topology, __pyx_t_4) < 0) __PYX_ERR(11, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":84
 *         return CuspTopology[topology]
 * 
 *     def get_displacement(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement of the horospherical boundary of the
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_19get_displacement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_get_displaceme, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[260])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_get_displacement, __pyx_t_4) < 0) __PYX_ERR(11, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":99
 *         return self._number_(disp)
 * 
 *     def set_displacement(self, new_displacement, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Set the displacement of the specified cusp.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_21set_displacement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_set_displaceme, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[261])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_set_displacement, __pyx_t_4) < 0) __PYX_ERR(11, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":107
 *                                            N, Object2Real(new_displacement))
 * 
 *     def stopping_displacement(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement at which the specified cusp
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_23stopping_displacement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_stopping_displ, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[262])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_stopping_displacement, __pyx_t_4) < 0) __PYX_ERR(11, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":118
 *         return self._number_(disp)
 * 
 *     def stopper(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Return the index of the cusp which will be the first one that
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_25stopper, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_stopper, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[263])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_stopper, __pyx_t_4) < 0) __PYX_ERR(11, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":128
 *             self.c_cusp_neighborhood, N)
 * 
 *     def reach(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the displacement at which the specified cusp
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_27reach, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_reach, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[264])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_reach, __pyx_t_4) < 0) __PYX_ERR(11, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":139
 *         return self._number_(reach)
 * 
 *     def max_reach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the maximum reach over all cusps.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_29max_reach, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_max_reach, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[265])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_max_reach, __pyx_t_4) < 0) __PYX_ERR(11, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":147
 *         return self._number_(reach)
 * 
 *     def get_tie(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Return True if the specified cusp is a member of the tied group.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_31get_tie, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_get_tie, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[266])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_get_tie, __pyx_t_4) < 0) __PYX_ERR(11, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":155
 *         return get_cusp_neighborhood_tie(self.c_cusp_neighborhood, N)
 * 
 *     def set_tie(self, which_cusp, new_tie):             # <<<<<<<<<<<<<<
 *         """
 *         Mark the specified cusp as a member of the tied group.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_33set_tie, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_set_tie, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[267])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_set_tie, __pyx_t_4) < 0) __PYX_ERR(11, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":162
 *         set_cusp_neighborhood_tie(self.c_cusp_neighborhood, N, new_tie)
 * 
 *     def volume(self, which_cusp=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the volume of the horoball neighborhood of the specified
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_35volume, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_volume, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[268])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_volume, __pyx_t_4) < 0) __PYX_ERR(11, 162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":172
 *         return self._number_(volume)
 * 
 *     def translations(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the (complex) Euclidean translations of the meridian
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_37translations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_translations, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[269])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[49]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_translations, __pyx_t_4) < 0) __PYX_ERR(11, 172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":190
 *         return self._number_(M), self._number_(L)
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,             # <<<<<<<<<<<<<<
 *                   high_precision=False):
 *         """
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_39horoballs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_horoballs, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[270])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[62]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_horoballs, __pyx_t_4) < 0) __PYX_ERR(11, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":225
 *         return result
 * 
 *     def Ford_domain(self, which_cusp=0, high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of pairs of complex numbers describing the
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_41Ford_domain, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_Ford_domain, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[271])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[59]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_Ford_domain, __pyx_t_4) < 0) __PYX_ERR(11, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":257
 *         return result
 * 
 *     def triangulation(self, which_cusp=0, high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of dictionaries describing the endpoints of the
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_43triangulation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_triangulation, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[272])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[59]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_triangulation, __pyx_t_4) < 0) __PYX_ERR(11, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":289
 *         return result
 * 
 *     def view(self, which_cusp=0, cutoff=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a 3D picture of the horoball packing.  One can specify
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_45view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood_view, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[273])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[63]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < 0) __PYX_ERR(11, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_47__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[274])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_17CCuspNeighborhood_49__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CCuspNeighborhood___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[275])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(7, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":309
 * 
 * 
 * class CuspNeighborhood(CCuspNeighborhood):             # <<<<<<<<<<<<<<
 *     """
 *     A CuspNeighborhood object represents an equivariant collection of
*/
  __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_CCuspNeighborhood)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(11, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_CuspNeighborhood, __pyx_mstate_global->__pyx_n_u_CuspNeighborhood, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_A_CuspNeighborhood_object_repre); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(11, 309, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_CuspNeighborhood, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CuspNeighborhood, __pyx_t_4) < 0) __PYX_ERR(11, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/pickle.pyx":27
 * from libc.math cimport floor
 * 
 * cdef IS_HUGE = <unsigned char> 1 << 7             # <<<<<<<<<<<<<<
 * cdef IS_BIG = <unsigned char> 1 << 6
 * cdef IS_COMPLETE = <unsigned char> 1 << 5
*/
  __pyx_t_3 = __Pyx_PyLong_From_long((((unsigned char)1) << 7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XGOTREF(__pyx_v_8SnapPyHP_IS_HUGE);
  __Pyx_DECREF_SET(__pyx_v_8SnapPyHP_IS_HUGE, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/pickle.pyx":28
 * 
 * cdef IS_HUGE = <unsigned char> 1 << 7
 * cdef IS_BIG = <unsigned char> 1 << 6             # <<<<<<<<<<<<<<
 * cdef IS_COMPLETE = <unsigned char> 1 << 5
 * 
*/
  __pyx_t_3 = __Pyx_PyLong_From_long((((unsigned char)1) << 6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XGOTREF(__pyx_v_8SnapPyHP_IS_BIG);
  __Pyx_DECREF_SET(__pyx_v_8SnapPyHP_IS_BIG, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/pickle.pyx":29
 * cdef IS_HUGE = <unsigned char> 1 << 7
 * cdef IS_BIG = <unsigned char> 1 << 6
 * cdef IS_COMPLETE = <unsigned char> 1 << 5             # <<<<<<<<<<<<<<
 * 
 * cdef pickle_triangulation(c_Triangulation *tri):
*/
  __pyx_t_3 = __Pyx_PyLong_From_long((((unsigned char)1) << 5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XGOTREF(__pyx_v_8SnapPyHP_IS_COMPLETE);
  __Pyx_DECREF_SET(__pyx_v_8SnapPyHP_IS_COMPLETE, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":3
 * # get_triangulation
 * 
 * split_filling_info = re.compile(r'(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')             # <<<<<<<<<<<<<<
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')
 * is_link_complement1_pat = r'(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
*/
  __pyx_t_11 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_0_9_0_9};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_split_filling_info, __pyx_t_3) < 0) __PYX_ERR(3, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":4
 * 
 * split_filling_info = re.compile(r'(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')             # <<<<<<<<<<<<<<
 * is_link_complement1_pat = r'(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 * is_link_complement2_pat = r'(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\^](?P<components>[0-9]+)$'
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_b_no_lLrR};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_torus_bundle, __pyx_t_3) < 0) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":5
 * split_filling_info = re.compile(r'(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')
 * is_link_complement1_pat = r'(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'             # <<<<<<<<<<<<<<
 * is_link_complement2_pat = r'(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\^](?P<components>[0-9]+)$'
 * is_link_complement3_pat = '[lL](?P<components>[0-9]{1})(?P<crossings>[0-9]{2})(?P<index>[0-9]+)$'
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_link_complement1_pat, __pyx_mstate_global->__pyx_kp_u_P_crossings_0_9_P_components_0) < 0) __PYX_ERR(3, 5, __pyx_L1_error)

  /* "cython/core/tail.pyx":6
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')
 * is_link_complement1_pat = r'(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 * is_link_complement2_pat = r'(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\^](?P<components>[0-9]+)$'             # <<<<<<<<<<<<<<
 * is_link_complement3_pat = '[lL](?P<components>[0-9]{1})(?P<crossings>[0-9]{2})(?P<index>[0-9]+)$'
 * is_link_complement1 = re.compile(is_link_complement1_pat)
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_link_complement2_pat, __pyx_mstate_global->__pyx_kp_u_P_crossings_0_9___P_index_0_9_P) < 0) __PYX_ERR(3, 6, __pyx_L1_error)

  /* "cython/core/tail.pyx":7
 * is_link_complement1_pat = r'(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 * is_link_complement2_pat = r'(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\^](?P<components>[0-9]+)$'
 * is_link_complement3_pat = '[lL](?P<components>[0-9]{1})(?P<crossings>[0-9]{2})(?P<index>[0-9]+)$'             # <<<<<<<<<<<<<<
 * is_link_complement1 = re.compile(is_link_complement1_pat)
 * is_link_complement2 = re.compile(is_link_complement2_pat)
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_link_complement3_pat, __pyx_mstate_global->__pyx_kp_u_lL_P_components_0_9_1_P_crossin) < 0) __PYX_ERR(3, 7, __pyx_L1_error)

  /* "cython/core/tail.pyx":8
 * is_link_complement2_pat = r'(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\^](?P<components>[0-9]+)$'
 * is_link_complement3_pat = '[lL](?P<components>[0-9]{1})(?P<crossings>[0-9]{2})(?P<index>[0-9]+)$'
 * is_link_complement1 = re.compile(is_link_complement1_pat)             # <<<<<<<<<<<<<<
 * is_link_complement2 = re.compile(is_link_complement2_pat)
 * is_link_complement3 = re.compile(is_link_complement3_pat)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_link_complement1_pat); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_link_complement1, __pyx_t_3) < 0) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":9
 * is_link_complement3_pat = '[lL](?P<components>[0-9]{1})(?P<crossings>[0-9]{2})(?P<index>[0-9]+)$'
 * is_link_complement1 = re.compile(is_link_complement1_pat)
 * is_link_complement2 = re.compile(is_link_complement2_pat)             # <<<<<<<<<<<<<<
 * is_link_complement3 = re.compile(is_link_complement3_pat)
 * rolfsen_link_regexs = [is_link_complement1, is_link_complement2, is_link_complement3]
*/
  __pyx_t_11 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_link_complement2_pat); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_link_complement2, __pyx_t_3) < 0) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":10
 * is_link_complement1 = re.compile(is_link_complement1_pat)
 * is_link_complement2 = re.compile(is_link_complement2_pat)
 * is_link_complement3 = re.compile(is_link_complement3_pat)             # <<<<<<<<<<<<<<
 * rolfsen_link_regexs = [is_link_complement1, is_link_complement2, is_link_complement3]
 * is_HT_knot = re.compile('(?P<crossings>[0-9]+)(?P<alternation>[an])(?P<index>[0-9]+)$')
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_link_complement3_pat); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_link_complement3, __pyx_t_3) < 0) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":11
 * is_link_complement2 = re.compile(is_link_complement2_pat)
 * is_link_complement3 = re.compile(is_link_complement3_pat)
 * rolfsen_link_regexs = [is_link_complement1, is_link_complement2, is_link_complement3]             # <<<<<<<<<<<<<<
 * is_HT_knot = re.compile('(?P<crossings>[0-9]+)(?P<alternation>[an])(?P<index>[0-9]+)$')
 * is_braid_complement = re.compile(r'[Bb]raid[:]?(\[[0-9, \-]+\])$')
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_link_complement1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_is_link_complement2); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_link_complement3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyList_Pack(3, __pyx_t_3, __pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_rolfsen_link_regexs, __pyx_t_5) < 0) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":12
 * is_link_complement3 = re.compile(is_link_complement3_pat)
 * rolfsen_link_regexs = [is_link_complement1, is_link_complement2, is_link_complement3]
 * is_HT_knot = re.compile('(?P<crossings>[0-9]+)(?P<alternation>[an])(?P<index>[0-9]+)$')             # <<<<<<<<<<<<<<
 * is_braid_complement = re.compile(r'[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile(r'DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_P_crossings_0_9_P_alternation_a};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_HT_knot, __pyx_t_5) < 0) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":13
 * rolfsen_link_regexs = [is_link_complement1, is_link_complement2, is_link_complement3]
 * is_HT_knot = re.compile('(?P<crossings>[0-9]+)(?P<alternation>[an])(?P<index>[0-9]+)$')
 * is_braid_complement = re.compile(r'[Bb]raid[:]?(\[[0-9, \-]+\])$')             # <<<<<<<<<<<<<<
 * is_int_DT_exterior = re.compile(r'DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile(r'DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Bb_raid_0_9};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_braid_complement, __pyx_t_5) < 0) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":14
 * is_HT_knot = re.compile('(?P<crossings>[0-9]+)(?P<alternation>[an])(?P<index>[0-9]+)$')
 * is_braid_complement = re.compile(r'[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile(r'DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')             # <<<<<<<<<<<<<<
 * is_alpha_DT_exterior = re.compile(r'DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 * twister_word = r'\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
*/
  __pyx_t_11 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_DT_0_9_01};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_int_DT_exterior, __pyx_t_5) < 0) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":15
 * is_braid_complement = re.compile(r'[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile(r'DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile(r'DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')             # <<<<<<<<<<<<<<
 * twister_word = r'\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 * is_twister_bundle = re.compile(r'Bundle\(S_\{(\d+),(\d+)\},'+twister_word+r'\)')
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_DT_a_zA_Z_01};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_alpha_DT_exterior, __pyx_t_5) < 0) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":16
 * is_int_DT_exterior = re.compile(r'DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile(r'DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 * twister_word = r'\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'             # <<<<<<<<<<<<<<
 * is_twister_bundle = re.compile(r'Bundle\(S_\{(\d+),(\d+)\},'+twister_word+r'\)')
 * is_twister_splitting = re.compile(r'Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+r'\)')
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_twister_word, __pyx_mstate_global->__pyx_kp_u_abcABC__d_abcABC__d) < 0) __PYX_ERR(3, 16, __pyx_L1_error)

  /* "cython/core/tail.pyx":17
 * is_alpha_DT_exterior = re.compile(r'DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 * twister_word = r'\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 * is_twister_bundle = re.compile(r'Bundle\(S_\{(\d+),(\d+)\},'+twister_word+r'\)')             # <<<<<<<<<<<<<<
 * is_twister_splitting = re.compile(r'Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+r'\)')
 * is_isosig = re.compile(r'([a-zA-Z0-9\+\-]+)$')
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_twister_word); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_Bundle_S__d_d, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u__40); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_twister_bundle, __pyx_t_5) < 0) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":18
 * twister_word = r'\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 * is_twister_bundle = re.compile(r'Bundle\(S_\{(\d+),(\d+)\},'+twister_word+r'\)')
 * is_twister_splitting = re.compile(r'Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+r'\)')             # <<<<<<<<<<<<<<
 * is_isosig = re.compile(r'([a-zA-Z0-9\+\-]+)$')
 * is_decorated_isosig = decorated_isosig.isosig_pattern
*/
  __pyx_t_11 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_twister_word); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_Splitting_S__d_d, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u__28); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_twister_word); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = PyNumber_Add(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_mstate_global->__pyx_kp_u__40); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_14};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_twister_splitting, __pyx_t_5) < 0) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":19
 * is_twister_bundle = re.compile(r'Bundle\(S_\{(\d+),(\d+)\},'+twister_word+r'\)')
 * is_twister_splitting = re.compile(r'Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+r'\)')
 * is_isosig = re.compile(r'([a-zA-Z0-9\+\-]+)$')             # <<<<<<<<<<<<<<
 * is_decorated_isosig = decorated_isosig.isosig_pattern
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_a_zA_Z0_9};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_isosig, __pyx_t_5) < 0) __PYX_ERR(3, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":20
 * is_twister_splitting = re.compile(r'Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+r'\)')
 * is_isosig = re.compile(r'([a-zA-Z0-9\+\-]+)$')
 * is_decorated_isosig = decorated_isosig.isosig_pattern             # <<<<<<<<<<<<<<
 * 
 * # Hooks so that global module can monkey patch in modified versions
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_decorated_isosig); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_isosig_pattern); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_decorated_isosig, __pyx_t_11) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":25
 * # of the Triangulation and Manifold classes.
 * 
 * _triangulation_class = Triangulation             # <<<<<<<<<<<<<<
 * _manifold_class = Manifold
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_triangulation_class, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Triangulation)) < 0) __PYX_ERR(3, 25, __pyx_L1_error)

  /* "cython/core/tail.pyx":26
 * 
 * _triangulation_class = Triangulation
 * _manifold_class = Manifold             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_manifold_class, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8SnapPyHP_Manifold)) < 0) __PYX_ERR(3, 26, __pyx_L1_error)

  /* "cython/core/tail.pyx":29
 * 
 * 
 * def bundle_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_47bundle_from_string, 0, __pyx_mstate_global->__pyx_n_u_bundle_from_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[276])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_bundle_from_string, __pyx_t_11) < 0) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":40
 * 
 * 
 * def splitting_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_49splitting_from_string, 0, __pyx_mstate_global->__pyx_n_u_splitting_from_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[277])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_splitting_from_string, __pyx_t_11) < 0) __PYX_ERR(3, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":53
 * 
 * # Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',             # <<<<<<<<<<<<<<
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[64], __pyx_mstate_global->__pyx_n_u_m) < 0) __PYX_ERR(3, 53, __pyx_L1_error)

  /* "cython/core/tail.pyx":54
 * # Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',             # <<<<<<<<<<<<<<
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
*/
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[65], __pyx_mstate_global->__pyx_n_u_m) < 0) __PYX_ERR(3, 53, __pyx_L1_error)

  /* "cython/core/tail.pyx":55
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',             # <<<<<<<<<<<<<<
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
*/
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[66], __pyx_mstate_global->__pyx_n_u_s) < 0) __PYX_ERR(3, 53, __pyx_L1_error)

  /* "cython/core/tail.pyx":56
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',             # <<<<<<<<<<<<<<
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}
*/
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[67], __pyx_mstate_global->__pyx_n_u_v) < 0) __PYX_ERR(3, 53, __pyx_L1_error)

  /* "cython/core/tail.pyx":57
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',             # <<<<<<<<<<<<<<
 *                  (7, 1) : 'y'}
 * 
*/
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[68], __pyx_mstate_global->__pyx_n_u_x) < 0) __PYX_ERR(3, 53, __pyx_L1_error)

  /* "cython/core/tail.pyx":58
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}             # <<<<<<<<<<<<<<
 * 
 * triangulation_help = """
*/
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[69], __pyx_mstate_global->__pyx_n_u_y) < 0) __PYX_ERR(3, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_rev_spec_dict, __pyx_t_11) < 0) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":60
 *                  (7, 1) : 'y'}
 * 
 * triangulation_help = """             # <<<<<<<<<<<<<<
 *     A %s is specified by a string or a byte sequence, according to the
 *     conventions detailed in its docstring.
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_triangulation_help, __pyx_mstate_global->__pyx_kp_u_A_s_is_specified_by_a_string_or) < 0) __PYX_ERR(3, 60, __pyx_L1_error)

  /* "cython/core/tail.pyx":117
 * 
 * # Testing code for get_triangulation
 * def get_triangulation_tester():             # <<<<<<<<<<<<<<
 *     """
 *     >>> get_triangulation_tester() # doctest: +NUMERIC6
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_51get_triangulation_tester, 0, __pyx_mstate_global->__pyx_n_u_get_triangulation_tester, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[278])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_triangulation_tester, __pyx_t_11) < 0) __PYX_ERR(3, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":203
 * # crossings.
 * 
 * Alternating_numbers = {3: 1, 4: 1, 5: 2, 6: 3, 7: 7, 8: 18,             # <<<<<<<<<<<<<<
 *                        9: 41, 10: 123, 11: 367,
 *                        12: 1288, 13: 4878, 14: 19536, 15: 85263,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_1) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_int_1) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_int_2) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_6, __pyx_mstate_global->__pyx_int_3) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_int_7) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_8, __pyx_mstate_global->__pyx_int_18) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_9, __pyx_mstate_global->__pyx_int_41) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_10, __pyx_mstate_global->__pyx_int_123) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_11, __pyx_mstate_global->__pyx_int_367) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_12, __pyx_mstate_global->__pyx_int_1288) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_13, __pyx_mstate_global->__pyx_int_4878) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_14, __pyx_mstate_global->__pyx_int_19536) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_15, __pyx_mstate_global->__pyx_int_85263) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_16, __pyx_mstate_global->__pyx_int_379799) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Alternating_numbers, __pyx_t_11) < 0) __PYX_ERR(3, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":208
 *                        16: 379799}
 * 
 * Nonalternating_numbers = {8: 3, 9: 8, 10: 42, 11: 185, 12: 888,             # <<<<<<<<<<<<<<
 *                           13: 5110,
 *                           14: 27436, 15: 168030, 16: 1008906}
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_8, __pyx_mstate_global->__pyx_int_3) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_9, __pyx_mstate_global->__pyx_int_8) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_10, __pyx_mstate_global->__pyx_int_42) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_11, __pyx_mstate_global->__pyx_int_185) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_12, __pyx_mstate_global->__pyx_int_888) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_13, __pyx_mstate_global->__pyx_int_5110) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_14, __pyx_mstate_global->__pyx_int_27436) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_15, __pyx_mstate_global->__pyx_int_168030) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_16, __pyx_mstate_global->__pyx_int_1008906) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Nonalternating_numbers, __pyx_t_11) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":212
 *                           14: 27436, 15: 168030, 16: 1008906}
 * 
 * Alternating_offsets = {}             # <<<<<<<<<<<<<<
 * offset = 0
 * for i in range(3, 17):
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Alternating_offsets, __pyx_t_11) < 0) __PYX_ERR(3, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":213
 * 
 * Alternating_offsets = {}
 * offset = 0             # <<<<<<<<<<<<<<
 * for i in range(3, 17):
 *     Alternating_offsets[i] = offset
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_offset, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(3, 213, __pyx_L1_error)

  /* "cython/core/tail.pyx":214
 * Alternating_offsets = {}
 * offset = 0
 * for i in range(3, 17):             # <<<<<<<<<<<<<<
 *     Alternating_offsets[i] = offset
 *     offset += Alternating_numbers[i]
*/
  for (__pyx_t_17 = 3; __pyx_t_17 < 17; __pyx_t_17+=1) {
    __pyx_t_11 = PyLong_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_i, __pyx_t_11) < 0) __PYX_ERR(3, 214, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cython/core/tail.pyx":215
 * offset = 0
 * for i in range(3, 17):
 *     Alternating_offsets[i] = offset             # <<<<<<<<<<<<<<
 *     offset += Alternating_numbers[i]
 * Num_Alternating = offset
*/
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Alternating_offsets); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely((PyObject_SetItem(__pyx_t_5, __pyx_t_3, __pyx_t_11) < 0))) __PYX_ERR(3, 215, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cython/core/tail.pyx":216
 * for i in range(3, 17):
 *     Alternating_offsets[i] = offset
 *     offset += Alternating_numbers[i]             # <<<<<<<<<<<<<<
 * Num_Alternating = offset
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Alternating_numbers); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_offset, __pyx_t_5) < 0) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "cython/core/tail.pyx":217
 *     Alternating_offsets[i] = offset
 *     offset += Alternating_numbers[i]
 * Num_Alternating = offset             # <<<<<<<<<<<<<<
 * 
 * Nonalternating_offsets = {}
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Num_Alternating, __pyx_t_5) < 0) __PYX_ERR(3, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":219
 * Num_Alternating = offset
 * 
 * Nonalternating_offsets = {}             # <<<<<<<<<<<<<<
 * offset = 0
 * for i in range(8, 17):
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Nonalternating_offsets, __pyx_t_5) < 0) __PYX_ERR(3, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":220
 * 
 * Nonalternating_offsets = {}
 * offset = 0             # <<<<<<<<<<<<<<
 * for i in range(8, 17):
 *     Nonalternating_offsets[i] = offset
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_offset, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(3, 220, __pyx_L1_error)

  /* "cython/core/tail.pyx":221
 * Nonalternating_offsets = {}
 * offset = 0
 * for i in range(8, 17):             # <<<<<<<<<<<<<<
 *     Nonalternating_offsets[i] = offset
 *     offset += Nonalternating_numbers[i]
*/
  for (__pyx_t_17 = 8; __pyx_t_17 < 17; __pyx_t_17+=1) {
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_i, __pyx_t_5) < 0) __PYX_ERR(3, 221, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":222
 * offset = 0
 * for i in range(8, 17):
 *     Nonalternating_offsets[i] = offset             # <<<<<<<<<<<<<<
 *     offset += Nonalternating_numbers[i]
 * Num_Nonalternating = offset
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Nonalternating_offsets); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (unlikely((PyObject_SetItem(__pyx_t_14, __pyx_t_11, __pyx_t_5) < 0))) __PYX_ERR(3, 222, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":223
 * for i in range(8, 17):
 *     Nonalternating_offsets[i] = offset
 *     offset += Nonalternating_numbers[i]             # <<<<<<<<<<<<<<
 * Num_Nonalternating = offset
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Nonalternating_numbers); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_i); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_offset, __pyx_t_14) < 0) __PYX_ERR(3, 223, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  }

  /* "cython/core/tail.pyx":224
 *     Nonalternating_offsets[i] = offset
 *     offset += Nonalternating_numbers[i]
 * Num_Nonalternating = offset             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_offset); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Num_Nonalternating, __pyx_t_14) < 0) __PYX_ERR(3, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":227
 * 
 * 
 * def extract_HT_knot(record, crossings, alternation):             # <<<<<<<<<<<<<<
 *     DT = []
 *     size = (1+crossings)//2
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_53extract_HT_knot, 0, __pyx_mstate_global->__pyx_n_u_extract_HT_knot, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[279])); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_extract_HT_knot, __pyx_t_14) < 0) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":248
 * 
 * 
 * def get_HT_knot_DT(crossings, alternation, index):             # <<<<<<<<<<<<<<
 *     size = (1 + crossings) // 2
 *     index -= 1
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_55get_HT_knot_DT, 0, __pyx_mstate_global->__pyx_n_u_get_HT_knot_DT, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[280])); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_HT_knot_DT, __pyx_t_14) < 0) __PYX_ERR(3, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":274
 * 
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):             # <<<<<<<<<<<<<<
 *     crossings = 16
 *     if alternation == 'a':
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_57get_HT_knot_by_index, 0, __pyx_mstate_global->__pyx_n_u_get_HT_knot_by_index, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[281])); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_HT_knot_by_index, __pyx_t_14) < 0) __PYX_ERR(3, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":294
 * #   Iterators
 * 
 * class Census:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for manifold Iterators/Sequences.
*/
  __pyx_t_14 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Census, __pyx_mstate_global->__pyx_n_u_Census, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Base_class_for_manifold_Iterato); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "cython/core/tail.pyx":299
 *     """
 *     # subclasses redefine this
 *     length = 0             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, 0, 0)):
*/
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_length, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(3, 299, __pyx_L1_error)

  /* "cython/core/tail.pyx":301
 *     length = 0
 * 
 *     def __init__(self, indices=(0, 0, 0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_6Census_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Census___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[282])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[70]);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(3, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":306
 *         self.index = self.start
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_6Census_3__iter__, 0, __pyx_mstate_global->__pyx_n_u_Census___iter, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[283])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_iter, __pyx_t_3) < 0) __PYX_ERR(3, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":309
 *         return self
 * 
 *     def __contains__(self, item):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_6Census_5__contains__, 0, __pyx_mstate_global->__pyx_n_u_Census___contains, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[284])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_contains, __pyx_t_3) < 0) __PYX_ERR(3, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":312
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         if self.index >= self.stop:
 *             raise StopIteration
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_6Census_7next, 0, __pyx_mstate_global->__pyx_n_u_Census_next, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[285])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_next, __pyx_t_3) < 0) __PYX_ERR(3, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":318
 *         return self[self.index-self.step]
 * 
 *     __next__ = next             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
*/
  __pyx_t_3 = PyObject_GetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_next);
  if (unlikely(!__pyx_t_3)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_next);
  }
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_next_2, __pyx_t_3) < 0) __PYX_ERR(3, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":320
 *     __next__ = next
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_6Census_9__len__, 0, __pyx_mstate_global->__pyx_n_u_Census___len, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[286])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_len_2, __pyx_t_3) < 0) __PYX_ERR(3, 320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":324
 * 
 *     # subclasses override this
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_6Census_11__getitem__, 0, __pyx_mstate_global->__pyx_n_u_Census___getitem, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[287])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_3) < 0) __PYX_ERR(3, 324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":294
 * #   Iterators
 * 
 * class Census:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for manifold Iterators/Sequences.
*/
  __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Census, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Census, __pyx_t_3) < 0) __PYX_ERR(3, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":330
 * #  Cusped Census
 * 
 * Orientable_lengths = (301, 962, 3552, 12846, 301+962+3552+12846)             # <<<<<<<<<<<<<<
 * Nonorientable_lengths = (114, 259, 887, 114+259+887)
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Orientable_lengths, __pyx_mstate_global->__pyx_tuple[71]) < 0) __PYX_ERR(3, 330, __pyx_L1_error)

  /* "cython/core/tail.pyx":331
 * 
 * Orientable_lengths = (301, 962, 3552, 12846, 301+962+3552+12846)
 * Nonorientable_lengths = (114, 259, 887, 114+259+887)             # <<<<<<<<<<<<<<
 * 
 * five_tet_orientable = (
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Nonorientable_lengths, __pyx_mstate_global->__pyx_tuple[72]) < 0) __PYX_ERR(3, 331, __pyx_L1_error)

  /* "cython/core/tail.pyx":334
 * 
 * five_tet_orientable = (
 *    3, 4, 6, 7, 9, 10, 11, 15, 16, 17, 19, 22, 23, 26, 27, 29, 30, 32, 33,             # <<<<<<<<<<<<<<
 *    34, 35, 36, 37, 38, 39, 40, 43, 44, 45, 46, 47, 49, 52, 53, 54, 55, 58,
 *    59, 60, 61, 62, 64, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 80,
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_five_tet_orientable, __pyx_mstate_global->__pyx_tuple[73]) < 0) __PYX_ERR(3, 333, __pyx_L1_error)

  /* "cython/core/tail.pyx":357
 * 
 * five_tet_nonorientable = (
 *    0, 1, 2, 5, 8, 12, 13, 14, 18, 20, 21, 24, 25, 28, 31, 41, 42, 48, 50,             # <<<<<<<<<<<<<<
 *    51, 56, 57, 63, 65, 68, 75, 86, 88, 91, 92, 97, 101, 107, 109, 114, 124,
 *    126, 127, 128, 131, 132, 133, 134, 138, 152, 153, 156, 158, 174, 176,
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_five_tet_nonorientable, __pyx_mstate_global->__pyx_tuple[74]) < 0) __PYX_ERR(3, 356, __pyx_L1_error)

  /* "cython/core/tail.pyx":367
 * 
 * 
 * class CuspedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for manifolds in the SnapPea
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_CuspedCensus, __pyx_mstate_global->__pyx_n_u_CuspedCensus, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Base_class_for_Iterators_Sequen); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_14 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(3, 367, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":372
 *     Cusped Census.
 *     """
 *     five_length, six_length, seven_length, eight_length, length = Orientable_lengths             # <<<<<<<<<<<<<<
 *     orientability = Orientability.index('orientable')
 *     path = str(manifold_path)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Orientable_lengths); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 372, __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 != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(3, 372, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_18 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_18);
      __pyx_t_19 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_19);
    } else {
      __pyx_t_15 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 372, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_15);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 372, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 372, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_18 = __Pyx_PyList_GetItemRef(sequence, 3);
      if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 372, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_18);
      __pyx_t_19 = __Pyx_PyList_GetItemRef(sequence, 4);
      if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 372, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_19);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_15,&__pyx_t_4,&__pyx_t_2,&__pyx_t_18,&__pyx_t_19};
      for (i=0; i < 5; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(3, 372, __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[5] = {&__pyx_t_15,&__pyx_t_4,&__pyx_t_2,&__pyx_t_18,&__pyx_t_19};
    __pyx_t_20 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_21 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_20);
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_21(__pyx_t_20); if (unlikely(!item)) goto __pyx_L73_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_20), 5) < 0) __PYX_ERR(3, 372, __pyx_L1_error)
    __pyx_t_21 = NULL;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    goto __pyx_L74_unpacking_done;
    __pyx_L73_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_21 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(3, 372, __pyx_L1_error)
    __pyx_L74_unpacking_done:;
  }
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_five_length, __pyx_t_15) < 0) __PYX_ERR(3, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_six_length, __pyx_t_4) < 0) __PYX_ERR(3, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_seven_length, __pyx_t_2) < 0) __PYX_ERR(3, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_eight_length, __pyx_t_18) < 0) __PYX_ERR(3, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_19) < 0) __PYX_ERR(3, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "cython/core/tail.pyx":373
 *     """
 *     five_length, six_length, seven_length, eight_length, length = Orientable_lengths
 *     orientability = Orientability.index('orientable')             # <<<<<<<<<<<<<<
 *     path = str(manifold_path)
 * 
*/
  __pyx_t_19 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Orientability); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_mstate_global->__pyx_n_u_orientable};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_orientability, __pyx_t_3) < 0) __PYX_ERR(3, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":374
 *     five_length, six_length, seven_length, eight_length, length = Orientable_lengths
 *     orientability = Orientability.index('orientable')
 *     path = str(manifold_path)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, length, 1)):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_path, __pyx_t_2) < 0) __PYX_ERR(3, 374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":376
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 *         self.Census_Morwen8 = tarfile.open(os.path.join(manifold_path, 'morwen8.tgz'), 'r:*')
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12CuspedCensus_1__init__, 0, __pyx_mstate_global->__pyx_n_u_CuspedCensus___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[288])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_defaults)) __PYX_ERR(3, 376, __pyx_L1_error)
  __pyx_t_3 = PyObject_GetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_length);
  if (unlikely(!__pyx_t_3)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_length);
  }
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_19 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_t_3, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_2)->arg0 = __pyx_t_19;
  __Pyx_GIVEREF(__pyx_t_19);
  __pyx_t_19 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_8SnapPyHP_62__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(3, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":381
 * 
 *     # Override
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_orientable[n]
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12CuspedCensus_3lookup, 0, __pyx_mstate_global->__pyx_n_u_CuspedCensus_lookup, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[289])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_lookup, __pyx_t_2) < 0) __PYX_ERR(3, 381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":384
 *         return five_tet_orientable[n]
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_12CuspedCensus_5__getitem__, 0, __pyx_mstate_global->__pyx_n_u_CuspedCensus___getitem, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[290])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_2) < 0) __PYX_ERR(3, 384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":367
 * 
 * 
 * class CuspedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for manifolds in the SnapPea
*/
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CuspedCensus, __pyx_t_14, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CuspedCensus, __pyx_t_2) < 0) __PYX_ERR(3, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":431
 * 
 * 
 * class ObsOrientableCuspedCensus(CuspedCensus):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_CuspedCensus); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ObsOrientableCuspedCensus, __pyx_mstate_global->__pyx_n_u_ObsOrientableCuspedCensus, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Obsolete); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_14 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(3, 431, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ObsOrientableCuspedCensus, __pyx_t_14, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ObsOrientableCuspedCensus, __pyx_t_5) < 0) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":437
 * 
 * 
 * class ObsNonorientableCuspedCensus(CuspedCensus):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_CuspedCensus); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ObsNonorientableCuspedCensus, __pyx_mstate_global->__pyx_n_u_ObsNonorientableCuspedCensus, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Obsolete); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(3, 437, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":441
 *     Obsolete.
 *     """
 *     five_length, six_length, seven_length, length = Nonorientable_lengths             # <<<<<<<<<<<<<<
 *     orientability = Orientability.index('nonorientable')
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Nonorientable_lengths); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
    PyObject* sequence = __pyx_t_11;
    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(3, 441, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_19 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_19);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_18);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_19 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 441, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_19);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 441, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_18 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 441, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_18);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 3);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 441, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_19,&__pyx_t_3,&__pyx_t_18,&__pyx_t_4};
      for (i=0; i < 4; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(3, 441, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_19,&__pyx_t_3,&__pyx_t_18,&__pyx_t_4};
    __pyx_t_15 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_21 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15);
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_21(__pyx_t_15); if (unlikely(!item)) goto __pyx_L75_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_15), 4) < 0) __PYX_ERR(3, 441, __pyx_L1_error)
    __pyx_t_21 = NULL;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    goto __pyx_L76_unpacking_done;
    __pyx_L75_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_21 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(3, 441, __pyx_L1_error)
    __pyx_L76_unpacking_done:;
  }
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_five_length, __pyx_t_19) < 0) __PYX_ERR(3, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_six_length, __pyx_t_3) < 0) __PYX_ERR(3, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_seven_length, __pyx_t_18) < 0) __PYX_ERR(3, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_4) < 0) __PYX_ERR(3, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":442
 *     """
 *     five_length, six_length, seven_length, length = Nonorientable_lengths
 *     orientability = Orientability.index('nonorientable')             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, length, 1)):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Orientability); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nonorientable};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_orientability, __pyx_t_11) < 0) __PYX_ERR(3, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":444
 *     orientability = Orientability.index('nonorientable')
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_28ObsNonorientableCuspedCensus_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ObsNonorientableCuspedCensus___i, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[291])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, __pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_defaults)) __PYX_ERR(3, 444, __pyx_L1_error)
  __pyx_t_3 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_length);
  if (unlikely(!__pyx_t_3)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_length);
  }
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_t_3, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_11)->arg0 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_8SnapPyHP_64__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_11) < 0) __PYX_ERR(3, 444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":447
 *         Census.__init__(self, indices)
 * 
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_nonorientable[n]
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_28ObsNonorientableCuspedCensus_3lookup, 0, __pyx_mstate_global->__pyx_n_u_ObsNonorientableCuspedCensus_loo, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[292])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_lookup, __pyx_t_11) < 0) __PYX_ERR(3, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":437
 * 
 * 
 * class ObsNonorientableCuspedCensus(CuspedCensus):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ObsNonorientableCuspedCensus, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ObsNonorientableCuspedCensus, __pyx_t_11) < 0) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":453
 * # Closed Census (Obsolete)
 * 
 * class ObsOrientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Obsolete); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_14 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(3, 453, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":457
 *     Obsolete.
 *     """
 *     data = None             # <<<<<<<<<<<<<<
 *     orientability = Orientability.index('orientable')
 *     path = str(manifold_path)
*/
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_data, Py_None) < 0) __PYX_ERR(3, 457, __pyx_L1_error)

  /* "cython/core/tail.pyx":458
 *     """
 *     data = None
 *     orientability = Orientability.index('orientable')             # <<<<<<<<<<<<<<
 *     path = str(manifold_path)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Orientability); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_orientable};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_orientability, __pyx_t_2) < 0) __PYX_ERR(3, 458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":459
 *     data = None
 *     orientability = Orientability.index('orientable')
 *     path = str(manifold_path)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, 11031, 1)):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_18 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_path, __pyx_t_18) < 0) __PYX_ERR(3, 459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "cython/core/tail.pyx":461
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 11031, 1)):             # <<<<<<<<<<<<<<
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/
  __pyx_t_18 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_25ObsOrientableClosedCensus_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[293])); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_18, __pyx_mstate_global->__pyx_tuple[75]);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_18) < 0) __PYX_ERR(3, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "cython/core/tail.pyx":471
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/
  __pyx_t_18 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_25ObsOrientableClosedCensus_3__getitem__, 0, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus___geti, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[294])); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_18) < 0) __PYX_ERR(3, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "cython/core/tail.pyx":453
 * # Closed Census (Obsolete)
 * 
 * class ObsOrientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __pyx_t_18 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus, __pyx_t_14, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ObsOrientableClosedCensus, __pyx_t_18) < 0) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":488
 * 
 * 
 * class ObsNonorientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Obsolete); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (__pyx_t_14 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_18, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(3, 488, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":492
 *     Obsolete.
 *     """
 *     data = None             # <<<<<<<<<<<<<<
 *     orientability = Orientability.index('nonorientable')
 *     path = str(manifold_path)
*/
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_data, Py_None) < 0) __PYX_ERR(3, 492, __pyx_L1_error)

  /* "cython/core/tail.pyx":493
 *     """
 *     data = None
 *     orientability = Orientability.index('nonorientable')             # <<<<<<<<<<<<<<
 *     path = str(manifold_path)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Orientability); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nonorientable};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_orientability, __pyx_t_5) < 0) __PYX_ERR(3, 493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":494
 *     data = None
 *     orientability = Orientability.index('nonorientable')
 *     path = str(manifold_path)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, 17, 1)):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_manifold_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_path, __pyx_t_3) < 0) __PYX_ERR(3, 494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":496
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 17, 1)):             # <<<<<<<<<<<<<<
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_28ObsNonorientableClosedCensus_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus___i, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[295])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[76]);
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(3, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":506
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_28ObsNonorientableClosedCensus_3__getitem__, 0, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus___g, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[296])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_3) < 0) __PYX_ERR(3, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":488
 * 
 * 
 * class ObsNonorientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus, __pyx_t_14, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ObsNonorientableClosedCensus, __pyx_t_3) < 0) __PYX_ERR(3, 488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":525
 * # Knot tables
 * 
 * class KnotExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for knots from the
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_18 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_18, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_KnotExteriors, __pyx_mstate_global->__pyx_n_u_KnotExteriors, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Base_class_for_Iterators_Sequen_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_14 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(3, 525, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":530
 *     Hoste-Thistlethwaite tables.
 *     """
 *     length = sum(Alternating_numbers.values())             # <<<<<<<<<<<<<<
 *     alternation = 'a'
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_2 = __pyx_builtin_sum; 
  __pyx_t_19 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_Alternating_numbers); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_values); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_11) < 0) __PYX_ERR(3, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":531
 *     """
 *     length = sum(Alternating_numbers.values())
 *     alternation = 'a'             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):
*/
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_alternation, __pyx_mstate_global->__pyx_n_u_a_2) < 0) __PYX_ERR(3, 531, __pyx_L1_error)

  /* "cython/core/tail.pyx":533
 *     alternation = 'a'
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13KnotExteriors_1__init__, 0, __pyx_mstate_global->__pyx_n_u_KnotExteriors___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[297])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, __pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_defaults)) __PYX_ERR(3, 533, __pyx_L1_error)
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_5 = __pyx_builtin_sum; 
  __pyx_t_19 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_Alternating_numbers); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_values); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
    __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
    if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
  }
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_20};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_t_2, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_11)->arg0 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_8SnapPyHP_66__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_11) < 0) __PYX_ERR(3, 533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":536
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_13KnotExteriors_3__getitem__, 0, __pyx_mstate_global->__pyx_n_u_KnotExteriors___getitem, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[298])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_11) < 0) __PYX_ERR(3, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":525
 * # Knot tables
 * 
 * class KnotExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for knots from the
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_KnotExteriors, __pyx_t_14, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_KnotExteriors, __pyx_t_11) < 0) __PYX_ERR(3, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":543
 * 
 * 
 * class AlternatingKnotExteriors(KnotExteriors):             # <<<<<<<<<<<<<<
 *     """
 *     Iterator/Sequence for Alternating knot exteriors from the
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_KnotExteriors); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_18 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_18); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_AlternatingKnotExteriors, __pyx_mstate_global->__pyx_n_u_AlternatingKnotExteriors, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Iterator_Sequence_for_Alternati); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_14 != __pyx_t_18) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_18) < 0))) __PYX_ERR(3, 543, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AlternatingKnotExteriors, __pyx_t_14, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AlternatingKnotExteriors, __pyx_t_18) < 0) __PYX_ERR(3, 543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":550
 * 
 * 
 * class NonalternatingKnotExteriors(KnotExteriors):             # <<<<<<<<<<<<<<
 *     """
 *     Iterator/Sequence for nonAlternating knot exteriors from the
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_KnotExteriors); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_NonalternatingKnotExteriors, __pyx_mstate_global->__pyx_n_u_NonalternatingKnotExteriors, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Iterator_Sequence_for_nonAltern); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (__pyx_t_14 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_18, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(3, 550, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":555
 *     Hoste-Thistlethwaite tables.  Goes through 16 crossings.
 *     """
 *     length = sum(Nonalternating_numbers.values())             # <<<<<<<<<<<<<<
 *     alternation = 'n'
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_2 = __pyx_builtin_sum; 
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_Nonalternating_numbers); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_values); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
  }
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_20};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_3) < 0) __PYX_ERR(3, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":556
 *     """
 *     length = sum(Nonalternating_numbers.values())
 *     alternation = 'n'             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):
*/
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_alternation, __pyx_mstate_global->__pyx_n_u_n) < 0) __PYX_ERR(3, 556, __pyx_L1_error)

  /* "cython/core/tail.pyx":558
 *     alternation = 'n'
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_27NonalternatingKnotExteriors_1__init__, 0, __pyx_mstate_global->__pyx_n_u_NonalternatingKnotExteriors___in, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[299])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_defaults)) __PYX_ERR(3, 558, __pyx_L1_error)
  __pyx_t_20 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_5 = __pyx_builtin_sum; 
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_Nonalternating_numbers); if (unlikely(!__pyx_t_22)) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_values); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
  }
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_19};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_t_2, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_3)->arg0 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_8SnapPyHP_68__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":550
 * 
 * 
 * class NonalternatingKnotExteriors(KnotExteriors):             # <<<<<<<<<<<<<<
 *     """
 *     Iterator/Sequence for nonAlternating knot exteriors from the
*/
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NonalternatingKnotExteriors, __pyx_t_14, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NonalternatingKnotExteriors, __pyx_t_3) < 0) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":562
 * 
 * 
 * census_knot_numbers = [0, 0, 1, 2, 4, 22, 43, 129]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyList_Pack(8, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_int_22, __pyx_mstate_global->__pyx_int_43, __pyx_mstate_global->__pyx_int_129); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_census_knot_numbers, __pyx_t_14) < 0) __PYX_ERR(3, 562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":565
 * 
 * 
 * class ObsCensusKnots(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_18 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_18, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ObsCensusKnots, __pyx_mstate_global->__pyx_n_u_ObsCensusKnots, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Obsolete_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_14 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(3, 565, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":569
 *     Obsolete
 *     """
 *     length = sum(census_knot_numbers)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_2 = __pyx_builtin_sum; 
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_census_knot_numbers); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_19};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_length, __pyx_t_11) < 0) __PYX_ERR(3, 569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":571
 *     length = sum(census_knot_numbers)
 * 
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14ObsCensusKnots_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ObsCensusKnots___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[300])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, __pyx_mstate_global->__pyx_ptype_8SnapPyHP___pyx_defaults)) __PYX_ERR(3, 571, __pyx_L1_error)
  __pyx_t_19 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_5 = __pyx_builtin_sum; 
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_census_knot_numbers); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_20};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_t_2, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_11)->arg0 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_8SnapPyHP_70__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_11) < 0) __PYX_ERR(3, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":575
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'Knots in S^3 which appear in the SnapPea Census'
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14ObsCensusKnots_3__repr__, 0, __pyx_mstate_global->__pyx_n_u_ObsCensusKnots___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[301])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_11) < 0) __PYX_ERR(3, 575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":578
 *         return 'Knots in S^3 which appear in the SnapPea Census'
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14ObsCensusKnots_5__getitem__, 0, __pyx_mstate_global->__pyx_n_u_ObsCensusKnots___getitem, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[302])); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_11) < 0) __PYX_ERR(3, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cython/core/tail.pyx":565
 * 
 * 
 * class ObsCensusKnots(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_ObsCensusKnots, __pyx_t_14, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ObsCensusKnots, __pyx_t_11) < 0) __PYX_ERR(3, 565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":605
 * 
 * 
 * class ObsLinkExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_18 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_18); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ObsLinkExteriors, __pyx_mstate_global->__pyx_n_u_ObsLinkExteriors, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Obsolete); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_14 != __pyx_t_18) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_18) < 0))) __PYX_ERR(3, 605, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "cython/core/tail.pyx":611
 *     # num_links[component][crossings] is the number of links with
 *     # specified number of components and crossings.
 *     num_links= [[], [0, 0, 0, 1, 1, 2, 3, 7, 21, 49, 166, 552],             # <<<<<<<<<<<<<<
 *                 [0, 0, 0, 0, 1, 1, 3, 8, 16, 61, 183],
 *                 [0, 0, 0, 0, 0, 0, 3, 1, 10, 21, 74],
*/
  __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_5 = __Pyx_PyList_Pack(12, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_int_21, __pyx_mstate_global->__pyx_int_49, __pyx_mstate_global->__pyx_int_166, __pyx_mstate_global->__pyx_int_552); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "cython/core/tail.pyx":612
 *     # specified number of components and crossings.
 *     num_links= [[], [0, 0, 0, 1, 1, 2, 3, 7, 21, 49, 166, 552],
 *                 [0, 0, 0, 0, 1, 1, 3, 8, 16, 61, 183],             # <<<<<<<<<<<<<<
 *                 [0, 0, 0, 0, 0, 0, 3, 1, 10, 21, 74],
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 24],
*/
  __pyx_t_2 = __Pyx_PyList_Pack(11, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_8, __pyx_mstate_global->__pyx_int_16, __pyx_mstate_global->__pyx_int_61, __pyx_mstate_global->__pyx_int_183); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/tail.pyx":613
 *     num_links= [[], [0, 0, 0, 1, 1, 2, 3, 7, 21, 49, 166, 552],
 *                 [0, 0, 0, 0, 1, 1, 3, 8, 16, 61, 183],
 *                 [0, 0, 0, 0, 0, 0, 3, 1, 10, 21, 74],             # <<<<<<<<<<<<<<
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 24],
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3]]
*/
  __pyx_t_20 = __Pyx_PyList_Pack(11, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_10, __pyx_mstate_global->__pyx_int_21, __pyx_mstate_global->__pyx_int_74); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);

  /* "cython/core/tail.pyx":614
 *                 [0, 0, 0, 0, 1, 1, 3, 8, 16, 61, 183],
 *                 [0, 0, 0, 0, 0, 0, 3, 1, 10, 21, 74],
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 24],             # <<<<<<<<<<<<<<
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3]]
 * 
*/
  __pyx_t_19 = __Pyx_PyList_Pack(11, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_24); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "cython/core/tail.pyx":615
 *                 [0, 0, 0, 0, 0, 0, 3, 1, 10, 21, 74],
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 24],
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3]]             # <<<<<<<<<<<<<<
 * 
 *     max_crossings = 11
*/
  __pyx_t_15 = __Pyx_PyList_Pack(11, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "cython/core/tail.pyx":611
 *     # num_links[component][crossings] is the number of links with
 *     # specified number of components and crossings.
 *     num_links= [[], [0, 0, 0, 1, 1, 2, 3, 7, 21, 49, 166, 552],             # <<<<<<<<<<<<<<
 *                 [0, 0, 0, 0, 1, 1, 3, 8, 16, 61, 183],
 *                 [0, 0, 0, 0, 0, 0, 3, 1, 10, 21, 74],
*/
  __pyx_t_4 = __Pyx_PyList_Pack(6, __pyx_t_18, __pyx_t_5, __pyx_t_2, __pyx_t_20, __pyx_t_19, __pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_num_links, __pyx_t_4) < 0) __PYX_ERR(3, 611, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":617
 *                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3]]
 * 
 *     max_crossings = 11             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, components, indices=(0, 10000, 1)):
*/
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_max_crossings, __pyx_mstate_global->__pyx_int_11) < 0) __PYX_ERR(3, 617, __pyx_L1_error)

  /* "cython/core/tail.pyx":619
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0, 10000, 1)):             # <<<<<<<<<<<<<<
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16ObsLinkExteriors_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ObsLinkExteriors___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[303])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[77]);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(3, 619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":634
 *                                indices[2]))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('Christy census of %s-component link complements '
 *                 'in S^3' % self.components)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16ObsLinkExteriors_3__repr__, 0, __pyx_mstate_global->__pyx_n_u_ObsLinkExteriors___repr, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[304])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_repr_2, __pyx_t_4) < 0) __PYX_ERR(3, 634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":638
 *                 'in S^3' % self.components)
 * 
 *     def __getitem__(self, j):             # <<<<<<<<<<<<<<
 *         if isinstance(j, slice):
 *             return self.__class__(j.indices(self.length))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_16ObsLinkExteriors_5__getitem__, 0, __pyx_mstate_global->__pyx_n_u_ObsLinkExteriors___getitem, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[305])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_4) < 0) __PYX_ERR(3, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":605
 * 
 * 
 * class ObsLinkExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ObsLinkExteriors, __pyx_t_14, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ObsLinkExteriors, __pyx_t_4) < 0) __PYX_ERR(3, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":671
 * # ----------------------------------------------------------------
 * 
 * class MorwenLinks:             # <<<<<<<<<<<<<<
 *     def __init__(self, num_components, num_crossings = None):
 *         raise ValueError(
*/
  __pyx_t_14 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_MorwenLinks, __pyx_mstate_global->__pyx_n_u_MorwenLinks, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, (PyObject *) NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "cython/core/tail.pyx":672
 * 
 * class MorwenLinks:
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'The MorwenLinks class has been replaced by HTLinkExteriors. '
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_11MorwenLinks_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MorwenLinks___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[306])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[39]);
  if (__Pyx_SetNameInClass(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(3, 672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":671
 * # ----------------------------------------------------------------
 * 
 * class MorwenLinks:             # <<<<<<<<<<<<<<
 *     def __init__(self, num_components, num_crossings = None):
 *         raise ValueError(
*/
  __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_MorwenLinks, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_14, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MorwenLinks, __pyx_t_3) < 0) __PYX_ERR(3, 671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":679
 * 
 * 
 * def left_pad_string(str,  length, pad=' '):             # <<<<<<<<<<<<<<
 *     return pad*(length - len(str)) + str
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_59left_pad_string, 0, __pyx_mstate_global->__pyx_n_u_left_pad_string, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[307])); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[78]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_left_pad_string, __pyx_t_14) < 0) __PYX_ERR(3, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":683
 * 
 * 
 * class ObsMorwenLinks(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Census); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = PyTuple_Pack(1, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ObsMorwenLinks, __pyx_mstate_global->__pyx_n_u_ObsMorwenLinks, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_kp_u_Obsolete); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_14 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(3, 683, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":687
 *     Obsolete.
 *     """
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         if num_components < 0:
 *             return
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14ObsMorwenLinks_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ObsMorwenLinks___init, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[308])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[39]);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(3, 687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":713
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             SC = self.__class__(-1)
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_14ObsMorwenLinks_3__getitem__, 0, __pyx_mstate_global->__pyx_n_u_ObsMorwenLinks___getitem, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[309])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_3) < 0) __PYX_ERR(3, 713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":683
 * 
 * 
 * class ObsMorwenLinks(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
*/
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ObsMorwenLinks, __pyx_t_14, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ObsMorwenLinks, __pyx_t_3) < 0) __PYX_ERR(3, 683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":753
 * # Link Editor support
 * 
 * strandtype = {'X': KLPStrandX, 'Y': KLPStrandY}             # <<<<<<<<<<<<<<
 * signtype = {'R': KLPHalfTwistCL, 'L': KLPHalfTwistCCL}
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_PyLong_From_KLPStrandType(KLPStrandX); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_X, __pyx_t_11) < 0) __PYX_ERR(3, 753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyLong_From_KLPStrandType(KLPStrandY); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Y, __pyx_t_11) < 0) __PYX_ERR(3, 753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_strandtype, __pyx_t_14) < 0) __PYX_ERR(3, 753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":754
 * 
 * strandtype = {'X': KLPStrandX, 'Y': KLPStrandY}
 * signtype = {'R': KLPHalfTwistCL, 'L': KLPHalfTwistCCL}             # <<<<<<<<<<<<<<
 * 
 * cdef c_Triangulation* get_triangulation_from_PythonKLP(pythonklp, remove_finite_vertices=True) except *:
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_PyLong_From_KLPCrossingType(KLPHalfTwistCL); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_R, __pyx_t_11) < 0) __PYX_ERR(3, 754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyLong_From_KLPCrossingType(KLPHalfTwistCCL); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_L, __pyx_t_11) < 0) __PYX_ERR(3, 754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_signtype, __pyx_t_14) < 0) __PYX_ERR(3, 754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_PresentationMatrix(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8SnapPyHP_61__pyx_unpickle_PresentationMatrix, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_PresentationMatri, NULL, __pyx_mstate_global->__pyx_n_u_SnapPyHP, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[310])); if (unlikely(!__pyx_t_14)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_PresentationMatri, __pyx_t_14) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "SnapPyHP.pyx":1
 * # distutils: language = c++             # <<<<<<<<<<<<<<
 * # cython: language_level=3str
 * # cython: embedsignature = False
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(103); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__remove_finite_ver_2, __pyx_mstate_global->__pyx_kp_u_Removing_any_finite_vertices_by) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_plink_line_343, __pyx_mstate_global->__pyx_kp_u_Brings_up_a_link_editor_window) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_num_cusps_line_387, __pyx_mstate_global->__pyx_kp_u_Return_the_total_number_of_cusp) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__num_fake_cusps_li, __pyx_mstate_global->__pyx_kp_u_Returns_the_number_of_fake_cusp) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_orientation_cover_2, __pyx_mstate_global->__pyx_kp_u_For_a_non_orientable_Triangulat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_is_orientable_line, __pyx_mstate_global->__pyx_kp_u_Return_whether_the_underlying_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_copy_line_466, __pyx_mstate_global->__pyx_kp_u_Returns_a_copy_of_the_triangula) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_randomize_line_483, __pyx_mstate_global->__pyx_kp_u_Perform_random_Pachner_moves_on) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_simplify_line_497, __pyx_mstate_global->__pyx_kp_u_Try_to_simplify_the_triangulati) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_with_hyperbolic_st_2, __pyx_mstate_global->__pyx_kp_u_Add_a_possibly_degenerate_hyper) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_save_line_653, __pyx_mstate_global->__pyx_kp_u_Save_the_triangulation_as_a_Sna) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__to_string_line_67, __pyx_mstate_global->__pyx_kp_u_Return_a_string_containing_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__from_string_line, __pyx_mstate_global->__pyx_kp_u_WARNING_Users_should_not_use_th) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__to_bytes_line_723, __pyx_mstate_global->__pyx_kp_u_Return_a_reasonably_short_byte) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__from_bytes_line_7, __pyx_mstate_global->__pyx_kp_u_Fill_an_empty_triangulation_fro) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__from_tetrahedra_g_2, __pyx_mstate_global->__pyx_kp_u_data_1_1_2_2_0_1_3_2_2_3_1_0_0) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__from_isosig_line, __pyx_mstate_global->__pyx_kp_u_WARNING_Users_should_not_use_th_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation___reduce___line_88, __pyx_mstate_global->__pyx_kp_u_Used_by_pickle_dumps_from_pickl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__reindex_cusps_lin, __pyx_mstate_global->__pyx_kp_u_import_itertools_M_Manifold_L14) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__isomorphisms_to_l, __pyx_mstate_global->__pyx_kp_u_Returns_a_complete_list_of_comb) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_name_line_1081, __pyx_mstate_global->__pyx_kp_u_Return_the_name_of_the_triangul) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_set_name_line_1093, __pyx_mstate_global->__pyx_kp_u_Give_the_triangulation_a_new_na) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_DT_code_line_1108, __pyx_mstate_global->__pyx_kp_u_Return_the_Dowker_Thistlethwait) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_num_tetrahedra_lin, __pyx_mstate_global->__pyx_kp_u_Return_the_number_of_tetrahedra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_dehn_fill_line_116, __pyx_mstate_global->__pyx_kp_u_Set_the_Dehn_filling_coefficien) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_cusp_info_line_123, __pyx_mstate_global->__pyx_kp_u_Returns_an_info_object_containi) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_reverse_orientatio_2, __pyx_mstate_global->__pyx_kp_u_Reverses_the_orientation_of_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_filled_triangulati_2, __pyx_mstate_global->__pyx_kp_u_Return_a_new_manifold_where_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation__unsimplified_fill_2, __pyx_mstate_global->__pyx_kp_u_For_a_Triangulation_that_descri) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_edge_valences_line, __pyx_mstate_global->__pyx_kp_u_Returns_a_dictionary_whose_keys) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_gluing_equations_p_2, __pyx_mstate_global->__pyx_kp_u_Returns_a_NeumannZagierTypeEqua) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_ptolemy_obstructio_2, __pyx_mstate_global->__pyx_kp_u_Returns_the_obstruction_classes) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_ptolemy_generalize_2, __pyx_mstate_global->__pyx_kp_u_Returns_the_obstruction_classes_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_ptolemy_variety_li, __pyx_mstate_global->__pyx_kp_u_M_ptolemy_variety_N_obstruction) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_gluing_equations_l, __pyx_mstate_global->__pyx_kp_u_In_the_default_mode_this_functi) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_homology_line_2311, __pyx_mstate_global->__pyx_kp_u_Returns_an_class_AbelianGroup_r) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_fundamental_group_2, __pyx_mstate_global->__pyx_kp_u_Returns_a_class_FundamentalGrou) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_cover_line_2395, __pyx_mstate_global->__pyx_kp_u_Returns_a_class_Triangulation_r) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_covers_line_2497, __pyx_mstate_global->__pyx_kp_u_Returns_a_list_of_Triangulation) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_has_finite_vertice_2, __pyx_mstate_global->__pyx_kp_u_Returns_True_if_and_only_if_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_triangulation_isos_2, __pyx_mstate_global->__pyx_kp_u_Returns_the_decorated_isomorphi) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Triangulation_symplectic_basis_l, __pyx_mstate_global->__pyx_kp_u_Extend_the_Neumann_Zagier_matri) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_canonize_line_146, __pyx_mstate_global->__pyx_kp_u_Change_the_triangulation_to_an) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold__canonical_retriangulat_2, __pyx_mstate_global->__pyx_kp_u_If_this_triangulation_is_a_subd) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold__canonical_cells_are_te_2, __pyx_mstate_global->__pyx_kp_u_Returns_True_if_and_only_if_the_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold__from_string_line_267, __pyx_mstate_global->__pyx_kp_u_WARNING_Users_should_not_use_th_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold__from_bytes_line_283, __pyx_mstate_global->__pyx_kp_u_Fill_an_empty_manifold_from_a_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_copy_line_308, __pyx_mstate_global->__pyx_kp_u_Returns_a_copy_of_the_manifold) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_cusp_neighborhood_line, __pyx_mstate_global->__pyx_kp_u_Returns_information_about_the_c) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_dirichlet_domain_line_3, __pyx_mstate_global->__pyx_kp_u_Returns_a_class_DirichletDomain) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_browse_line_386, __pyx_mstate_global->__pyx_kp_u_Opens_browser_window_with_a_gra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_filled_triangulation_li, __pyx_mstate_global->__pyx_kp_u_Return_a_new_Manifold_where_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_fundamental_group_line, __pyx_mstate_global->__pyx_kp_u_Return_a_class_HolonomyGroup_re) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_symmetric_triangulation_2, __pyx_mstate_global->__pyx_kp_u_Returns_a_Dehn_filling_descript) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_cover_line_549, __pyx_mstate_global->__pyx_kp_u_Returns_a_class_Manifold_repres) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_covers_line_618, __pyx_mstate_global->__pyx_kp_u_Returns_a_list_of_class_Manifol) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_volume_line_728, __pyx_mstate_global->__pyx_kp_u_Returns_the_volume_of_the_curre) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_chern_simons_line_821, __pyx_mstate_global->__pyx_kp_u_Returns_the_Chern_Simons_invari) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_without_hyperbolic_stru_2, __pyx_mstate_global->__pyx_kp_u_Returns_self_as_a_class_Triangu) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_tetrahedra_shapes_line, __pyx_mstate_global->__pyx_kp_u_Gives_the_shapes_of_the_tetrahe) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_solution_type_line_1063, __pyx_mstate_global->__pyx_kp_u_Returns_the_type_of_the_current) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_cusp_info_line_1128, __pyx_mstate_global->__pyx_kp_u_Returns_an_info_object_containi_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_dehn_fill_line_1251, __pyx_mstate_global->__pyx_kp_u_Set_the_Dehn_filling_coefficien_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_set_peripheral_curves_l, __pyx_mstate_global->__pyx_kp_u_Each_cusp_has_a_preferred_marki) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_dual_curves_line_1403, __pyx_mstate_global->__pyx_kp_u_Constructs_a_reasonable_selecti) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_length_spectrum_line_14, __pyx_mstate_global->__pyx_kp_u_Returns_a_list_of_geodesics_wit) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_drill_line_1505, __pyx_mstate_global->__pyx_kp_u_Drills_out_the_specified_dual_c) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold__is_isometric_to_line_1, __pyx_mstate_global->__pyx_kp_u_Returns_True_if_M_and_N_are_iso) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_is_two_bridge_line_1647, __pyx_mstate_global->__pyx_kp_u_If_the_manifold_is_the_compleme) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_splitting_surfaces_line, __pyx_mstate_global->__pyx_kp_u_Searches_for_connected_closed_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Manifold_split_line_1768, __pyx_mstate_global->__pyx_kp_u_Split_the_manifold_open_along_a) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_AbelianGroup___reduce___line_82, __pyx_mstate_global->__pyx_kp_u_Used_by_the_pickle_module_to_pi) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_original_gener_2, __pyx_mstate_global->__pyx_kp_u_Return_the_original_geometric_g) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_generators_in_2, __pyx_mstate_global->__pyx_kp_u_Return_the_current_generators_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_generators_lin, __pyx_mstate_global->__pyx_kp_u_Return_the_letters_representing) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_meridian_line, __pyx_mstate_global->__pyx_kp_u_Returns_a_word_representing_a_c) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_longitude_line, __pyx_mstate_global->__pyx_kp_u_Returns_a_word_representing_a_c_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_peripheral_cur_2, __pyx_mstate_global->__pyx_kp_u_Returns_a_list_of_meridian_long) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_gap_string_lin, __pyx_mstate_global->__pyx_kp_u_Returns_a_string_which_will_def) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CFundamentalGroup_character_vari_2, __pyx_mstate_global->__pyx_kp_u_Returns_a_list_of_variables_and) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_is_full_group_line, __pyx_mstate_global->__pyx_kp_u_Return_whether_the_full_symmetr) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_order_line_62, __pyx_mstate_global->__pyx_kp_u_Return_the_order_of_the_symmetr) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_is_abelian_line_72, __pyx_mstate_global->__pyx_kp_u_Return_whether_the_symmetry_gro) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_abelian_descriptio_2, __pyx_mstate_global->__pyx_kp_u_If_the_symmetry_group_is_abelia) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_is_dihedral_line_1, __pyx_mstate_global->__pyx_kp_u_Return_whether_the_symmetry_gro_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_is_direct_product_2, __pyx_mstate_global->__pyx_kp_u_Return_whether_the_SymmetryGrou) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_direct_product_des_2, __pyx_mstate_global->__pyx_kp_u_If_the_SymmetryGroup_is_a_nontr) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_is_amphicheiral_li, __pyx_mstate_global->__pyx_kp_u_Return_whether_the_manifold_has) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_is_invertible_knot_2, __pyx_mstate_global->__pyx_kp_u_Return_whether_a_one_cusped_has) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_commutator_subgrou_2, __pyx_mstate_global->__pyx_kp_u_Return_the_commutator_subgroup) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_abelianization_lin, __pyx_mstate_global->__pyx_kp_u_Return_the_abelianization_of_th) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_center_line_256, __pyx_mstate_global->__pyx_kp_u_Return_the_center_of_the_symmet) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_multiply_elements_2, __pyx_mstate_global->__pyx_kp_u_Returns_the_product_of_group_el) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_SymmetryGroup_isometries_line_29, __pyx_mstate_global->__pyx_kp_u_Return_a_detailed_list_of_all_t) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CDirichletDomain_length_spectrum_2, __pyx_mstate_global->__pyx_kp_u_Return_a_list_of_info_objects_d) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CDirichletDomain_manifold_line_5, __pyx_mstate_global->__pyx_kp_u_Returns_a_Manifold_computed_dir) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CDirichletDomain_triangulation_l, __pyx_mstate_global->__pyx_kp_u_Returns_a_Triangulation_compute) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CDirichletDomain_pairing_matrice_2, __pyx_mstate_global->__pyx_kp_u_Returns_a_list_of_the_O31Matric) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CDirichletDomain_pairing_words_l, __pyx_mstate_global->__pyx_kp_u_Group_elements_which_pair_the_f) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CDirichletDomain_save_line_643, __pyx_mstate_global->__pyx_kp_u_Save_the_Dirichlet_domain_as_a) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CDirichletDomain_export_stl_line, __pyx_mstate_global->__pyx_kp_u_Export_the_Dirichlet_domain_as) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_CCuspNeighborhood_view_line_289, __pyx_mstate_global->__pyx_kp_u_Create_a_3D_picture_of_the_horo) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_get_triangulation_tester_line_11, __pyx_mstate_global->__pyx_kp_u_get_triangulation_tester_doctes) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_14) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_22);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init SnapPyHP", __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 SnapPyHP");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */

typedef struct {
    const char *s;
#if 11252 <= 65535
    const unsigned short n;
#elif 11252 / 2 < INT_MAX
    const unsigned int n;
#elif 11252 / 2 < LONG_MAX
    const unsigned long n;
#else
    const Py_ssize_t n;
#endif
#if 1 <= 31
    const unsigned int encoding : 5;
#elif 1 <= 255
    const unsigned char encoding;
#elif 1 <= 65535
    const unsigned short encoding;
#else
    const Py_ssize_t encoding;
#endif
    const unsigned int is_unicode : 1;
    const unsigned int intern : 1;
} __Pyx_StringTabEntry;
static const char * const __pyx_string_tab_encodings[] = { 0 };
static const __Pyx_StringTabEntry __pyx_string_tab[] = {
  {__pyx_k_, sizeof(__pyx_k_), 0, 0, 0}, /* PyObject cname: __pyx_kp_b_ */
  {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */
  {__pyx_k_0, sizeof(__pyx_k_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_0 */
  {__pyx_k_0_0, sizeof(__pyx_k_0_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_0_0 */
  {__pyx_k_0_9_0_9, sizeof(__pyx_k_0_9_0_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_0_9_0_9 */
  {__pyx_k_1, sizeof(__pyx_k_1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_1 */
  {__pyx_k_12n123, sizeof(__pyx_k_12n123), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_12n123 */
  {__pyx_k_16_14f_I, sizeof(__pyx_k_16_14f_I), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_16_14f_I */
  {__pyx_k_16n1235, sizeof(__pyx_k_16n1235), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_16n1235 */
  {__pyx_k_17_14f, sizeof(__pyx_k_17_14f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_17_14f */
  {__pyx_k_2_3_move, sizeof(__pyx_k_2_3_move), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_2_3_move */
  {__pyx_k_2d, sizeof(__pyx_k_2d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_2d */
  {__pyx_k_3_2_move, sizeof(__pyx_k_3_2_move), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_3_2_move */
  {__pyx_k_3d, sizeof(__pyx_k_3d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_3d */
  {__pyx_k_4s_40s, sizeof(__pyx_k_4s_40s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_4s_40s */
  {__pyx_k_5_2_1_3_4_1_2, sizeof(__pyx_k_5_2_1_3_4_1_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_5_2_1_3_4_1_2 */
  {__pyx_k_6_1, sizeof(__pyx_k_6_1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_6_1 */
  {__pyx_k_6s_s, sizeof(__pyx_k_6s_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_6s_s */
  {__pyx_k_8_3_3, sizeof(__pyx_k_8_3_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_8_3_3 */
  {__pyx_k_A, sizeof(__pyx_k_A), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_A */
  {__pyx_k_A_3, sizeof(__pyx_k_A_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_A_3 */
  {__pyx_k_A_CuspNeighborhood_object_repre, sizeof(__pyx_k_A_CuspNeighborhood_object_repre), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_A_CuspNeighborhood_object_repre */
  {__pyx_k_A_DirichletDomain_object_repres, sizeof(__pyx_k_A_DirichletDomain_object_repres), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_A_DirichletDomain_object_repres */
  {__pyx_k_A_FundamentalGroup_represents_a, sizeof(__pyx_k_A_FundamentalGroup_represents_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_A_FundamentalGroup_represents_a */
  {__pyx_k_A_FundamentalGroup_represents_a_2, sizeof(__pyx_k_A_FundamentalGroup_represents_a_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_A_FundamentalGroup_represents_a_2 */
  {__pyx_k_A_non_existent_shape_data_type_w, sizeof(__pyx_k_A_non_existent_shape_data_type_w), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_A_non_existent_shape_data_type_w */
  {__pyx_k_A_s_is_specified_by_a_string_or, sizeof(__pyx_k_A_s_is_specified_by_a_string_or), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_A_s_is_specified_by_a_string_or */
  {__pyx_k_AbelianGroup, sizeof(__pyx_k_AbelianGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AbelianGroup */
  {__pyx_k_AbelianGroup___reduce, sizeof(__pyx_k_AbelianGroup___reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AbelianGroup___reduce */
  {__pyx_k_AbelianGroup___reduce___line_82, sizeof(__pyx_k_AbelianGroup___reduce___line_82), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_AbelianGroup___reduce___line_82 */
  {__pyx_k_AbelianGroup_betti_number, sizeof(__pyx_k_AbelianGroup_betti_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AbelianGroup_betti_number */
  {__pyx_k_AbelianGroup_elementary_divisors, sizeof(__pyx_k_AbelianGroup_elementary_divisors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AbelianGroup_elementary_divisors */
  {__pyx_k_AbelianGroup_order, sizeof(__pyx_k_AbelianGroup_order), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AbelianGroup_order */
  {__pyx_k_AbelianGroup_rank, sizeof(__pyx_k_AbelianGroup_rank), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AbelianGroup_rank */
  {__pyx_k_Acceptable_cusp_types_are_all_or, sizeof(__pyx_k_Acceptable_cusp_types_are_all_or), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Acceptable_cusp_types_are_all_or */
  {__pyx_k_Add_a_possibly_degenerate_hyper, sizeof(__pyx_k_Add_a_possibly_degenerate_hyper), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Add_a_possibly_degenerate_hyper */
  {__pyx_k_All_Dehn_filling_coefficients_mu, sizeof(__pyx_k_All_Dehn_filling_coefficients_mu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_All_Dehn_filling_coefficients_mu */
  {__pyx_k_All_cusps_must_be_fillable, sizeof(__pyx_k_All_cusps_must_be_fillable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_All_cusps_must_be_fillable */
  {__pyx_k_All_files, sizeof(__pyx_k_All_files), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_All_files */
  {__pyx_k_All_text_files, sizeof(__pyx_k_All_text_files), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_All_text_files */
  {__pyx_k_Alphabet, sizeof(__pyx_k_Alphabet), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Alphabet */
  {__pyx_k_AlternatingKnotExteriors, sizeof(__pyx_k_AlternatingKnotExteriors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AlternatingKnotExteriors */
  {__pyx_k_Alternating_numbers, sizeof(__pyx_k_Alternating_numbers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Alternating_numbers */
  {__pyx_k_Alternating_offsets, sizeof(__pyx_k_Alternating_offsets), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Alternating_offsets */
  {__pyx_k_Alternating_table, sizeof(__pyx_k_Alternating_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Alternating_table */
  {__pyx_k_An_empty_triangulation_was_gener, sizeof(__pyx_k_An_empty_triangulation_was_gener), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_An_empty_triangulation_was_gener */
  {__pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AssertionError */
  {__pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AttributeError */
  {__pyx_k_B, sizeof(__pyx_k_B), 0, 1, 1}, /* PyObject cname: __pyx_n_u_B */
  {__pyx_k_Base_class_for_Iterators_Sequen, sizeof(__pyx_k_Base_class_for_Iterators_Sequen), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Base_class_for_Iterators_Sequen */
  {__pyx_k_Base_class_for_Iterators_Sequen_2, sizeof(__pyx_k_Base_class_for_Iterators_Sequen_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Base_class_for_Iterators_Sequen_2 */
  {__pyx_k_Base_class_for_manifold_Iterato, sizeof(__pyx_k_Base_class_for_manifold_Iterato), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Base_class_for_manifold_Iterato */
  {__pyx_k_Bb_raid_0_9, sizeof(__pyx_k_Bb_raid_0_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Bb_raid_0_9 */
  {__pyx_k_Braid, sizeof(__pyx_k_Braid), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Braid */
  {__pyx_k_Braid_1_2_1_2, sizeof(__pyx_k_Braid_1_2_1_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Braid_1_2_1_2 */
  {__pyx_k_Braids_must_have_at_least_2_stra, sizeof(__pyx_k_Braids_must_have_at_least_2_stra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Braids_must_have_at_least_2_stra */
  {__pyx_k_Brings_up_a_link_editor_window, sizeof(__pyx_k_Brings_up_a_link_editor_window), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Brings_up_a_link_editor_window */
  {__pyx_k_Browser, sizeof(__pyx_k_Browser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Browser */
  {__pyx_k_Browser_not_imported_Tk_CyOpenGL, sizeof(__pyx_k_Browser_not_imported_Tk_CyOpenGL), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Browser_not_imported_Tk_CyOpenGL */
  {__pyx_k_Bundle_S__1_1_a0_B1, sizeof(__pyx_k_Bundle_S__1_1_a0_B1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Bundle_S__1_1_a0_B1 */
  {__pyx_k_Bundle_S__d_d, sizeof(__pyx_k_Bundle_S__d_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Bundle_S__d_d */
  {__pyx_k_Byte_encoding_requires_complete, sizeof(__pyx_k_Byte_encoding_requires_complete), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Byte_encoding_requires_complete */
  {__pyx_k_C, sizeof(__pyx_k_C), 0, 1, 1}, /* PyObject cname: __pyx_n_u_C */
  {__pyx_k_CCuspNeighborhood, sizeof(__pyx_k_CCuspNeighborhood), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood */
  {__pyx_k_CCuspNeighborhood_Ford_domain, sizeof(__pyx_k_CCuspNeighborhood_Ford_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_Ford_domain */
  {__pyx_k_CCuspNeighborhood___reduce_cytho, sizeof(__pyx_k_CCuspNeighborhood___reduce_cytho), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood___reduce_cytho */
  {__pyx_k_CCuspNeighborhood___setstate_cyt, sizeof(__pyx_k_CCuspNeighborhood___setstate_cyt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood___setstate_cyt */
  {__pyx_k_CCuspNeighborhood__number, sizeof(__pyx_k_CCuspNeighborhood__number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood__number */
  {__pyx_k_CCuspNeighborhood_check_index, sizeof(__pyx_k_CCuspNeighborhood_check_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_check_index */
  {__pyx_k_CCuspNeighborhood_get_displaceme, sizeof(__pyx_k_CCuspNeighborhood_get_displaceme), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_get_displaceme */
  {__pyx_k_CCuspNeighborhood_get_tie, sizeof(__pyx_k_CCuspNeighborhood_get_tie), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_get_tie */
  {__pyx_k_CCuspNeighborhood_horoballs, sizeof(__pyx_k_CCuspNeighborhood_horoballs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_horoballs */
  {__pyx_k_CCuspNeighborhood_manifold, sizeof(__pyx_k_CCuspNeighborhood_manifold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_manifold */
  {__pyx_k_CCuspNeighborhood_max_reach, sizeof(__pyx_k_CCuspNeighborhood_max_reach), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_max_reach */
  {__pyx_k_CCuspNeighborhood_num_cusps, sizeof(__pyx_k_CCuspNeighborhood_num_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_num_cusps */
  {__pyx_k_CCuspNeighborhood_original_index, sizeof(__pyx_k_CCuspNeighborhood_original_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_original_index */
  {__pyx_k_CCuspNeighborhood_reach, sizeof(__pyx_k_CCuspNeighborhood_reach), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_reach */
  {__pyx_k_CCuspNeighborhood_set_displaceme, sizeof(__pyx_k_CCuspNeighborhood_set_displaceme), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_set_displaceme */
  {__pyx_k_CCuspNeighborhood_set_tie, sizeof(__pyx_k_CCuspNeighborhood_set_tie), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_set_tie */
  {__pyx_k_CCuspNeighborhood_stopper, sizeof(__pyx_k_CCuspNeighborhood_stopper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_stopper */
  {__pyx_k_CCuspNeighborhood_stopping_displ, sizeof(__pyx_k_CCuspNeighborhood_stopping_displ), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_stopping_displ */
  {__pyx_k_CCuspNeighborhood_topology, sizeof(__pyx_k_CCuspNeighborhood_topology), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_topology */
  {__pyx_k_CCuspNeighborhood_translations, sizeof(__pyx_k_CCuspNeighborhood_translations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_translations */
  {__pyx_k_CCuspNeighborhood_triangulation, sizeof(__pyx_k_CCuspNeighborhood_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_triangulation */
  {__pyx_k_CCuspNeighborhood_view, sizeof(__pyx_k_CCuspNeighborhood_view), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_view */
  {__pyx_k_CCuspNeighborhood_view_line_289, sizeof(__pyx_k_CCuspNeighborhood_view_line_289), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CCuspNeighborhood_view_line_289 */
  {__pyx_k_CCuspNeighborhood_volume, sizeof(__pyx_k_CCuspNeighborhood_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CCuspNeighborhood_volume */
  {__pyx_k_CDirichletDomain, sizeof(__pyx_k_CDirichletDomain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain */
  {__pyx_k_CDirichletDomain___reduce_ex, sizeof(__pyx_k_CDirichletDomain___reduce_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain___reduce_ex */
  {__pyx_k_CDirichletDomain__edge_to_index, sizeof(__pyx_k_CDirichletDomain__edge_to_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain__edge_to_index */
  {__pyx_k_CDirichletDomain__number, sizeof(__pyx_k_CDirichletDomain__number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain__number */
  {__pyx_k_CDirichletDomain__to_string, sizeof(__pyx_k_CDirichletDomain__to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain__to_string */
  {__pyx_k_CDirichletDomain__vertex_data_li, sizeof(__pyx_k_CDirichletDomain__vertex_data_li), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain__vertex_data_li */
  {__pyx_k_CDirichletDomain__vertex_list, sizeof(__pyx_k_CDirichletDomain__vertex_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain__vertex_list */
  {__pyx_k_CDirichletDomain__vertex_to_inde, sizeof(__pyx_k_CDirichletDomain__vertex_to_inde), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain__vertex_to_inde */
  {__pyx_k_CDirichletDomain_edge_list, sizeof(__pyx_k_CDirichletDomain_edge_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_edge_list */
  {__pyx_k_CDirichletDomain_export_stl, sizeof(__pyx_k_CDirichletDomain_export_stl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_export_stl */
  {__pyx_k_CDirichletDomain_export_stl_line, sizeof(__pyx_k_CDirichletDomain_export_stl_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CDirichletDomain_export_stl_line */
  {__pyx_k_CDirichletDomain_face_list, sizeof(__pyx_k_CDirichletDomain_face_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_face_list */
  {__pyx_k_CDirichletDomain_in_radius, sizeof(__pyx_k_CDirichletDomain_in_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_in_radius */
  {__pyx_k_CDirichletDomain_length_spectrum, sizeof(__pyx_k_CDirichletDomain_length_spectrum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_length_spectrum */
  {__pyx_k_CDirichletDomain_length_spectrum_2, sizeof(__pyx_k_CDirichletDomain_length_spectrum_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CDirichletDomain_length_spectrum_2 */
  {__pyx_k_CDirichletDomain_manifold, sizeof(__pyx_k_CDirichletDomain_manifold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_manifold */
  {__pyx_k_CDirichletDomain_manifold_line_5, sizeof(__pyx_k_CDirichletDomain_manifold_line_5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CDirichletDomain_manifold_line_5 */
  {__pyx_k_CDirichletDomain_num_edges, sizeof(__pyx_k_CDirichletDomain_num_edges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_num_edges */
  {__pyx_k_CDirichletDomain_num_faces, sizeof(__pyx_k_CDirichletDomain_num_faces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_num_faces */
  {__pyx_k_CDirichletDomain_num_finite_vert, sizeof(__pyx_k_CDirichletDomain_num_finite_vert), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_num_finite_vert */
  {__pyx_k_CDirichletDomain_num_ideal_verti, sizeof(__pyx_k_CDirichletDomain_num_ideal_verti), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_num_ideal_verti */
  {__pyx_k_CDirichletDomain_num_vertices, sizeof(__pyx_k_CDirichletDomain_num_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_num_vertices */
  {__pyx_k_CDirichletDomain_out_radius, sizeof(__pyx_k_CDirichletDomain_out_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_out_radius */
  {__pyx_k_CDirichletDomain_pairing_matrice, sizeof(__pyx_k_CDirichletDomain_pairing_matrice), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_pairing_matrice */
  {__pyx_k_CDirichletDomain_pairing_matrice_2, sizeof(__pyx_k_CDirichletDomain_pairing_matrice_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CDirichletDomain_pairing_matrice_2 */
  {__pyx_k_CDirichletDomain_pairing_words, sizeof(__pyx_k_CDirichletDomain_pairing_words), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_pairing_words */
  {__pyx_k_CDirichletDomain_pairing_words_l, sizeof(__pyx_k_CDirichletDomain_pairing_words_l), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CDirichletDomain_pairing_words_l */
  {__pyx_k_CDirichletDomain_save, sizeof(__pyx_k_CDirichletDomain_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_save */
  {__pyx_k_CDirichletDomain_save_line_643, sizeof(__pyx_k_CDirichletDomain_save_line_643), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CDirichletDomain_save_line_643 */
  {__pyx_k_CDirichletDomain_spine_radius, sizeof(__pyx_k_CDirichletDomain_spine_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_spine_radius */
  {__pyx_k_CDirichletDomain_triangulation, sizeof(__pyx_k_CDirichletDomain_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_triangulation */
  {__pyx_k_CDirichletDomain_triangulation_l, sizeof(__pyx_k_CDirichletDomain_triangulation_l), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CDirichletDomain_triangulation_l */
  {__pyx_k_CDirichletDomain_vertex_list, sizeof(__pyx_k_CDirichletDomain_vertex_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_vertex_list */
  {__pyx_k_CDirichletDomain_view, sizeof(__pyx_k_CDirichletDomain_view), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_view */
  {__pyx_k_CDirichletDomain_volume, sizeof(__pyx_k_CDirichletDomain_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CDirichletDomain_volume */
  {__pyx_k_CFundamentalGroup, sizeof(__pyx_k_CFundamentalGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup */
  {__pyx_k_CFundamentalGroup___reduce_cytho, sizeof(__pyx_k_CFundamentalGroup___reduce_cytho), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup___reduce_cytho */
  {__pyx_k_CFundamentalGroup___setstate_cyt, sizeof(__pyx_k_CFundamentalGroup___setstate_cyt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup___setstate_cyt */
  {__pyx_k_CFundamentalGroup__gap_init, sizeof(__pyx_k_CFundamentalGroup__gap_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup__gap_init */
  {__pyx_k_CFundamentalGroup__magma_init, sizeof(__pyx_k_CFundamentalGroup__magma_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup__magma_init */
  {__pyx_k_CFundamentalGroup__word_moves, sizeof(__pyx_k_CFundamentalGroup__word_moves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup__word_moves */
  {__pyx_k_CFundamentalGroup_character_vari, sizeof(__pyx_k_CFundamentalGroup_character_vari), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_character_vari */
  {__pyx_k_CFundamentalGroup_character_vari_2, sizeof(__pyx_k_CFundamentalGroup_character_vari_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_character_vari_2 */
  {__pyx_k_CFundamentalGroup_gap_string, sizeof(__pyx_k_CFundamentalGroup_gap_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_gap_string */
  {__pyx_k_CFundamentalGroup_gap_string_lin, sizeof(__pyx_k_CFundamentalGroup_gap_string_lin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_gap_string_lin */
  {__pyx_k_CFundamentalGroup_generators, sizeof(__pyx_k_CFundamentalGroup_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_generators */
  {__pyx_k_CFundamentalGroup_generators_in, sizeof(__pyx_k_CFundamentalGroup_generators_in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_generators_in */
  {__pyx_k_CFundamentalGroup_generators_in_2, sizeof(__pyx_k_CFundamentalGroup_generators_in_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_generators_in_2 */
  {__pyx_k_CFundamentalGroup_generators_lin, sizeof(__pyx_k_CFundamentalGroup_generators_lin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_generators_lin */
  {__pyx_k_CFundamentalGroup_longitude, sizeof(__pyx_k_CFundamentalGroup_longitude), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_longitude */
  {__pyx_k_CFundamentalGroup_longitude_line, sizeof(__pyx_k_CFundamentalGroup_longitude_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_longitude_line */
  {__pyx_k_CFundamentalGroup_magma_string, sizeof(__pyx_k_CFundamentalGroup_magma_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_magma_string */
  {__pyx_k_CFundamentalGroup_meridian, sizeof(__pyx_k_CFundamentalGroup_meridian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_meridian */
  {__pyx_k_CFundamentalGroup_meridian_line, sizeof(__pyx_k_CFundamentalGroup_meridian_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_meridian_line */
  {__pyx_k_CFundamentalGroup_num_generators, sizeof(__pyx_k_CFundamentalGroup_num_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_num_generators */
  {__pyx_k_CFundamentalGroup_num_original_g, sizeof(__pyx_k_CFundamentalGroup_num_original_g), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_num_original_g */
  {__pyx_k_CFundamentalGroup_num_relators, sizeof(__pyx_k_CFundamentalGroup_num_relators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_num_relators */
  {__pyx_k_CFundamentalGroup_original_gener, sizeof(__pyx_k_CFundamentalGroup_original_gener), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_original_gener */
  {__pyx_k_CFundamentalGroup_original_gener_2, sizeof(__pyx_k_CFundamentalGroup_original_gener_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_original_gener_2 */
  {__pyx_k_CFundamentalGroup_peripheral_cur, sizeof(__pyx_k_CFundamentalGroup_peripheral_cur), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_peripheral_cur */
  {__pyx_k_CFundamentalGroup_peripheral_cur_2, sizeof(__pyx_k_CFundamentalGroup_peripheral_cur_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CFundamentalGroup_peripheral_cur_2 */
  {__pyx_k_CFundamentalGroup_relators, sizeof(__pyx_k_CFundamentalGroup_relators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_relators */
  {__pyx_k_CFundamentalGroup_sage, sizeof(__pyx_k_CFundamentalGroup_sage), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CFundamentalGroup_sage */
  {__pyx_k_CHolonomyGroup, sizeof(__pyx_k_CHolonomyGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHolonomyGroup */
  {__pyx_k_CHolonomyGroup_O31, sizeof(__pyx_k_CHolonomyGroup_O31), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHolonomyGroup_O31 */
  {__pyx_k_CHolonomyGroup_SL2C, sizeof(__pyx_k_CHolonomyGroup_SL2C), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHolonomyGroup_SL2C */
  {__pyx_k_CHolonomyGroup___reduce_cython, sizeof(__pyx_k_CHolonomyGroup___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHolonomyGroup___reduce_cython */
  {__pyx_k_CHolonomyGroup___setstate_cython, sizeof(__pyx_k_CHolonomyGroup___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHolonomyGroup___setstate_cython */
  {__pyx_k_CHolonomyGroup__matrix, sizeof(__pyx_k_CHolonomyGroup__matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHolonomyGroup__matrix */
  {__pyx_k_CHolonomyGroup_complex_length, sizeof(__pyx_k_CHolonomyGroup_complex_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHolonomyGroup_complex_length */
  {__pyx_k_CallFuncList_function_local_F, sizeof(__pyx_k_CallFuncList_function_local_F), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CallFuncList_function_local_F */
  {__pyx_k_Can_t_compare_triangulations_of, sizeof(__pyx_k_Can_t_compare_triangulations_of), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_compare_triangulations_of */
  {__pyx_k_Can_t_get_the_list_of_isometries, sizeof(__pyx_k_Can_t_get_the_list_of_isometries), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_get_the_list_of_isometries */
  {__pyx_k_Cannot_convert_s_to_a_Real, sizeof(__pyx_k_Cannot_convert_s_to_a_Real), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cannot_convert_s_to_a_Real */
  {__pyx_k_Census, sizeof(__pyx_k_Census), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census */
  {__pyx_k_CensusKnots_s, sizeof(__pyx_k_CensusKnots_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CensusKnots_s */
  {__pyx_k_CensusKnots_tgz, sizeof(__pyx_k_CensusKnots_tgz), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CensusKnots_tgz */
  {__pyx_k_Census_Knots, sizeof(__pyx_k_Census_Knots), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census_Knots */
  {__pyx_k_Census_Morwen8, sizeof(__pyx_k_Census_Morwen8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census_Morwen8 */
  {__pyx_k_Census___contains, sizeof(__pyx_k_Census___contains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census___contains */
  {__pyx_k_Census___getitem, sizeof(__pyx_k_Census___getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census___getitem */
  {__pyx_k_Census___init, sizeof(__pyx_k_Census___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census___init */
  {__pyx_k_Census___iter, sizeof(__pyx_k_Census___iter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census___iter */
  {__pyx_k_Census___len, sizeof(__pyx_k_Census___len), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census___len */
  {__pyx_k_Census_next, sizeof(__pyx_k_Census_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Census_next */
  {__pyx_k_CertifiedShapesEngine, sizeof(__pyx_k_CertifiedShapesEngine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CertifiedShapesEngine */
  {__pyx_k_Change_the_triangulation_to_an, sizeof(__pyx_k_Change_the_triangulation_to_an), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Change_the_triangulation_to_an */
  {__pyx_k_ChristyLinks, sizeof(__pyx_k_ChristyLinks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ChristyLinks */
  {__pyx_k_ChristyLinks_s, sizeof(__pyx_k_ChristyLinks_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ChristyLinks_s */
  {__pyx_k_ChristyLinks_tgz, sizeof(__pyx_k_ChristyLinks_tgz), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ChristyLinks_tgz */
  {__pyx_k_Christy_census_of_s_component_li, sizeof(__pyx_k_Christy_census_of_s_component_li), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Christy_census_of_s_component_li */
  {__pyx_k_Christy_links, sizeof(__pyx_k_Christy_links), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Christy_links */
  {__pyx_k_ClosedCensusData, sizeof(__pyx_k_ClosedCensusData), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ClosedCensusData */
  {__pyx_k_ClosedNonorientableDistinct_txt, sizeof(__pyx_k_ClosedNonorientableDistinct_txt), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ClosedNonorientableDistinct_txt */
  {__pyx_k_ClosedOrientableDistinct_txt, sizeof(__pyx_k_ClosedOrientableDistinct_txt), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ClosedOrientableDistinct_txt */
  {__pyx_k_Communication_with_PLink_failed, sizeof(__pyx_k_Communication_with_PLink_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Communication_with_PLink_failed */
  {__pyx_k_Constructs_a_reasonable_selecti, sizeof(__pyx_k_Constructs_a_reasonable_selecti), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constructs_a_reasonable_selecti */
  {__pyx_k_CosetAction, sizeof(__pyx_k_CosetAction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CosetAction */
  {__pyx_k_Could_not_allocate_a_crossing_ta, sizeof(__pyx_k_Could_not_allocate_a_crossing_ta), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Could_not_allocate_a_crossing_ta */
  {__pyx_k_Could_not_certify_shape_interval, sizeof(__pyx_k_Could_not_certify_shape_interval), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Could_not_certify_shape_interval */
  {__pyx_k_Could_not_create_the_triangulati, sizeof(__pyx_k_Could_not_create_the_triangulati), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Could_not_create_the_triangulati */
  {__pyx_k_Cover_degree_should_be_at_least, sizeof(__pyx_k_Cover_degree_should_be_at_least), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cover_degree_should_be_at_least */
  {__pyx_k_Cover_specified_by_unrecognized, sizeof(__pyx_k_Cover_specified_by_unrecognized), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cover_specified_by_unrecognized */
  {__pyx_k_Create_a_3D_picture_of_the_horo, sizeof(__pyx_k_Create_a_3D_picture_of_the_horo), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Create_a_3D_picture_of_the_horo */
  {__pyx_k_Cusp, sizeof(__pyx_k_Cusp), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cusp */
  {__pyx_k_CuspInfo, sizeof(__pyx_k_CuspInfo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspInfo */
  {__pyx_k_CuspInfo___repr, sizeof(__pyx_k_CuspInfo___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspInfo___repr */
  {__pyx_k_CuspNeighborhood, sizeof(__pyx_k_CuspNeighborhood), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspNeighborhood */
  {__pyx_k_CuspTopology, sizeof(__pyx_k_CuspTopology), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspTopology */
  {__pyx_k_Cusp_Neighborhood_with, sizeof(__pyx_k_Cusp_Neighborhood_with), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cusp_Neighborhood_with */
  {__pyx_k_Cusp_neighborhood, sizeof(__pyx_k_Cusp_neighborhood), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cusp_neighborhood */
  {__pyx_k_CuspedCensus, sizeof(__pyx_k_CuspedCensus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspedCensus */
  {__pyx_k_CuspedCensus___getitem, sizeof(__pyx_k_CuspedCensus___getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspedCensus___getitem */
  {__pyx_k_CuspedCensus___init, sizeof(__pyx_k_CuspedCensus___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspedCensus___init */
  {__pyx_k_CuspedCensus_lookup, sizeof(__pyx_k_CuspedCensus_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CuspedCensus_lookup */
  {__pyx_k_D, sizeof(__pyx_k_D), 0, 1, 1}, /* PyObject cname: __pyx_n_u_D */
  {__pyx_k_DT, sizeof(__pyx_k_DT), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_DT */
  {__pyx_k_DT_0_9_01, sizeof(__pyx_k_DT_0_9_01), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_DT_0_9_01 */
  {__pyx_k_DT_2, sizeof(__pyx_k_DT_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_DT_2 */
  {__pyx_k_DT_3, sizeof(__pyx_k_DT_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DT_3 */
  {__pyx_k_DT_4_6_2, sizeof(__pyx_k_DT_4_6_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_DT_4_6_2 */
  {__pyx_k_DT_a_zA_Z_01, sizeof(__pyx_k_DT_a_zA_Z_01), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_DT_a_zA_Z_01 */
  {__pyx_k_DT_code, sizeof(__pyx_k_DT_code), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DT_code */
  {__pyx_k_DT_codes, sizeof(__pyx_k_DT_codes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DT_codes */
  {__pyx_k_DT_s, sizeof(__pyx_k_DT_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_DT_s */
  {__pyx_k_DTcodec, sizeof(__pyx_k_DTcodec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DTcodec */
  {__pyx_k_D_d, sizeof(__pyx_k_D_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_D_d */
  {__pyx_k_DirichletDomain, sizeof(__pyx_k_DirichletDomain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DirichletDomain */
  {__pyx_k_Dirichlet_Domain_of, sizeof(__pyx_k_Dirichlet_Domain_of), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Dirichlet_Domain_of */
  {__pyx_k_Does_not_extend_to_link, sizeof(__pyx_k_Does_not_extend_to_link), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Does_not_extend_to_link */
  {__pyx_k_Drills_out_the_specified_dual_c, sizeof(__pyx_k_Drills_out_the_specified_dual_c), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Drills_out_the_specified_dual_c */
  {__pyx_k_DualCurveInfo, sizeof(__pyx_k_DualCurveInfo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DualCurveInfo */
  {__pyx_k_DualCurveInfo___repr, sizeof(__pyx_k_DualCurveInfo___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DualCurveInfo___repr */
  {__pyx_k_E, sizeof(__pyx_k_E), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_E */
  {__pyx_k_E_2, sizeof(__pyx_k_E_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_E_2 */
  {__pyx_k_Each_cusp_has_a_preferred_marki, sizeof(__pyx_k_Each_cusp_has_a_preferred_marki), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Each_cusp_has_a_preferred_marki */
  {__pyx_k_Elementary_divisors_must_be_give, sizeof(__pyx_k_Elementary_divisors_must_be_give), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Elementary_divisors_must_be_give */
  {__pyx_k_Elementary_divisors_must_be_non, sizeof(__pyx_k_Elementary_divisors_must_be_non), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Elementary_divisors_must_be_non */
  {__pyx_k_Empty_Triangulation, sizeof(__pyx_k_Empty_Triangulation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Empty_Triangulation */
  {__pyx_k_Equations_are_available_in_log_a, sizeof(__pyx_k_Equations_are_available_in_log_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Equations_are_available_in_log_a */
  {__pyx_k_Export_the_Dirichlet_domain_as, sizeof(__pyx_k_Export_the_Dirichlet_domain_as), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Export_the_Dirichlet_domain_as */
  {__pyx_k_Extend_the_Neumann_Zagier_matri, sizeof(__pyx_k_Extend_the_Neumann_Zagier_matri), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Extend_the_Neumann_Zagier_matri */
  {__pyx_k_Extends_to_link, sizeof(__pyx_k_Extends_to_link), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Extends_to_link */
  {__pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_F */
  {__pyx_k_F_2, sizeof(__pyx_k_F_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_F_2 */
  {__pyx_k_F_FreeGroup, sizeof(__pyx_k_F_FreeGroup), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_F_FreeGroup */
  {__pyx_k_FactorCosetAction, sizeof(__pyx_k_FactorCosetAction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FactorCosetAction */
  {__pyx_k_Failed_to_allocate_memory_for_cu, sizeof(__pyx_k_Failed_to_allocate_memory_for_cu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Failed_to_allocate_memory_for_cu */
  {__pyx_k_Failed_to_allocate_memory_for_te, sizeof(__pyx_k_Failed_to_allocate_memory_for_te), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Failed_to_allocate_memory_for_te */
  {__pyx_k_Failed_to_construct_permutation, sizeof(__pyx_k_Failed_to_construct_permutation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Failed_to_construct_permutation */
  {__pyx_k_Fill_an_empty_manifold_from_a_b, sizeof(__pyx_k_Fill_an_empty_manifold_from_a_b), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Fill_an_empty_manifold_from_a_b */
  {__pyx_k_Fill_an_empty_triangulation_fro, sizeof(__pyx_k_Fill_an_empty_triangulation_fro), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Fill_an_empty_triangulation_fro */
  {__pyx_k_For_a_Triangulation_that_descri, sizeof(__pyx_k_For_a_Triangulation_that_descri), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_For_a_Triangulation_that_descri */
  {__pyx_k_For_a_non_orientable_Triangulat, sizeof(__pyx_k_For_a_non_orientable_Triangulat), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_For_a_non_orientable_Triangulat */
  {__pyx_k_Ford_domain, sizeof(__pyx_k_Ford_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Ford_domain */
  {__pyx_k_FormatHomForSnapPea, sizeof(__pyx_k_FormatHomForSnapPea), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FormatHomForSnapPea */
  {__pyx_k_FormatHomForSnapPea_function_f, sizeof(__pyx_k_FormatHomForSnapPea_function_f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_FormatHomForSnapPea_function_f */
  {__pyx_k_FreeGroup, sizeof(__pyx_k_FreeGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FreeGroup */
  {__pyx_k_FuncResult, sizeof(__pyx_k_FuncResult), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FuncResult */
  {__pyx_k_FundamentalGroup, sizeof(__pyx_k_FundamentalGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FundamentalGroup */
  {__pyx_k_G, sizeof(__pyx_k_G), 0, 1, 1}, /* PyObject cname: __pyx_n_u_G */
  {__pyx_k_GG, sizeof(__pyx_k_GG), 0, 1, 1}, /* PyObject cname: __pyx_n_u_GG */
  {__pyx_k_GapElement, sizeof(__pyx_k_GapElement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_GapElement */
  {__pyx_k_Generators, sizeof(__pyx_k_Generators), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Generators */
  {__pyx_k_GeneratorsOfGroup, sizeof(__pyx_k_GeneratorsOfGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_GeneratorsOfGroup */
  {__pyx_k_Generators_2, sizeof(__pyx_k_Generators_2), 0, 0, 0}, /* PyObject cname: __pyx_kp_b_Generators_2 */
  {__pyx_k_Generators_s, sizeof(__pyx_k_Generators_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Generators_s */
  {__pyx_k_Give_the_triangulation_a_new_na, sizeof(__pyx_k_Give_the_triangulation_a_new_na), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Give_the_triangulation_a_new_na */
  {__pyx_k_Gives_the_shapes_of_the_tetrahe, sizeof(__pyx_k_Gives_the_shapes_of_the_tetrahe), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Gives_the_shapes_of_the_tetrahe */
  {__pyx_k_Got_the_empty_link_from_PLink_a, sizeof(__pyx_k_Got_the_empty_link_from_PLink_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Got_the_empty_link_from_PLink_a */
  {__pyx_k_Group, sizeof(__pyx_k_Group), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Group */
  {__pyx_k_Group_elements_which_pair_the_f, sizeof(__pyx_k_Group_elements_which_pair_the_f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Group_elements_which_pair_the_f */
  {__pyx_k_GrpFP, sizeof(__pyx_k_GrpFP), 0, 1, 1}, /* PyObject cname: __pyx_n_u_GrpFP */
  {__pyx_k_GrpPerm, sizeof(__pyx_k_GrpPerm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_GrpPerm */
  {__pyx_k_H, sizeof(__pyx_k_H), 0, 1, 1}, /* PyObject cname: __pyx_n_u_H */
  {__pyx_k_HTLinkExteriors, sizeof(__pyx_k_HTLinkExteriors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HTLinkExteriors */
  {__pyx_k_HTWKnots, sizeof(__pyx_k_HTWKnots), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HTWKnots */
  {__pyx_k_High_precision_shapes_must_be_co, sizeof(__pyx_k_High_precision_shapes_must_be_co), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_High_precision_shapes_must_be_co */
  {__pyx_k_HolonomyGroup, sizeof(__pyx_k_HolonomyGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HolonomyGroup */
  {__pyx_k_HolonomyGroup__number, sizeof(__pyx_k_HolonomyGroup__number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HolonomyGroup__number */
  {__pyx_k_HomGrp, sizeof(__pyx_k_HomGrp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HomGrp */
  {__pyx_k_HoroballViewer, sizeof(__pyx_k_HoroballViewer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HoroballViewer */
  {__pyx_k_I, sizeof(__pyx_k_I), 0, 1, 1}, /* PyObject cname: __pyx_n_u_I */
  {__pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IOError */
  {__pyx_k_If_the_SymmetryGroup_is_a_nontr, sizeof(__pyx_k_If_the_SymmetryGroup_is_a_nontr), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_If_the_SymmetryGroup_is_a_nontr */
  {__pyx_k_If_the_manifold_is_the_compleme, sizeof(__pyx_k_If_the_manifold_is_the_compleme), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_If_the_manifold_is_the_compleme */
  {__pyx_k_If_the_symmetry_group_is_abelia, sizeof(__pyx_k_If_the_symmetry_group_is_abelia), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_If_the_symmetry_group_is_abelia */
  {__pyx_k_If_there_is_more_than_one_cusp_y, sizeof(__pyx_k_If_there_is_more_than_one_cusp_y), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_If_there_is_more_than_one_cusp_y */
  {__pyx_k_If_this_triangulation_is_a_subd, sizeof(__pyx_k_If_this_triangulation_is_a_subd), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_If_this_triangulation_is_a_subd */
  {__pyx_k_Image, sizeof(__pyx_k_Image), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Image */
  {__pyx_k_Immutable_dictionary_whose_data, sizeof(__pyx_k_Immutable_dictionary_whose_data), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Immutable_dictionary_whose_data */
  {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */
  {__pyx_k_In_the_default_mode_this_functi, sizeof(__pyx_k_In_the_default_mode_this_functi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_In_the_default_mode_this_functi */
  {__pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_checksums_0x_x_vs_0 */
  {__pyx_k_Index, sizeof(__pyx_k_Index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Index */
  {__pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IndexError */
  {__pyx_k_Index_is_out_of_range, sizeof(__pyx_k_Index_is_out_of_range), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Index_is_out_of_range */
  {__pyx_k_Info, sizeof(__pyx_k_Info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Info */
  {__pyx_k_Info___init, sizeof(__pyx_k_Info___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Info___init */
  {__pyx_k_Info__immutable, sizeof(__pyx_k_Info__immutable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Info__immutable */
  {__pyx_k_Info_keys, sizeof(__pyx_k_Info_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Info_keys */
  {__pyx_k_Info_objects_are_immutable, sizeof(__pyx_k_Info_objects_are_immutable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Info_objects_are_immutable */
  {__pyx_k_Integer, sizeof(__pyx_k_Integer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Integer */
  {__pyx_k_Invalid_generator_status, sizeof(__pyx_k_Invalid_generator_status), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_generator_status */
  {__pyx_k_Invalid_permutation_data, sizeof(__pyx_k_Invalid_permutation_data), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_permutation_data */
  {__pyx_k_Invalid_pickle_byte_sequence, sizeof(__pyx_k_Invalid_pickle_byte_sequence), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_pickle_byte_sequence */
  {__pyx_k_IsCompositionMappingRep, sizeof(__pyx_k_IsCompositionMappingRep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IsCompositionMappingRep */
  {__pyx_k_IsSubgroupFpGroup, sizeof(__pyx_k_IsSubgroupFpGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IsSubgroupFpGroup */
  {__pyx_k_IsToPermGroupHomomorphismByImage, sizeof(__pyx_k_IsToPermGroupHomomorphismByImage), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IsToPermGroupHomomorphismByImage */
  {__pyx_k_Isometry, sizeof(__pyx_k_Isometry), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Isometry */
  {__pyx_k_Isometry___init, sizeof(__pyx_k_Isometry___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Isometry___init */
  {__pyx_k_Isometry___repr, sizeof(__pyx_k_Isometry___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Isometry___repr */
  {__pyx_k_Isometry_cusp_images, sizeof(__pyx_k_Isometry_cusp_images), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Isometry_cusp_images */
  {__pyx_k_Isometry_cusp_maps, sizeof(__pyx_k_Isometry_cusp_maps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Isometry_cusp_maps */
  {__pyx_k_Isometry_extends_to_link, sizeof(__pyx_k_Isometry_extends_to_link), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Isometry_extends_to_link */
  {__pyx_k_Isometry_num_cusps, sizeof(__pyx_k_Isometry_num_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Isometry_num_cusps */
  {__pyx_k_Iterator_Sequence_for_Alternati, sizeof(__pyx_k_Iterator_Sequence_for_Alternati), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Iterator_Sequence_for_Alternati */
  {__pyx_k_Iterator_Sequence_for_nonAltern, sizeof(__pyx_k_Iterator_Sequence_for_nonAltern), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Iterator_Sequence_for_nonAltern */
  {__pyx_k_K, sizeof(__pyx_k_K), 0, 1, 1}, /* PyObject cname: __pyx_n_u_K */
  {__pyx_k_K7_1, sizeof(__pyx_k_K7_1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_K7_1 */
  {__pyx_k_KLPProjection, sizeof(__pyx_k_KLPProjection), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KLPProjection */
  {__pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KeyError */
  {__pyx_k_Klein, sizeof(__pyx_k_Klein), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Klein */
  {__pyx_k_Klein_bottle_cusp, sizeof(__pyx_k_Klein_bottle_cusp), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Klein_bottle_cusp */
  {__pyx_k_KnotExteriors, sizeof(__pyx_k_KnotExteriors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnotExteriors */
  {__pyx_k_KnotExteriors___getitem, sizeof(__pyx_k_KnotExteriors___getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnotExteriors___getitem */
  {__pyx_k_KnotExteriors___init, sizeof(__pyx_k_KnotExteriors___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnotExteriors___init */
  {__pyx_k_Knots_in_S_3_which_appear_in_the, sizeof(__pyx_k_Knots_in_S_3_which_appear_in_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Knots_in_S_3_which_appear_in_the */
  {__pyx_k_L, sizeof(__pyx_k_L), 0, 1, 1}, /* PyObject cname: __pyx_n_u_L */
  {__pyx_k_L104001, sizeof(__pyx_k_L104001), 0, 1, 1}, /* PyObject cname: __pyx_n_u_L104001 */
  {__pyx_k_L13n9331, sizeof(__pyx_k_L13n9331), 0, 1, 1}, /* PyObject cname: __pyx_n_u_L13n9331 */
  {__pyx_k_L13n9331_3_4_2_3_2_1, sizeof(__pyx_k_L13n9331_3_4_2_3_2_1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_L13n9331_3_4_2_3_2_1 */
  {__pyx_k_LE, sizeof(__pyx_k_LE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LE */
  {__pyx_k_L_d_2d_3d, sizeof(__pyx_k_L_d_2d_3d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_L_d_2d_3d */
  {__pyx_k_LengthSpectrum, sizeof(__pyx_k_LengthSpectrum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LengthSpectrum */
  {__pyx_k_LengthSpectrumFormatString, sizeof(__pyx_k_LengthSpectrumFormatString), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LengthSpectrumFormatString */
  {__pyx_k_LengthSpectrumFormatStringBase, sizeof(__pyx_k_LengthSpectrumFormatStringBase), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LengthSpectrumFormatStringBase */
  {__pyx_k_LengthSpectrumFormatStringWithWo, sizeof(__pyx_k_LengthSpectrumFormatStringWithWo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LengthSpectrumFormatStringWithWo */
  {__pyx_k_LengthSpectrumInfo, sizeof(__pyx_k_LengthSpectrumInfo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LengthSpectrumInfo */
  {__pyx_k_LengthSpectrumInfo___repr, sizeof(__pyx_k_LengthSpectrumInfo___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LengthSpectrumInfo___repr */
  {__pyx_k_LengthSpectrum___repr, sizeof(__pyx_k_LengthSpectrum___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LengthSpectrum___repr */
  {__pyx_k_Link, sizeof(__pyx_k_Link), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Link */
  {__pyx_k_LinkEditor, sizeof(__pyx_k_LinkEditor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LinkEditor */
  {__pyx_k_LinkExteriors, sizeof(__pyx_k_LinkExteriors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LinkExteriors */
  {__pyx_k_LinkManager, sizeof(__pyx_k_LinkManager), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LinkManager */
  {__pyx_k_Link_Projection, sizeof(__pyx_k_Link_Projection), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Link_Projection */
  {__pyx_k_ListOnePerLine, sizeof(__pyx_k_ListOnePerLine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ListOnePerLine */
  {__pyx_k_ListOnePerLine___repr, sizeof(__pyx_k_ListOnePerLine___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ListOnePerLine___repr */
  {__pyx_k_LowIndexSubgroups, sizeof(__pyx_k_LowIndexSubgroups), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LowIndexSubgroups */
  {__pyx_k_LowIndexSubgroupsFpGroup, sizeof(__pyx_k_LowIndexSubgroupsFpGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LowIndexSubgroupsFpGroup */
  {__pyx_k_M, sizeof(__pyx_k_M), 0, 1, 1}, /* PyObject cname: __pyx_n_u_M */
  {__pyx_k_M0, sizeof(__pyx_k_M0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_M0 */
  {__pyx_k_M1, sizeof(__pyx_k_M1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_M1 */
  {__pyx_k_MTLinks, sizeof(__pyx_k_MTLinks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MTLinks */
  {__pyx_k_M_ptolemy_variety_N_obstruction, sizeof(__pyx_k_M_ptolemy_variety_N_obstruction), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_M_ptolemy_variety_N_obstruction */
  {__pyx_k_MagmaElement, sizeof(__pyx_k_MagmaElement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MagmaElement */
  {__pyx_k_Manifold, sizeof(__pyx_k_Manifold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold */
  {__pyx_k_Manifold__canonical_cells_are_te, sizeof(__pyx_k_Manifold__canonical_cells_are_te), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__canonical_cells_are_te */
  {__pyx_k_Manifold__canonical_cells_are_te_2, sizeof(__pyx_k_Manifold__canonical_cells_are_te_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold__canonical_cells_are_te_2 */
  {__pyx_k_Manifold__canonical_retriangulat, sizeof(__pyx_k_Manifold__canonical_retriangulat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__canonical_retriangulat */
  {__pyx_k_Manifold__canonical_retriangulat_2, sizeof(__pyx_k_Manifold__canonical_retriangulat_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold__canonical_retriangulat_2 */
  {__pyx_k_Manifold__choose_generators, sizeof(__pyx_k_Manifold__choose_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__choose_generators */
  {__pyx_k_Manifold__choose_generators_info, sizeof(__pyx_k_Manifold__choose_generators_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__choose_generators_info */
  {__pyx_k_Manifold__complex_volume, sizeof(__pyx_k_Manifold__complex_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__complex_volume */
  {__pyx_k_Manifold__cusp_cross_section_inf, sizeof(__pyx_k_Manifold__cusp_cross_section_inf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__cusp_cross_section_inf */
  {__pyx_k_Manifold__from_bytes, sizeof(__pyx_k_Manifold__from_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__from_bytes */
  {__pyx_k_Manifold__from_bytes_line_283, sizeof(__pyx_k_Manifold__from_bytes_line_283), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold__from_bytes_line_283 */
  {__pyx_k_Manifold__from_isosig, sizeof(__pyx_k_Manifold__from_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__from_isosig */
  {__pyx_k_Manifold__from_string, sizeof(__pyx_k_Manifold__from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__from_string */
  {__pyx_k_Manifold__from_string_line_267, sizeof(__pyx_k_Manifold__from_string_line_267), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold__from_string_line_267 */
  {__pyx_k_Manifold__get_tetrahedra_shapes, sizeof(__pyx_k_Manifold__get_tetrahedra_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__get_tetrahedra_shapes */
  {__pyx_k_Manifold__identify, sizeof(__pyx_k_Manifold__identify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__identify */
  {__pyx_k_Manifold__is_isometric_to, sizeof(__pyx_k_Manifold__is_isometric_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__is_isometric_to */
  {__pyx_k_Manifold__is_isometric_to_line_1, sizeof(__pyx_k_Manifold__is_isometric_to_line_1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold__is_isometric_to_line_1 */
  {__pyx_k_Manifold__number, sizeof(__pyx_k_Manifold__number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__number */
  {__pyx_k_Manifold__polish_hyperbolic_stru, sizeof(__pyx_k_Manifold__polish_hyperbolic_stru), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__polish_hyperbolic_stru */
  {__pyx_k_Manifold__precision, sizeof(__pyx_k_Manifold__precision), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold__precision */
  {__pyx_k_Manifold_browse, sizeof(__pyx_k_Manifold_browse), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_browse */
  {__pyx_k_Manifold_browse_line_386, sizeof(__pyx_k_Manifold_browse_line_386), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_browse_line_386 */
  {__pyx_k_Manifold_canonize, sizeof(__pyx_k_Manifold_canonize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_canonize */
  {__pyx_k_Manifold_canonize_line_146, sizeof(__pyx_k_Manifold_canonize_line_146), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_canonize_line_146 */
  {__pyx_k_Manifold_chern_simons, sizeof(__pyx_k_Manifold_chern_simons), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_chern_simons */
  {__pyx_k_Manifold_chern_simons_line_821, sizeof(__pyx_k_Manifold_chern_simons_line_821), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_chern_simons_line_821 */
  {__pyx_k_Manifold_copy, sizeof(__pyx_k_Manifold_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_copy */
  {__pyx_k_Manifold_copy_line_308, sizeof(__pyx_k_Manifold_copy_line_308), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_copy_line_308 */
  {__pyx_k_Manifold_cover, sizeof(__pyx_k_Manifold_cover), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_cover */
  {__pyx_k_Manifold_cover_line_549, sizeof(__pyx_k_Manifold_cover_line_549), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_cover_line_549 */
  {__pyx_k_Manifold_covers, sizeof(__pyx_k_Manifold_covers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_covers */
  {__pyx_k_Manifold_covers_line_618, sizeof(__pyx_k_Manifold_covers_line_618), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_covers_line_618 */
  {__pyx_k_Manifold_cusp_info, sizeof(__pyx_k_Manifold_cusp_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_cusp_info */
  {__pyx_k_Manifold_cusp_info_line_1128, sizeof(__pyx_k_Manifold_cusp_info_line_1128), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_cusp_info_line_1128 */
  {__pyx_k_Manifold_cusp_neighborhood, sizeof(__pyx_k_Manifold_cusp_neighborhood), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_cusp_neighborhood */
  {__pyx_k_Manifold_cusp_neighborhood_line, sizeof(__pyx_k_Manifold_cusp_neighborhood_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_cusp_neighborhood_line */
  {__pyx_k_Manifold_dehn_fill, sizeof(__pyx_k_Manifold_dehn_fill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_dehn_fill */
  {__pyx_k_Manifold_dehn_fill, sizeof(__pyx_k_Manifold_dehn_fill), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_dehn_fill */
  {__pyx_k_Manifold_dehn_fill_line_1251, sizeof(__pyx_k_Manifold_dehn_fill_line_1251), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_dehn_fill_line_1251 */
  {__pyx_k_Manifold_dirichlet_domain, sizeof(__pyx_k_Manifold_dirichlet_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_dirichlet_domain */
  {__pyx_k_Manifold_dirichlet_domain_line_3, sizeof(__pyx_k_Manifold_dirichlet_domain_line_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_dirichlet_domain_line_3 */
  {__pyx_k_Manifold_drill, sizeof(__pyx_k_Manifold_drill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_drill */
  {__pyx_k_Manifold_drill_line_1505, sizeof(__pyx_k_Manifold_drill_line_1505), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_drill_line_1505 */
  {__pyx_k_Manifold_dual_curves, sizeof(__pyx_k_Manifold_dual_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_dual_curves */
  {__pyx_k_Manifold_dual_curves_line_1403, sizeof(__pyx_k_Manifold_dual_curves_line_1403), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_dual_curves_line_1403 */
  {__pyx_k_Manifold_filled_triangulation, sizeof(__pyx_k_Manifold_filled_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_filled_triangulation */
  {__pyx_k_Manifold_filled_triangulation_li, sizeof(__pyx_k_Manifold_filled_triangulation_li), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_filled_triangulation_li */
  {__pyx_k_Manifold_from_Triangulation, sizeof(__pyx_k_Manifold_from_Triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_from_Triangulation */
  {__pyx_k_Manifold_fundamental_group, sizeof(__pyx_k_Manifold_fundamental_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_fundamental_group */
  {__pyx_k_Manifold_fundamental_group_line, sizeof(__pyx_k_Manifold_fundamental_group_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_fundamental_group_line */
  {__pyx_k_Manifold_init_hyperbolic_structu, sizeof(__pyx_k_Manifold_init_hyperbolic_structu), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_init_hyperbolic_structu */
  {__pyx_k_Manifold_is_isometric_to, sizeof(__pyx_k_Manifold_is_isometric_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_is_isometric_to */
  {__pyx_k_Manifold_is_two_bridge, sizeof(__pyx_k_Manifold_is_two_bridge), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_is_two_bridge */
  {__pyx_k_Manifold_is_two_bridge_line_1647, sizeof(__pyx_k_Manifold_is_two_bridge_line_1647), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_is_two_bridge_line_1647 */
  {__pyx_k_Manifold_length_spectrum, sizeof(__pyx_k_Manifold_length_spectrum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_length_spectrum */
  {__pyx_k_Manifold_length_spectrum_line_14, sizeof(__pyx_k_Manifold_length_spectrum_line_14), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_length_spectrum_line_14 */
  {__pyx_k_Manifold_must_be_pickled_with__t, sizeof(__pyx_k_Manifold_must_be_pickled_with__t), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_must_be_pickled_with__t */
  {__pyx_k_Manifold_set_peripheral_curves, sizeof(__pyx_k_Manifold_set_peripheral_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_set_peripheral_curves */
  {__pyx_k_Manifold_set_peripheral_curves, sizeof(__pyx_k_Manifold_set_peripheral_curves), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_set_peripheral_curves */
  {__pyx_k_Manifold_set_peripheral_curves_l, sizeof(__pyx_k_Manifold_set_peripheral_curves_l), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_set_peripheral_curves_l */
  {__pyx_k_Manifold_set_target_holonomy, sizeof(__pyx_k_Manifold_set_target_holonomy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_set_target_holonomy */
  {__pyx_k_Manifold_set_tetrahedra_shapes, sizeof(__pyx_k_Manifold_set_tetrahedra_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_set_tetrahedra_shapes */
  {__pyx_k_Manifold_set_tetrahedra_shapes, sizeof(__pyx_k_Manifold_set_tetrahedra_shapes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_set_tetrahedra_shapes */
  {__pyx_k_Manifold_solution_type, sizeof(__pyx_k_Manifold_solution_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_solution_type */
  {__pyx_k_Manifold_solution_type_line_1063, sizeof(__pyx_k_Manifold_solution_type_line_1063), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_solution_type_line_1063 */
  {__pyx_k_Manifold_split, sizeof(__pyx_k_Manifold_split), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_split */
  {__pyx_k_Manifold_split_line_1768, sizeof(__pyx_k_Manifold_split_line_1768), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_split_line_1768 */
  {__pyx_k_Manifold_splitting_surfaces, sizeof(__pyx_k_Manifold_splitting_surfaces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_splitting_surfaces */
  {__pyx_k_Manifold_splitting_surfaces_line, sizeof(__pyx_k_Manifold_splitting_surfaces_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_splitting_surfaces_line */
  {__pyx_k_Manifold_symmetric_triangulation, sizeof(__pyx_k_Manifold_symmetric_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_symmetric_triangulation */
  {__pyx_k_Manifold_symmetric_triangulation_2, sizeof(__pyx_k_Manifold_symmetric_triangulation_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_symmetric_triangulation_2 */
  {__pyx_k_Manifold_symmetry_group, sizeof(__pyx_k_Manifold_symmetry_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_symmetry_group */
  {__pyx_k_Manifold_tetrahedra_shapes, sizeof(__pyx_k_Manifold_tetrahedra_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_tetrahedra_shapes */
  {__pyx_k_Manifold_tetrahedra_shapes_line, sizeof(__pyx_k_Manifold_tetrahedra_shapes_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_tetrahedra_shapes_line */
  {__pyx_k_Manifold_use_field_conversion, sizeof(__pyx_k_Manifold_use_field_conversion), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_use_field_conversion */
  {__pyx_k_Manifold_volume, sizeof(__pyx_k_Manifold_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_volume */
  {__pyx_k_Manifold_volume_line_728, sizeof(__pyx_k_Manifold_volume_line_728), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_volume_line_728 */
  {__pyx_k_Manifold_without_hyperbolic_stru, sizeof(__pyx_k_Manifold_without_hyperbolic_stru), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Manifold_without_hyperbolic_stru */
  {__pyx_k_Manifold_without_hyperbolic_stru_2, sizeof(__pyx_k_Manifold_without_hyperbolic_stru_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifold_without_hyperbolic_stru_2 */
  {__pyx_k_Manifolds_must_be_non_empty, sizeof(__pyx_k_Manifolds_must_be_non_empty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Manifolds_must_be_non_empty */
  {__pyx_k_MatrixParity, sizeof(__pyx_k_MatrixParity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MatrixParity */
  {__pyx_k_MatrixWithExplanations, sizeof(__pyx_k_MatrixWithExplanations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MatrixWithExplanations */
  {__pyx_k_MatrixWithExplanations___init, sizeof(__pyx_k_MatrixWithExplanations___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MatrixWithExplanations___init */
  {__pyx_k_MatrixWithExplanations___repr, sizeof(__pyx_k_MatrixWithExplanations___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MatrixWithExplanations___repr */
  {__pyx_k_MatrixWithExplanations___repr_2, sizeof(__pyx_k_MatrixWithExplanations___repr_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MatrixWithExplanations___repr_2 */
  {__pyx_k_MorwenLinks, sizeof(__pyx_k_MorwenLinks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MorwenLinks */
  {__pyx_k_MorwenLinks___init, sizeof(__pyx_k_MorwenLinks___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MorwenLinks___init */
  {__pyx_k_MsgIO, sizeof(__pyx_k_MsgIO), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MsgIO */
  {__pyx_k_MsgIO___init, sizeof(__pyx_k_MsgIO___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MsgIO___init */
  {__pyx_k_N, sizeof(__pyx_k_N), 0, 1, 1}, /* PyObject cname: __pyx_n_u_N */
  {__pyx_k_N_has_to_be_2_15, sizeof(__pyx_k_N_has_to_be_2_15), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_N_has_to_be_2_15 */
  {__pyx_k_NeumannZagierTypeEquations, sizeof(__pyx_k_NeumannZagierTypeEquations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NeumannZagierTypeEquations */
  {__pyx_k_NeumannZagierTypeEquations___ini, sizeof(__pyx_k_NeumannZagierTypeEquations___ini), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NeumannZagierTypeEquations___ini */
  {__pyx_k_NeumannZagierTypeEquations___rep, sizeof(__pyx_k_NeumannZagierTypeEquations___rep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NeumannZagierTypeEquations___rep */
  {__pyx_k_New_triangulation_received_from, sizeof(__pyx_k_New_triangulation_received_from), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_New_triangulation_received_from */
  {__pyx_k_No_associated_link_known, sizeof(__pyx_k_No_associated_link_known), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_No_associated_link_known */
  {__pyx_k_No_tetrahedra_data_provided, sizeof(__pyx_k_No_tetrahedra_data_provided), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_No_tetrahedra_data_provided */
  {__pyx_k_Non_orientable, sizeof(__pyx_k_Non_orientable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Non_orientable */
  {__pyx_k_NonalternatingKnotExteriors, sizeof(__pyx_k_NonalternatingKnotExteriors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NonalternatingKnotExteriors */
  {__pyx_k_NonalternatingKnotExteriors___in, sizeof(__pyx_k_NonalternatingKnotExteriors___in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NonalternatingKnotExteriors___in */
  {__pyx_k_Nonalternating_numbers, sizeof(__pyx_k_Nonalternating_numbers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Nonalternating_numbers */
  {__pyx_k_Nonalternating_offsets, sizeof(__pyx_k_Nonalternating_offsets), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Nonalternating_offsets */
  {__pyx_k_Nonalternating_table, sizeof(__pyx_k_Nonalternating_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Nonalternating_table */
  {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 1}, /* PyObject cname: __pyx_n_u_None */
  {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_None */
  {__pyx_k_Nonorientable_lengths, sizeof(__pyx_k_Nonorientable_lengths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Nonorientable_lengths */
  {__pyx_k_NormalSurfaceInfo, sizeof(__pyx_k_NormalSurfaceInfo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NormalSurfaceInfo */
  {__pyx_k_NormalSurfaceInfo___repr, sizeof(__pyx_k_NormalSurfaceInfo___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NormalSurfaceInfo___repr */
  {__pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplemented */
  {__pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplementedError */
  {__pyx_k_Not_a_valid_permutation, sizeof(__pyx_k_Not_a_valid_permutation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Not_a_valid_permutation */
  {__pyx_k_Not_within_Sage, sizeof(__pyx_k_Not_within_Sage), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Not_within_Sage */
  {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */
  {__pyx_k_Num_Alternating, sizeof(__pyx_k_Num_Alternating), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Num_Alternating */
  {__pyx_k_Num_Nonalternating, sizeof(__pyx_k_Num_Nonalternating), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Num_Nonalternating */
  {__pyx_k_Number, sizeof(__pyx_k_Number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Number */
  {__pyx_k_Number_of_opacities_does_not_mat, sizeof(__pyx_k_Number_of_opacities_does_not_mat), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Number_of_opacities_does_not_mat */
  {__pyx_k_Number_of_permutations_is_not_th, sizeof(__pyx_k_Number_of_permutations_is_not_th), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Number_of_permutations_is_not_th */
  {__pyx_k_O, sizeof(__pyx_k_O), 0, 1, 1}, /* PyObject cname: __pyx_n_u_O */
  {__pyx_k_O31, sizeof(__pyx_k_O31), 0, 1, 1}, /* PyObject cname: __pyx_n_u_O31 */
  {__pyx_k_O31_generators, sizeof(__pyx_k_O31_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_O31_generators */
  {__pyx_k_ObsCensusKnots, sizeof(__pyx_k_ObsCensusKnots), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsCensusKnots */
  {__pyx_k_ObsCensusKnots___getitem, sizeof(__pyx_k_ObsCensusKnots___getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsCensusKnots___getitem */
  {__pyx_k_ObsCensusKnots___init, sizeof(__pyx_k_ObsCensusKnots___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsCensusKnots___init */
  {__pyx_k_ObsCensusKnots___repr, sizeof(__pyx_k_ObsCensusKnots___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsCensusKnots___repr */
  {__pyx_k_ObsLinkExteriors, sizeof(__pyx_k_ObsLinkExteriors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsLinkExteriors */
  {__pyx_k_ObsLinkExteriors___getitem, sizeof(__pyx_k_ObsLinkExteriors___getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsLinkExteriors___getitem */
  {__pyx_k_ObsLinkExteriors___init, sizeof(__pyx_k_ObsLinkExteriors___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsLinkExteriors___init */
  {__pyx_k_ObsLinkExteriors___repr, sizeof(__pyx_k_ObsLinkExteriors___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsLinkExteriors___repr */
  {__pyx_k_ObsMorwenLinks, sizeof(__pyx_k_ObsMorwenLinks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsMorwenLinks */
  {__pyx_k_ObsMorwenLinks___getitem, sizeof(__pyx_k_ObsMorwenLinks___getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsMorwenLinks___getitem */
  {__pyx_k_ObsMorwenLinks___init, sizeof(__pyx_k_ObsMorwenLinks___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsMorwenLinks___init */
  {__pyx_k_ObsNonorientableClosedCensus, sizeof(__pyx_k_ObsNonorientableClosedCensus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsNonorientableClosedCensus */
  {__pyx_k_ObsNonorientableClosedCensus___g, sizeof(__pyx_k_ObsNonorientableClosedCensus___g), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsNonorientableClosedCensus___g */
  {__pyx_k_ObsNonorientableClosedCensus___i, sizeof(__pyx_k_ObsNonorientableClosedCensus___i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsNonorientableClosedCensus___i */
  {__pyx_k_ObsNonorientableCuspedCensus, sizeof(__pyx_k_ObsNonorientableCuspedCensus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsNonorientableCuspedCensus */
  {__pyx_k_ObsNonorientableCuspedCensus___i, sizeof(__pyx_k_ObsNonorientableCuspedCensus___i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsNonorientableCuspedCensus___i */
  {__pyx_k_ObsNonorientableCuspedCensus_loo, sizeof(__pyx_k_ObsNonorientableCuspedCensus_loo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsNonorientableCuspedCensus_loo */
  {__pyx_k_ObsOrientableClosedCensus, sizeof(__pyx_k_ObsOrientableClosedCensus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsOrientableClosedCensus */
  {__pyx_k_ObsOrientableClosedCensus___geti, sizeof(__pyx_k_ObsOrientableClosedCensus___geti), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsOrientableClosedCensus___geti */
  {__pyx_k_ObsOrientableClosedCensus___init, sizeof(__pyx_k_ObsOrientableClosedCensus___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsOrientableClosedCensus___init */
  {__pyx_k_ObsOrientableCuspedCensus, sizeof(__pyx_k_ObsOrientableCuspedCensus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ObsOrientableCuspedCensus */
  {__pyx_k_Obsolete, sizeof(__pyx_k_Obsolete), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Obsolete */
  {__pyx_k_Obsolete_2, sizeof(__pyx_k_Obsolete_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Obsolete_2 */
  {__pyx_k_Obstruction_class_has_wrong_leng, sizeof(__pyx_k_Obstruction_class_has_wrong_leng), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Obstruction_class_has_wrong_leng */
  {__pyx_k_Opens_browser_window_with_a_gra, sizeof(__pyx_k_Opens_browser_window_with_a_gra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Opens_browser_window_with_a_gra */
  {__pyx_k_Orbifold1, sizeof(__pyx_k_Orbifold1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Orbifold1 */
  {__pyx_k_Orientability, sizeof(__pyx_k_Orientability), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Orientability */
  {__pyx_k_Orientable, sizeof(__pyx_k_Orientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Orientable */
  {__pyx_k_Orientable_lengths, sizeof(__pyx_k_Orientable_lengths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Orientable_lengths */
  {__pyx_k_Out_of_memory, sizeof(__pyx_k_Out_of_memory), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Out_of_memory */
  {__pyx_k_PD_code, sizeof(__pyx_k_PD_code), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PD_code */
  {__pyx_k_PLink_was_not_imported, sizeof(__pyx_k_PLink_was_not_imported), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_PLink_was_not_imported */
  {__pyx_k_P_crossings_0_9_P_alternation_a, sizeof(__pyx_k_P_crossings_0_9_P_alternation_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_P_crossings_0_9_P_alternation_a */
  {__pyx_k_P_crossings_0_9_P_components_0, sizeof(__pyx_k_P_crossings_0_9_P_components_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_P_crossings_0_9_P_components_0 */
  {__pyx_k_P_crossings_0_9___P_index_0_9_P, sizeof(__pyx_k_P_crossings_0_9___P_index_0_9_P), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_P_crossings_0_9___P_index_0_9_P */
  {__pyx_k_Perform_random_Pachner_moves_on, sizeof(__pyx_k_Perform_random_Pachner_moves_on), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Perform_random_Pachner_moves_on */
  {__pyx_k_PermutationGroup, sizeof(__pyx_k_PermutationGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PermutationGroup */
  {__pyx_k_PermutationGroupElement, sizeof(__pyx_k_PermutationGroupElement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PermutationGroupElement */
  {__pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PickleError */
  {__pyx_k_Please_specify_a_file_name, sizeof(__pyx_k_Please_specify_a_file_name), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Please_specify_a_file_name */
  {__pyx_k_Please_specify_filled_or_complet, sizeof(__pyx_k_Please_specify_filled_or_complet), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Please_specify_filled_or_complet */
  {__pyx_k_PolyhedronViewer, sizeof(__pyx_k_PolyhedronViewer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PolyhedronViewer */
  {__pyx_k_PreImage, sizeof(__pyx_k_PreImage), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PreImage */
  {__pyx_k_PresentationMatrix, sizeof(__pyx_k_PresentationMatrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix */
  {__pyx_k_PresentationMatrix___reduce_cyth, sizeof(__pyx_k_PresentationMatrix___reduce_cyth), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix___reduce_cyth */
  {__pyx_k_PresentationMatrix___setstate_cy, sizeof(__pyx_k_PresentationMatrix___setstate_cy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix___setstate_cy */
  {__pyx_k_PresentationMatrix_add_rows, sizeof(__pyx_k_PresentationMatrix_add_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix_add_rows */
  {__pyx_k_PresentationMatrix_explode, sizeof(__pyx_k_PresentationMatrix_explode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix_explode */
  {__pyx_k_PresentationMatrix_get_data, sizeof(__pyx_k_PresentationMatrix_get_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix_get_data */
  {__pyx_k_PresentationMatrix_row_op, sizeof(__pyx_k_PresentationMatrix_row_op), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix_row_op */
  {__pyx_k_PresentationMatrix_simplified_ma, sizeof(__pyx_k_PresentationMatrix_simplified_ma), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix_simplified_ma */
  {__pyx_k_PresentationMatrix_simplify, sizeof(__pyx_k_PresentationMatrix_simplify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PresentationMatrix_simplify */
  {__pyx_k_Q, sizeof(__pyx_k_Q), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Q */
  {__pyx_k_Q_2, sizeof(__pyx_k_Q_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Q_2 */
  {__pyx_k_R, sizeof(__pyx_k_R), 0, 1, 1}, /* PyObject cname: __pyx_n_u_R */
  {__pyx_k_RawNumber, sizeof(__pyx_k_RawNumber), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RawNumber */
  {__pyx_k_Relators, sizeof(__pyx_k_Relators), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Relators */
  {__pyx_k_Removing_any_finite_vertices_by, sizeof(__pyx_k_Removing_any_finite_vertices_by), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Removing_any_finite_vertices_by */
  {__pyx_k_Represents_an_isometry_from_one, sizeof(__pyx_k_Represents_an_isometry_from_one), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Represents_an_isometry_from_one */
  {__pyx_k_Result_is_symplectic_up_to_facto, sizeof(__pyx_k_Result_is_symplectic_up_to_facto), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Result_is_symplectic_up_to_facto */
  {__pyx_k_Return_a_class_HolonomyGroup_re, sizeof(__pyx_k_Return_a_class_HolonomyGroup_re), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_a_class_HolonomyGroup_re */
  {__pyx_k_Return_a_detailed_list_of_all_t, sizeof(__pyx_k_Return_a_detailed_list_of_all_t), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_a_detailed_list_of_all_t */
  {__pyx_k_Return_a_list_of_info_objects_d, sizeof(__pyx_k_Return_a_list_of_info_objects_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_a_list_of_info_objects_d */
  {__pyx_k_Return_a_new_Manifold_where_the, sizeof(__pyx_k_Return_a_new_Manifold_where_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_a_new_Manifold_where_the */
  {__pyx_k_Return_a_new_manifold_where_the, sizeof(__pyx_k_Return_a_new_manifold_where_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_a_new_manifold_where_the */
  {__pyx_k_Return_a_reasonably_short_byte, sizeof(__pyx_k_Return_a_reasonably_short_byte), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_a_reasonably_short_byte */
  {__pyx_k_Return_a_string_containing_the, sizeof(__pyx_k_Return_a_string_containing_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_a_string_containing_the */
  {__pyx_k_Return_the_Dowker_Thistlethwait, sizeof(__pyx_k_Return_the_Dowker_Thistlethwait), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_Dowker_Thistlethwait */
  {__pyx_k_Return_the_abelianization_of_th, sizeof(__pyx_k_Return_the_abelianization_of_th), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_abelianization_of_th */
  {__pyx_k_Return_the_center_of_the_symmet, sizeof(__pyx_k_Return_the_center_of_the_symmet), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_center_of_the_symmet */
  {__pyx_k_Return_the_commutator_subgroup, sizeof(__pyx_k_Return_the_commutator_subgroup), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_commutator_subgroup */
  {__pyx_k_Return_the_current_generators_i, sizeof(__pyx_k_Return_the_current_generators_i), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_current_generators_i */
  {__pyx_k_Return_the_letters_representing, sizeof(__pyx_k_Return_the_letters_representing), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_letters_representing */
  {__pyx_k_Return_the_name_of_the_triangul, sizeof(__pyx_k_Return_the_name_of_the_triangul), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_name_of_the_triangul */
  {__pyx_k_Return_the_number_of_tetrahedra, sizeof(__pyx_k_Return_the_number_of_tetrahedra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_number_of_tetrahedra */
  {__pyx_k_Return_the_order_of_the_symmetr, sizeof(__pyx_k_Return_the_order_of_the_symmetr), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_order_of_the_symmetr */
  {__pyx_k_Return_the_original_geometric_g, sizeof(__pyx_k_Return_the_original_geometric_g), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_original_geometric_g */
  {__pyx_k_Return_the_total_number_of_cusp, sizeof(__pyx_k_Return_the_total_number_of_cusp), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_the_total_number_of_cusp */
  {__pyx_k_Return_whether_a_one_cusped_has, sizeof(__pyx_k_Return_whether_a_one_cusped_has), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_whether_a_one_cusped_has */
  {__pyx_k_Return_whether_the_SymmetryGrou, sizeof(__pyx_k_Return_whether_the_SymmetryGrou), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_whether_the_SymmetryGrou */
  {__pyx_k_Return_whether_the_full_symmetr, sizeof(__pyx_k_Return_whether_the_full_symmetr), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_whether_the_full_symmetr */
  {__pyx_k_Return_whether_the_manifold_has, sizeof(__pyx_k_Return_whether_the_manifold_has), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_whether_the_manifold_has */
  {__pyx_k_Return_whether_the_symmetry_gro, sizeof(__pyx_k_Return_whether_the_symmetry_gro), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_whether_the_symmetry_gro */
  {__pyx_k_Return_whether_the_symmetry_gro_2, sizeof(__pyx_k_Return_whether_the_symmetry_gro_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_whether_the_symmetry_gro_2 */
  {__pyx_k_Return_whether_the_underlying_3, sizeof(__pyx_k_Return_whether_the_underlying_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_whether_the_underlying_3 */
  {__pyx_k_Returns_True_if_M_and_N_are_iso, sizeof(__pyx_k_Returns_True_if_M_and_N_are_iso), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_True_if_M_and_N_are_iso */
  {__pyx_k_Returns_True_if_and_only_if_the, sizeof(__pyx_k_Returns_True_if_and_only_if_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_True_if_and_only_if_the */
  {__pyx_k_Returns_True_if_and_only_if_the_2, sizeof(__pyx_k_Returns_True_if_and_only_if_the_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_True_if_and_only_if_the_2 */
  {__pyx_k_Returns_a_Dehn_filling_descript, sizeof(__pyx_k_Returns_a_Dehn_filling_descript), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_Dehn_filling_descript */
  {__pyx_k_Returns_a_Manifold_computed_dir, sizeof(__pyx_k_Returns_a_Manifold_computed_dir), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_Manifold_computed_dir */
  {__pyx_k_Returns_a_NeumannZagierTypeEqua, sizeof(__pyx_k_Returns_a_NeumannZagierTypeEqua), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_NeumannZagierTypeEqua */
  {__pyx_k_Returns_a_Triangulation_compute, sizeof(__pyx_k_Returns_a_Triangulation_compute), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_Triangulation_compute */
  {__pyx_k_Returns_a_class_DirichletDomain, sizeof(__pyx_k_Returns_a_class_DirichletDomain), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_class_DirichletDomain */
  {__pyx_k_Returns_a_class_FundamentalGrou, sizeof(__pyx_k_Returns_a_class_FundamentalGrou), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_class_FundamentalGrou */
  {__pyx_k_Returns_a_class_Manifold_repres, sizeof(__pyx_k_Returns_a_class_Manifold_repres), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_class_Manifold_repres */
  {__pyx_k_Returns_a_class_Triangulation_r, sizeof(__pyx_k_Returns_a_class_Triangulation_r), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_class_Triangulation_r */
  {__pyx_k_Returns_a_complete_list_of_comb, sizeof(__pyx_k_Returns_a_complete_list_of_comb), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_complete_list_of_comb */
  {__pyx_k_Returns_a_copy_of_the_manifold, sizeof(__pyx_k_Returns_a_copy_of_the_manifold), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_copy_of_the_manifold */
  {__pyx_k_Returns_a_copy_of_the_triangula, sizeof(__pyx_k_Returns_a_copy_of_the_triangula), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_copy_of_the_triangula */
  {__pyx_k_Returns_a_dictionary_whose_keys, sizeof(__pyx_k_Returns_a_dictionary_whose_keys), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_dictionary_whose_keys */
  {__pyx_k_Returns_a_list_of_Triangulation, sizeof(__pyx_k_Returns_a_list_of_Triangulation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_list_of_Triangulation */
  {__pyx_k_Returns_a_list_of_class_Manifol, sizeof(__pyx_k_Returns_a_list_of_class_Manifol), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_list_of_class_Manifol */
  {__pyx_k_Returns_a_list_of_geodesics_wit, sizeof(__pyx_k_Returns_a_list_of_geodesics_wit), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_list_of_geodesics_wit */
  {__pyx_k_Returns_a_list_of_meridian_long, sizeof(__pyx_k_Returns_a_list_of_meridian_long), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_list_of_meridian_long */
  {__pyx_k_Returns_a_list_of_the_O31Matric, sizeof(__pyx_k_Returns_a_list_of_the_O31Matric), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_list_of_the_O31Matric */
  {__pyx_k_Returns_a_list_of_variables_and, sizeof(__pyx_k_Returns_a_list_of_variables_and), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_list_of_variables_and */
  {__pyx_k_Returns_a_string_which_will_def, sizeof(__pyx_k_Returns_a_string_which_will_def), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_string_which_will_def */
  {__pyx_k_Returns_a_word_representing_a_c, sizeof(__pyx_k_Returns_a_word_representing_a_c), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_word_representing_a_c */
  {__pyx_k_Returns_a_word_representing_a_c_2, sizeof(__pyx_k_Returns_a_word_representing_a_c_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_a_word_representing_a_c_2 */
  {__pyx_k_Returns_an_class_AbelianGroup_r, sizeof(__pyx_k_Returns_an_class_AbelianGroup_r), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_an_class_AbelianGroup_r */
  {__pyx_k_Returns_an_info_object_containi, sizeof(__pyx_k_Returns_an_info_object_containi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_an_info_object_containi */
  {__pyx_k_Returns_an_info_object_containi_2, sizeof(__pyx_k_Returns_an_info_object_containi_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_an_info_object_containi_2 */
  {__pyx_k_Returns_information_about_the_c, sizeof(__pyx_k_Returns_information_about_the_c), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_information_about_the_c */
  {__pyx_k_Returns_self_as_a_class_Triangu, sizeof(__pyx_k_Returns_self_as_a_class_Triangu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_self_as_a_class_Triangu */
  {__pyx_k_Returns_the_Chern_Simons_invari, sizeof(__pyx_k_Returns_the_Chern_Simons_invari), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_Chern_Simons_invari */
  {__pyx_k_Returns_the_decorated_isomorphi, sizeof(__pyx_k_Returns_the_decorated_isomorphi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_decorated_isomorphi */
  {__pyx_k_Returns_the_number_of_fake_cusp, sizeof(__pyx_k_Returns_the_number_of_fake_cusp), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_number_of_fake_cusp */
  {__pyx_k_Returns_the_obstruction_classes, sizeof(__pyx_k_Returns_the_obstruction_classes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_obstruction_classes */
  {__pyx_k_Returns_the_obstruction_classes_2, sizeof(__pyx_k_Returns_the_obstruction_classes_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_obstruction_classes_2 */
  {__pyx_k_Returns_the_product_of_group_el, sizeof(__pyx_k_Returns_the_product_of_group_el), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_product_of_group_el */
  {__pyx_k_Returns_the_type_of_the_current, sizeof(__pyx_k_Returns_the_type_of_the_current), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_type_of_the_current */
  {__pyx_k_Returns_the_volume_of_the_curre, sizeof(__pyx_k_Returns_the_volume_of_the_curre), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Returns_the_volume_of_the_curre */
  {__pyx_k_Reverses_the_orientation_of_the, sizeof(__pyx_k_Reverses_the_orientation_of_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Reverses_the_orientation_of_the */
  {__pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RuntimeError */
  {__pyx_k_S5, sizeof(__pyx_k_S5), 0, 1, 1}, /* PyObject cname: __pyx_n_u_S5 */
  {__pyx_k_SC, sizeof(__pyx_k_SC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SC */
  {__pyx_k_SL2C, sizeof(__pyx_k_SL2C), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SL2C */
  {__pyx_k_SNAPPEA_MANIFOLD_DIRECTORY, sizeof(__pyx_k_SNAPPEA_MANIFOLD_DIRECTORY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SNAPPEA_MANIFOLD_DIRECTORY */
  {__pyx_k_SageNotAvailable, sizeof(__pyx_k_SageNotAvailable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SageNotAvailable */
  {__pyx_k_SageObject, sizeof(__pyx_k_SageObject), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SageObject */
  {__pyx_k_Save_Triangulation, sizeof(__pyx_k_Save_Triangulation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Save_Triangulation */
  {__pyx_k_Save_the_Dirichlet_domain_as_a, sizeof(__pyx_k_Save_the_Dirichlet_domain_as_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Save_the_Dirichlet_domain_as_a */
  {__pyx_k_Save_the_triangulation_as_a_Sna, sizeof(__pyx_k_Save_the_triangulation_as_a_Sna), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Save_the_triangulation_as_a_Sna */
  {__pyx_k_Searches_for_connected_closed_n, sizeof(__pyx_k_Searches_for_connected_closed_n), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Searches_for_connected_closed_n */
  {__pyx_k_Send_to_SnapPy, sizeof(__pyx_k_Send_to_SnapPy), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Send_to_SnapPy */
  {__pyx_k_Set_the_Dehn_filling_coefficien, sizeof(__pyx_k_Set_the_Dehn_filling_coefficien), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Set_the_Dehn_filling_coefficien */
  {__pyx_k_Set_the_Dehn_filling_coefficien_2, sizeof(__pyx_k_Set_the_Dehn_filling_coefficien_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Set_the_Dehn_filling_coefficien_2 */
  {__pyx_k_ShapeInfo, sizeof(__pyx_k_ShapeInfo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ShapeInfo */
  {__pyx_k_ShapeInfo___repr, sizeof(__pyx_k_ShapeInfo___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ShapeInfo___repr */
  {__pyx_k_ShortMatrixParity, sizeof(__pyx_k_ShortMatrixParity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ShortMatrixParity */
  {__pyx_k_SnapPeaFatalError, sizeof(__pyx_k_SnapPeaFatalError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SnapPeaFatalError */
  {__pyx_k_SnapPea_KLPProjection, sizeof(__pyx_k_SnapPea_KLPProjection), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SnapPea_KLPProjection */
  {__pyx_k_SnapPea_crashed_in_function, sizeof(__pyx_k_SnapPea_crashed_in_function), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_crashed_in_function */
  {__pyx_k_SnapPea_failed_to_compute_any_pa, sizeof(__pyx_k_SnapPea_failed_to_compute_any_pa), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_failed_to_compute_any_pa */
  {__pyx_k_SnapPea_failed_to_find_the_canon, sizeof(__pyx_k_SnapPea_failed_to_find_the_canon), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_failed_to_find_the_canon */
  {__pyx_k_SnapPea_failed_to_read_the_censu, sizeof(__pyx_k_SnapPea_failed_to_read_the_censu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_failed_to_read_the_censu */
  {__pyx_k_SnapPea_interrupt, sizeof(__pyx_k_SnapPea_interrupt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SnapPea_interrupt */
  {__pyx_k_SnapPea_kernel_failed_when_compu, sizeof(__pyx_k_SnapPea_kernel_failed_when_compu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_kernel_failed_when_compu */
  {__pyx_k_SnapPea_kernel_failed_when_compu_2, sizeof(__pyx_k_SnapPea_kernel_failed_when_compu_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_kernel_failed_when_compu_2 */
  {__pyx_k_SnapPea_kernel_failed_when_split, sizeof(__pyx_k_SnapPea_kernel_failed_when_split), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_kernel_failed_when_split */
  {__pyx_k_SnapPea_kernel_style_estimation, sizeof(__pyx_k_SnapPea_kernel_style_estimation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_kernel_style_estimation */
  {__pyx_k_SnapPea_only_found, sizeof(__pyx_k_SnapPea_only_found), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPea_only_found */
  {__pyx_k_SnapPyCache, sizeof(__pyx_k_SnapPyCache), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SnapPyCache */
  {__pyx_k_SnapPyHP, sizeof(__pyx_k_SnapPyHP), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SnapPyHP */
  {__pyx_k_SnapPy_has_no_data_on_links_with, sizeof(__pyx_k_SnapPy_has_no_data_on_links_with), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SnapPy_has_no_data_on_links_with */
  {__pyx_k_SolutionType, sizeof(__pyx_k_SolutionType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SolutionType */
  {__pyx_k_Solution_type_is_s, sizeof(__pyx_k_Solution_type_is_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Solution_type_is_s */
  {__pyx_k_Split_the_manifold_open_along_a, sizeof(__pyx_k_Split_the_manifold_open_along_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Split_the_manifold_open_along_a */
  {__pyx_k_Splitting_S__1_0_b1_A0_a0_B1, sizeof(__pyx_k_Splitting_S__1_0_b1_A0_a0_B1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Splitting_S__1_0_b1_A0_a0_B1 */
  {__pyx_k_Splitting_S__d_d, sizeof(__pyx_k_Splitting_S__d_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Splitting_S__d_d */
  {__pyx_k_Stabilizer, sizeof(__pyx_k_Stabilizer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Stabilizer */
  {__pyx_k_Starting_the_link_editor_Select, sizeof(__pyx_k_Starting_the_link_editor_Select), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Starting_the_link_editor_Select */
  {__pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StopIteration */
  {__pyx_k_StrLongestLen, sizeof(__pyx_k_StrLongestLen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StrLongestLen */
  {__pyx_k_StrLongestLen_locals_genexpr, sizeof(__pyx_k_StrLongestLen_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StrLongestLen_locals_genexpr */
  {__pyx_k_Supply_a_manifold_or_generators, sizeof(__pyx_k_Supply_a_manifold_or_generators), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Supply_a_manifold_or_generators */
  {__pyx_k_Supported_cover_types_are_all_an, sizeof(__pyx_k_Supported_cover_types_are_all_an), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Supported_cover_types_are_all_an */
  {__pyx_k_Supported_methods_are_low_index, sizeof(__pyx_k_Supported_methods_are_low_index), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Supported_methods_are_low_index */
  {__pyx_k_Surface, sizeof(__pyx_k_Surface), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Surface */
  {__pyx_k_SymmetryGroup, sizeof(__pyx_k_SymmetryGroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup */
  {__pyx_k_SymmetryGroup___reduce_cython, sizeof(__pyx_k_SymmetryGroup___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup___reduce_cython */
  {__pyx_k_SymmetryGroup___setstate_cython, sizeof(__pyx_k_SymmetryGroup___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup___setstate_cython */
  {__pyx_k_SymmetryGroup_abelian_descriptio, sizeof(__pyx_k_SymmetryGroup_abelian_descriptio), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_abelian_descriptio */
  {__pyx_k_SymmetryGroup_abelian_descriptio_2, sizeof(__pyx_k_SymmetryGroup_abelian_descriptio_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_abelian_descriptio_2 */
  {__pyx_k_SymmetryGroup_abelianization, sizeof(__pyx_k_SymmetryGroup_abelianization), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_abelianization */
  {__pyx_k_SymmetryGroup_abelianization_lin, sizeof(__pyx_k_SymmetryGroup_abelianization_lin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_abelianization_lin */
  {__pyx_k_SymmetryGroup_center, sizeof(__pyx_k_SymmetryGroup_center), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_center */
  {__pyx_k_SymmetryGroup_center_line_256, sizeof(__pyx_k_SymmetryGroup_center_line_256), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_center_line_256 */
  {__pyx_k_SymmetryGroup_commutator_subgrou, sizeof(__pyx_k_SymmetryGroup_commutator_subgrou), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_commutator_subgrou */
  {__pyx_k_SymmetryGroup_commutator_subgrou_2, sizeof(__pyx_k_SymmetryGroup_commutator_subgrou_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_commutator_subgrou_2 */
  {__pyx_k_SymmetryGroup_direct_product_des, sizeof(__pyx_k_SymmetryGroup_direct_product_des), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_direct_product_des */
  {__pyx_k_SymmetryGroup_direct_product_des_2, sizeof(__pyx_k_SymmetryGroup_direct_product_des_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_direct_product_des_2 */
  {__pyx_k_SymmetryGroup_is_S5, sizeof(__pyx_k_SymmetryGroup_is_S5), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_S5 */
  {__pyx_k_SymmetryGroup_is_abelian, sizeof(__pyx_k_SymmetryGroup_is_abelian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_abelian */
  {__pyx_k_SymmetryGroup_is_abelian_line_72, sizeof(__pyx_k_SymmetryGroup_is_abelian_line_72), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_is_abelian_line_72 */
  {__pyx_k_SymmetryGroup_is_amphicheiral, sizeof(__pyx_k_SymmetryGroup_is_amphicheiral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_amphicheiral */
  {__pyx_k_SymmetryGroup_is_amphicheiral_li, sizeof(__pyx_k_SymmetryGroup_is_amphicheiral_li), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_is_amphicheiral_li */
  {__pyx_k_SymmetryGroup_is_dihedral, sizeof(__pyx_k_SymmetryGroup_is_dihedral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_dihedral */
  {__pyx_k_SymmetryGroup_is_dihedral_line_1, sizeof(__pyx_k_SymmetryGroup_is_dihedral_line_1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_is_dihedral_line_1 */
  {__pyx_k_SymmetryGroup_is_direct_product, sizeof(__pyx_k_SymmetryGroup_is_direct_product), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_direct_product */
  {__pyx_k_SymmetryGroup_is_direct_product_2, sizeof(__pyx_k_SymmetryGroup_is_direct_product_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_is_direct_product_2 */
  {__pyx_k_SymmetryGroup_is_full_group, sizeof(__pyx_k_SymmetryGroup_is_full_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_full_group */
  {__pyx_k_SymmetryGroup_is_full_group_line, sizeof(__pyx_k_SymmetryGroup_is_full_group_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_is_full_group_line */
  {__pyx_k_SymmetryGroup_is_invertible_knot, sizeof(__pyx_k_SymmetryGroup_is_invertible_knot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_invertible_knot */
  {__pyx_k_SymmetryGroup_is_invertible_knot_2, sizeof(__pyx_k_SymmetryGroup_is_invertible_knot_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_is_invertible_knot_2 */
  {__pyx_k_SymmetryGroup_is_polyhedral, sizeof(__pyx_k_SymmetryGroup_is_polyhedral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_is_polyhedral */
  {__pyx_k_SymmetryGroup_isometries, sizeof(__pyx_k_SymmetryGroup_isometries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_isometries */
  {__pyx_k_SymmetryGroup_isometries_line_29, sizeof(__pyx_k_SymmetryGroup_isometries_line_29), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_isometries_line_29 */
  {__pyx_k_SymmetryGroup_multiply_elements, sizeof(__pyx_k_SymmetryGroup_multiply_elements), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_multiply_elements */
  {__pyx_k_SymmetryGroup_multiply_elements_2, sizeof(__pyx_k_SymmetryGroup_multiply_elements_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_multiply_elements_2 */
  {__pyx_k_SymmetryGroup_order, sizeof(__pyx_k_SymmetryGroup_order), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_order */
  {__pyx_k_SymmetryGroup_order_line_62, sizeof(__pyx_k_SymmetryGroup_order_line_62), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymmetryGroup_order_line_62 */
  {__pyx_k_SymmetryGroup_polyhedral_descrip, sizeof(__pyx_k_SymmetryGroup_polyhedral_descrip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymmetryGroup_polyhedral_descrip */
  {__pyx_k_T, sizeof(__pyx_k_T), 0, 1, 1}, /* PyObject cname: __pyx_n_u_T */
  {__pyx_k_TEXT, sizeof(__pyx_k_TEXT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TEXT */
  {__pyx_k_Tetrahedra_data_appears_invalid, sizeof(__pyx_k_Tetrahedra_data_appears_invalid), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Tetrahedra_data_appears_invalid */
  {__pyx_k_That_Magma_type_not_recognized, sizeof(__pyx_k_That_Magma_type_not_recognized), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_That_Magma_type_not_recognized */
  {__pyx_k_The_Chern_Simons_invariant_isn_t, sizeof(__pyx_k_The_Chern_Simons_invariant_isn_t), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Chern_Simons_invariant_isn_t */
  {__pyx_k_The_Dehn_filling_coefficients_mu, sizeof(__pyx_k_The_Dehn_filling_coefficients_mu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Dehn_filling_coefficients_mu */
  {__pyx_k_The_Dirichlet_Domain_was_compute, sizeof(__pyx_k_The_Dirichlet_Domain_was_compute), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Dirichlet_Domain_was_compute */
  {__pyx_k_The_Dirichlet_Domain_was_not_com, sizeof(__pyx_k_The_Dirichlet_Domain_was_not_com), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Dirichlet_Domain_was_not_com */
  {__pyx_k_The_Dirichlet_construction_faile, sizeof(__pyx_k_The_Dirichlet_construction_faile), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Dirichlet_construction_faile */
  {__pyx_k_The_Dirichlet_domain_could_not_b, sizeof(__pyx_k_The_Dirichlet_domain_could_not_b), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Dirichlet_domain_could_not_b */
  {__pyx_k_The_Ford_domain_construction_fai, sizeof(__pyx_k_The_Ford_domain_construction_fai), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Ford_domain_construction_fai */
  {__pyx_k_The_HoroballViewer_class_was_not, sizeof(__pyx_k_The_HoroballViewer_class_was_not), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_HoroballViewer_class_was_not */
  {__pyx_k_The_Manifold_is_not_orientable_s, sizeof(__pyx_k_The_Manifold_is_not_orientable_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Manifold_is_not_orientable_s */
  {__pyx_k_The_MorwenLinks_class_has_been_r, sizeof(__pyx_k_The_MorwenLinks_class_has_been_r), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_MorwenLinks_class_has_been_r */
  {__pyx_k_The_Morwen_8_tetrahedra_manifold, sizeof(__pyx_k_The_Morwen_8_tetrahedra_manifold), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Morwen_8_tetrahedra_manifold */
  {__pyx_k_The_PolyhedronViewer_class_was_n, sizeof(__pyx_k_The_PolyhedronViewer_class_was_n), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_PolyhedronViewer_class_was_n */
  {__pyx_k_The_SnapPea_kernel_couldn_t_comp, sizeof(__pyx_k_The_SnapPea_kernel_couldn_t_comp), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_SnapPea_kernel_couldn_t_comp */
  {__pyx_k_The_SnapPea_kernel_was_not_able, sizeof(__pyx_k_The_SnapPea_kernel_was_not_able), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_SnapPea_kernel_was_not_able */
  {__pyx_k_The_Triangulation_is_already_ori, sizeof(__pyx_k_The_Triangulation_is_already_ori), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Triangulation_is_already_ori */
  {__pyx_k_The_Triangulation_is_empty, sizeof(__pyx_k_The_Triangulation_is_empty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Triangulation_is_empty */
  {__pyx_k_The_Triangulation_is_empty_2, sizeof(__pyx_k_The_Triangulation_is_empty_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Triangulation_is_empty_2 */
  {__pyx_k_The_Triangulation_must_be_empty, sizeof(__pyx_k_The_Triangulation_must_be_empty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_Triangulation_must_be_empty */
  {__pyx_k_The_amount_of_data_given_is_not, sizeof(__pyx_k_The_amount_of_data_given_is_not), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_amount_of_data_given_is_not */
  {__pyx_k_The_braid_word_is_invalid, sizeof(__pyx_k_The_braid_word_is_invalid), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_braid_word_is_invalid */
  {__pyx_k_The_census_knot_s_was_not_found, sizeof(__pyx_k_The_census_knot_s_was_not_found), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_census_knot_s_was_not_found */
  {__pyx_k_The_curve_is_not_isotopic_to_a_g, sizeof(__pyx_k_The_curve_is_not_isotopic_to_a_g), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_curve_is_not_isotopic_to_a_g */
  {__pyx_k_The_cusp_neighborhood_constructi, sizeof(__pyx_k_The_cusp_neighborhood_constructi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_cusp_neighborhood_constructi */
  {__pyx_k_The_data_given_do_not_have_the_r, sizeof(__pyx_k_The_data_given_do_not_have_the_r), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_data_given_do_not_have_the_r */
  {__pyx_k_The_data_provided_are_invalid_fo, sizeof(__pyx_k_The_data_provided_are_invalid_fo), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_data_provided_are_invalid_fo */
  {__pyx_k_The_data_provided_does_not_give, sizeof(__pyx_k_The_data_provided_does_not_give), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_data_provided_does_not_give */
  {__pyx_k_The_data_provided_does_not_give_2, sizeof(__pyx_k_The_data_provided_does_not_give_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_data_provided_does_not_give_2 */
  {__pyx_k_The_drilling_curve_requested_is, sizeof(__pyx_k_The_drilling_curve_requested_is), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_drilling_curve_requested_is */
  {__pyx_k_The_elementary_divisors_must_for, sizeof(__pyx_k_The_elementary_divisors_must_for), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_elementary_divisors_must_for */
  {__pyx_k_The_empty_triangulation_has_no_n, sizeof(__pyx_k_The_empty_triangulation_has_no_n), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_empty_triangulation_has_no_n */
  {__pyx_k_The_full_symmetry_group_is_not_k, sizeof(__pyx_k_The_full_symmetry_group_is_not_k), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_full_symmetry_group_is_not_k */
  {__pyx_k_The_full_symmetry_group_not_know, sizeof(__pyx_k_The_full_symmetry_group_not_know), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_full_symmetry_group_not_know */
  {__pyx_k_The_generator_data_does_not_star, sizeof(__pyx_k_The_generator_data_does_not_star), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_generator_data_does_not_star */
  {__pyx_k_The_homomorphism_image_is_not_a, sizeof(__pyx_k_The_homomorphism_image_is_not_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_homomorphism_image_is_not_a */
  {__pyx_k_The_horoball_construction_failed, sizeof(__pyx_k_The_horoball_construction_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_horoball_construction_failed */
  {__pyx_k_The_link_complement_s_was_not_fo, sizeof(__pyx_k_The_link_complement_s_was_not_fo), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_link_complement_s_was_not_fo */
  {__pyx_k_The_manifold_file, sizeof(__pyx_k_The_manifold_file), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_manifold_file */
  {__pyx_k_The_method_must_be_fold_or_layer, sizeof(__pyx_k_The_method_must_be_fold_or_layer), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_method_must_be_fold_or_layer */
  {__pyx_k_The_number_of_fillings_specified, sizeof(__pyx_k_The_number_of_fillings_specified), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_number_of_fillings_specified */
  {__pyx_k_The_peripheral_data, sizeof(__pyx_k_The_peripheral_data), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_peripheral_data */
  {__pyx_k_The_peripheral_data_s_is_not_acc, sizeof(__pyx_k_The_peripheral_data_s_is_not_acc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_peripheral_data_s_is_not_acc */
  {__pyx_k_The_permutation_list_is_invalid, sizeof(__pyx_k_The_permutation_list_is_invalid), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_permutation_list_is_invalid */
  {__pyx_k_The_solution_type_is_s, sizeof(__pyx_k_The_solution_type_is_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_solution_type_is_s */
  {__pyx_k_The_specified_cusp_s_does_not_ex, sizeof(__pyx_k_The_specified_cusp_s_does_not_ex), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_specified_cusp_s_does_not_ex */
  {__pyx_k_The_specified_edge_index_s_is_in, sizeof(__pyx_k_The_specified_edge_index_s_is_in), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_specified_edge_index_s_is_in */
  {__pyx_k_The_specified_face_index_s_is_in, sizeof(__pyx_k_The_specified_face_index_s_is_in), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_specified_face_index_s_is_in */
  {__pyx_k_The_specified_indices_to_be_fill, sizeof(__pyx_k_The_specified_indices_to_be_fill), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_specified_indices_to_be_fill */
  {__pyx_k_The_specified_tetrahedron_s_does, sizeof(__pyx_k_The_specified_tetrahedron_s_does), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_specified_tetrahedron_s_does */
  {__pyx_k_The_symmetry_group_has_only_d_el, sizeof(__pyx_k_The_symmetry_group_has_only_d_el), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_symmetry_group_has_only_d_el */
  {__pyx_k_The_symmetry_group_is_not_a_nont, sizeof(__pyx_k_The_symmetry_group_is_not_a_nont), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_symmetry_group_is_not_a_nont */
  {__pyx_k_The_symmetry_group_is_not_abelia, sizeof(__pyx_k_The_symmetry_group_is_not_abelia), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_symmetry_group_is_not_abelia */
  {__pyx_k_The_symmetry_group_is_not_polyhe, sizeof(__pyx_k_The_symmetry_group_is_not_polyhe), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_symmetry_group_is_not_polyhe */
  {__pyx_k_The_triangulation_construction_f, sizeof(__pyx_k_The_triangulation_construction_f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_triangulation_construction_f */
  {__pyx_k_The_word_contains_a_non_generato, sizeof(__pyx_k_The_word_contains_a_non_generato), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_word_contains_a_non_generato */
  {__pyx_k_There_are_only_201_census_knots, sizeof(__pyx_k_There_are_only_201_census_knots), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_There_are_only_201_census_knots */
  {__pyx_k_This_census_does_not_support_man, sizeof(__pyx_k_This_census_does_not_support_man), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_This_census_does_not_support_man */
  {__pyx_k_To_permanently_fill_a_cusp_the_D, sizeof(__pyx_k_To_permanently_fill_a_cusp_the_D), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_To_permanently_fill_a_cusp_the_D */
  {__pyx_k_Triangulation, sizeof(__pyx_k_Triangulation), 0, 0, 0}, /* PyObject cname: __pyx_kp_b_Triangulation */
  {__pyx_k_Triangulation, sizeof(__pyx_k_Triangulation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation */
  {__pyx_k_Triangulation_2, sizeof(__pyx_k_Triangulation_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_2 */
  {__pyx_k_Triangulation_DT_code, sizeof(__pyx_k_Triangulation_DT_code), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_DT_code */
  {__pyx_k_Triangulation_DT_code_line_1108, sizeof(__pyx_k_Triangulation_DT_code_line_1108), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_DT_code_line_1108 */
  {__pyx_k_Triangulation___reduce, sizeof(__pyx_k_Triangulation___reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation___reduce */
  {__pyx_k_Triangulation___reduce___line_88, sizeof(__pyx_k_Triangulation___reduce___line_88), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation___reduce___line_88 */
  {__pyx_k_Triangulation__covers_gap, sizeof(__pyx_k_Triangulation__covers_gap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__covers_gap */
  {__pyx_k_Triangulation__covers_low_index, sizeof(__pyx_k_Triangulation__covers_low_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__covers_low_index */
  {__pyx_k_Triangulation__covers_magma, sizeof(__pyx_k_Triangulation__covers_magma), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__covers_magma */
  {__pyx_k_Triangulation__covers_snappea, sizeof(__pyx_k_Triangulation__covers_snappea), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__covers_snappea */
  {__pyx_k_Triangulation__empty_save, sizeof(__pyx_k_Triangulation__empty_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__empty_save */
  {__pyx_k_Triangulation__from_bytes, sizeof(__pyx_k_Triangulation__from_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__from_bytes */
  {__pyx_k_Triangulation__from_bytes_line_7, sizeof(__pyx_k_Triangulation__from_bytes_line_7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__from_bytes_line_7 */
  {__pyx_k_Triangulation__from_isosig, sizeof(__pyx_k_Triangulation__from_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__from_isosig */
  {__pyx_k_Triangulation__from_isosig_line, sizeof(__pyx_k_Triangulation__from_isosig_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__from_isosig_line */
  {__pyx_k_Triangulation__from_pickle, sizeof(__pyx_k_Triangulation__from_pickle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__from_pickle */
  {__pyx_k_Triangulation__from_string, sizeof(__pyx_k_Triangulation__from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__from_string */
  {__pyx_k_Triangulation__from_string_line, sizeof(__pyx_k_Triangulation__from_string_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__from_string_line */
  {__pyx_k_Triangulation__from_tetrahedra_g, sizeof(__pyx_k_Triangulation__from_tetrahedra_g), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__from_tetrahedra_g */
  {__pyx_k_Triangulation__from_tetrahedra_g_2, sizeof(__pyx_k_Triangulation__from_tetrahedra_g_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__from_tetrahedra_g_2 */
  {__pyx_k_Triangulation__get_cusp_indices, sizeof(__pyx_k_Triangulation__get_cusp_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__get_cusp_indices */
  {__pyx_k_Triangulation__get_from_link_dat, sizeof(__pyx_k_Triangulation__get_from_link_dat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__get_from_link_dat */
  {__pyx_k_Triangulation__get_tetrahedra_gl, sizeof(__pyx_k_Triangulation__get_tetrahedra_gl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__get_tetrahedra_gl */
  {__pyx_k_Triangulation__is_symplectic, sizeof(__pyx_k_Triangulation__is_symplectic), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__is_symplectic */
  {__pyx_k_Triangulation__isomorphisms_to, sizeof(__pyx_k_Triangulation__isomorphisms_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__isomorphisms_to */
  {__pyx_k_Triangulation__isomorphisms_to_l, sizeof(__pyx_k_Triangulation__isomorphisms_to_l), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__isomorphisms_to_l */
  {__pyx_k_Triangulation__marked_tetrahedra, sizeof(__pyx_k_Triangulation__marked_tetrahedra), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__marked_tetrahedra */
  {__pyx_k_Triangulation__num_fake_cusps, sizeof(__pyx_k_Triangulation__num_fake_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__num_fake_cusps */
  {__pyx_k_Triangulation__num_fake_cusps_li, sizeof(__pyx_k_Triangulation__num_fake_cusps_li), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__num_fake_cusps_li */
  {__pyx_k_Triangulation__polish_hyperbolic, sizeof(__pyx_k_Triangulation__polish_hyperbolic), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__polish_hyperbolic */
  {__pyx_k_Triangulation__presentation_matr, sizeof(__pyx_k_Triangulation__presentation_matr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__presentation_matr */
  {__pyx_k_Triangulation__ptolemy_equations, sizeof(__pyx_k_Triangulation__ptolemy_equations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__ptolemy_equations */
  {__pyx_k_Triangulation__ptolemy_equations_2, sizeof(__pyx_k_Triangulation__ptolemy_equations_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__ptolemy_equations_2 */
  {__pyx_k_Triangulation__ptolemy_equations_3, sizeof(__pyx_k_Triangulation__ptolemy_equations_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__ptolemy_equations_3 */
  {__pyx_k_Triangulation__ptolemy_equations_4, sizeof(__pyx_k_Triangulation__ptolemy_equations_4), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__ptolemy_equations_4 */
  {__pyx_k_Triangulation__ptolemy_equations_5, sizeof(__pyx_k_Triangulation__ptolemy_equations_5), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__ptolemy_equations_5 */
  {__pyx_k_Triangulation__ptolemy_equations_6, sizeof(__pyx_k_Triangulation__ptolemy_equations_6), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__ptolemy_equations_6 */
  {__pyx_k_Triangulation__reindex_cusps, sizeof(__pyx_k_Triangulation__reindex_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__reindex_cusps */
  {__pyx_k_Triangulation__reindex_cusps_lin, sizeof(__pyx_k_Triangulation__reindex_cusps_lin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__reindex_cusps_lin */
  {__pyx_k_Triangulation__remove_finite_ver, sizeof(__pyx_k_Triangulation__remove_finite_ver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__remove_finite_ver */
  {__pyx_k_Triangulation__remove_finite_ver_2, sizeof(__pyx_k_Triangulation__remove_finite_ver_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__remove_finite_ver_2 */
  {__pyx_k_Triangulation__set_DTcode, sizeof(__pyx_k_Triangulation__set_DTcode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__set_DTcode */
  {__pyx_k_Triangulation__set_PDcode, sizeof(__pyx_k_Triangulation__set_PDcode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__set_PDcode */
  {__pyx_k_Triangulation__symplectic_form, sizeof(__pyx_k_Triangulation__symplectic_form), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__symplectic_form */
  {__pyx_k_Triangulation__three_to_two, sizeof(__pyx_k_Triangulation__three_to_two), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__three_to_two */
  {__pyx_k_Triangulation__to_bytes, sizeof(__pyx_k_Triangulation__to_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__to_bytes */
  {__pyx_k_Triangulation__to_bytes_line_723, sizeof(__pyx_k_Triangulation__to_bytes_line_723), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__to_bytes_line_723 */
  {__pyx_k_Triangulation__to_string, sizeof(__pyx_k_Triangulation__to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__to_string */
  {__pyx_k_Triangulation__to_string_line_67, sizeof(__pyx_k_Triangulation__to_string_line_67), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__to_string_line_67 */
  {__pyx_k_Triangulation__two_to_three, sizeof(__pyx_k_Triangulation__two_to_three), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__two_to_three */
  {__pyx_k_Triangulation__undecorated_trian, sizeof(__pyx_k_Triangulation__undecorated_trian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__undecorated_trian */
  {__pyx_k_Triangulation__unsimplified_fill, sizeof(__pyx_k_Triangulation__unsimplified_fill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation__unsimplified_fill */
  {__pyx_k_Triangulation__unsimplified_fill_2, sizeof(__pyx_k_Triangulation__unsimplified_fill_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation__unsimplified_fill_2 */
  {__pyx_k_Triangulation_and_text_files, sizeof(__pyx_k_Triangulation_and_text_files), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_and_text_files */
  {__pyx_k_Triangulation_contains_cusps_onl, sizeof(__pyx_k_Triangulation_contains_cusps_onl), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_contains_cusps_onl */
  {__pyx_k_Triangulation_copy, sizeof(__pyx_k_Triangulation_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_copy */
  {__pyx_k_Triangulation_copy_line_466, sizeof(__pyx_k_Triangulation_copy_line_466), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_copy_line_466 */
  {__pyx_k_Triangulation_cover, sizeof(__pyx_k_Triangulation_cover), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_cover */
  {__pyx_k_Triangulation_cover_info, sizeof(__pyx_k_Triangulation_cover_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_cover_info */
  {__pyx_k_Triangulation_cover_line_2395, sizeof(__pyx_k_Triangulation_cover_line_2395), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_cover_line_2395 */
  {__pyx_k_Triangulation_covers, sizeof(__pyx_k_Triangulation_covers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_covers */
  {__pyx_k_Triangulation_covers_line_2497, sizeof(__pyx_k_Triangulation_covers_line_2497), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_covers_line_2497 */
  {__pyx_k_Triangulation_cusp_info, sizeof(__pyx_k_Triangulation_cusp_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_cusp_info */
  {__pyx_k_Triangulation_cusp_info_line_123, sizeof(__pyx_k_Triangulation_cusp_info_line_123), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_cusp_info_line_123 */
  {__pyx_k_Triangulation_dehn_fill, sizeof(__pyx_k_Triangulation_dehn_fill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_dehn_fill */
  {__pyx_k_Triangulation_dehn_fill_line_116, sizeof(__pyx_k_Triangulation_dehn_fill_line_116), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_dehn_fill_line_116 */
  {__pyx_k_Triangulation_edge_valences, sizeof(__pyx_k_Triangulation_edge_valences), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_edge_valences */
  {__pyx_k_Triangulation_edge_valences_line, sizeof(__pyx_k_Triangulation_edge_valences_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_edge_valences_line */
  {__pyx_k_Triangulation_filled_triangulati, sizeof(__pyx_k_Triangulation_filled_triangulati), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_filled_triangulati */
  {__pyx_k_Triangulation_filled_triangulati_2, sizeof(__pyx_k_Triangulation_filled_triangulati_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_filled_triangulati_2 */
  {__pyx_k_Triangulation_from_Manifold, sizeof(__pyx_k_Triangulation_from_Manifold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_from_Manifold */
  {__pyx_k_Triangulation_fundamental_group, sizeof(__pyx_k_Triangulation_fundamental_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_fundamental_group */
  {__pyx_k_Triangulation_fundamental_group_2, sizeof(__pyx_k_Triangulation_fundamental_group_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_fundamental_group_2 */
  {__pyx_k_Triangulation_gluing_equations, sizeof(__pyx_k_Triangulation_gluing_equations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_gluing_equations */
  {__pyx_k_Triangulation_gluing_equations_l, sizeof(__pyx_k_Triangulation_gluing_equations_l), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_gluing_equations_l */
  {__pyx_k_Triangulation_gluing_equations_p, sizeof(__pyx_k_Triangulation_gluing_equations_p), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_gluing_equations_p */
  {__pyx_k_Triangulation_gluing_equations_p_2, sizeof(__pyx_k_Triangulation_gluing_equations_p_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_gluing_equations_p_2 */
  {__pyx_k_Triangulation_has_finite_vertice, sizeof(__pyx_k_Triangulation_has_finite_vertice), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_has_finite_vertice */
  {__pyx_k_Triangulation_has_finite_vertice_2, sizeof(__pyx_k_Triangulation_has_finite_vertice_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_has_finite_vertice_2 */
  {__pyx_k_Triangulation_homology, sizeof(__pyx_k_Triangulation_homology), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_homology */
  {__pyx_k_Triangulation_homology_line_2311, sizeof(__pyx_k_Triangulation_homology_line_2311), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_homology_line_2311 */
  {__pyx_k_Triangulation_is_orientable, sizeof(__pyx_k_Triangulation_is_orientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_is_orientable */
  {__pyx_k_Triangulation_is_orientable_line, sizeof(__pyx_k_Triangulation_is_orientable_line), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_is_orientable_line */
  {__pyx_k_Triangulation_isomorphisms_to, sizeof(__pyx_k_Triangulation_isomorphisms_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_isomorphisms_to */
  {__pyx_k_Triangulation_link, sizeof(__pyx_k_Triangulation_link), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_link */
  {__pyx_k_Triangulation_name, sizeof(__pyx_k_Triangulation_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_name */
  {__pyx_k_Triangulation_name_line_1081, sizeof(__pyx_k_Triangulation_name_line_1081), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_name_line_1081 */
  {__pyx_k_Triangulation_num_cusps, sizeof(__pyx_k_Triangulation_num_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_num_cusps */
  {__pyx_k_Triangulation_num_cusps_line_387, sizeof(__pyx_k_Triangulation_num_cusps_line_387), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_num_cusps_line_387 */
  {__pyx_k_Triangulation_num_tetrahedra, sizeof(__pyx_k_Triangulation_num_tetrahedra), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_num_tetrahedra */
  {__pyx_k_Triangulation_num_tetrahedra_lin, sizeof(__pyx_k_Triangulation_num_tetrahedra_lin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_num_tetrahedra_lin */
  {__pyx_k_Triangulation_or_Manifold, sizeof(__pyx_k_Triangulation_or_Manifold), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_or_Manifold */
  {__pyx_k_Triangulation_orientation_cover, sizeof(__pyx_k_Triangulation_orientation_cover), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_orientation_cover */
  {__pyx_k_Triangulation_orientation_cover_2, sizeof(__pyx_k_Triangulation_orientation_cover_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_orientation_cover_2 */
  {__pyx_k_Triangulation_pickle, sizeof(__pyx_k_Triangulation_pickle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_pickle */
  {__pyx_k_Triangulation_plink, sizeof(__pyx_k_Triangulation_plink), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_plink */
  {__pyx_k_Triangulation_plink_line_343, sizeof(__pyx_k_Triangulation_plink_line_343), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_plink_line_343 */
  {__pyx_k_Triangulation_ptolemy_generalize, sizeof(__pyx_k_Triangulation_ptolemy_generalize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_ptolemy_generalize */
  {__pyx_k_Triangulation_ptolemy_generalize_2, sizeof(__pyx_k_Triangulation_ptolemy_generalize_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_ptolemy_generalize_2 */
  {__pyx_k_Triangulation_ptolemy_obstructio, sizeof(__pyx_k_Triangulation_ptolemy_obstructio), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_ptolemy_obstructio */
  {__pyx_k_Triangulation_ptolemy_obstructio_2, sizeof(__pyx_k_Triangulation_ptolemy_obstructio_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_ptolemy_obstructio_2 */
  {__pyx_k_Triangulation_ptolemy_variety, sizeof(__pyx_k_Triangulation_ptolemy_variety), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_ptolemy_variety */
  {__pyx_k_Triangulation_ptolemy_variety_li, sizeof(__pyx_k_Triangulation_ptolemy_variety_li), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_ptolemy_variety_li */
  {__pyx_k_Triangulation_randomize, sizeof(__pyx_k_Triangulation_randomize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_randomize */
  {__pyx_k_Triangulation_randomize_line_483, sizeof(__pyx_k_Triangulation_randomize_line_483), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_randomize_line_483 */
  {__pyx_k_Triangulation_reverse_orientatio, sizeof(__pyx_k_Triangulation_reverse_orientatio), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_reverse_orientatio */
  {__pyx_k_Triangulation_reverse_orientatio_2, sizeof(__pyx_k_Triangulation_reverse_orientatio_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_reverse_orientatio_2 */
  {__pyx_k_Triangulation_save, sizeof(__pyx_k_Triangulation_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_save */
  {__pyx_k_Triangulation_save_line_653, sizeof(__pyx_k_Triangulation_save_line_653), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_save_line_653 */
  {__pyx_k_Triangulation_set_name, sizeof(__pyx_k_Triangulation_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_set_name */
  {__pyx_k_Triangulation_set_name_line_1093, sizeof(__pyx_k_Triangulation_set_name_line_1093), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_set_name_line_1093 */
  {__pyx_k_Triangulation_set_peripheral_cur, sizeof(__pyx_k_Triangulation_set_peripheral_cur), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_set_peripheral_cur */
  {__pyx_k_Triangulation_simplify, sizeof(__pyx_k_Triangulation_simplify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_simplify */
  {__pyx_k_Triangulation_simplify_line_497, sizeof(__pyx_k_Triangulation_simplify_line_497), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_simplify_line_497 */
  {__pyx_k_Triangulation_symplectic_basis, sizeof(__pyx_k_Triangulation_symplectic_basis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_symplectic_basis */
  {__pyx_k_Triangulation_symplectic_basis_l, sizeof(__pyx_k_Triangulation_symplectic_basis_l), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_symplectic_basis_l */
  {__pyx_k_Triangulation_triangulation_isos, sizeof(__pyx_k_Triangulation_triangulation_isos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_triangulation_isos */
  {__pyx_k_Triangulation_triangulation_isos_2, sizeof(__pyx_k_Triangulation_triangulation_isos_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_triangulation_isos_2 */
  {__pyx_k_Triangulation_with_hyperbolic_st, sizeof(__pyx_k_Triangulation_with_hyperbolic_st), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Triangulation_with_hyperbolic_st */
  {__pyx_k_Triangulation_with_hyperbolic_st_2, sizeof(__pyx_k_Triangulation_with_hyperbolic_st_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Triangulation_with_hyperbolic_st_2 */
  {__pyx_k_Try_to_simplify_the_triangulati, sizeof(__pyx_k_Try_to_simplify_the_triangulati), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Try_to_simplify_the_triangulati */
  {__pyx_k_Type, sizeof(__pyx_k_Type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Type */
  {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */
  {__pyx_k_UI_callback, sizeof(__pyx_k_UI_callback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UI_callback */
  {__pyx_k_Used_by_pickle_dumps_from_pickl, sizeof(__pyx_k_Used_by_pickle_dumps_from_pickl), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Used_by_pickle_dumps_from_pickl */
  {__pyx_k_Used_by_the_pickle_module_to_pi, sizeof(__pyx_k_Used_by_the_pickle_module_to_pi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Used_by_the_pickle_module_to_pi */
  {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */
  {__pyx_k_Verified_and_arbitrary_precision, sizeof(__pyx_k_Verified_and_arbitrary_precision), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Verified_and_arbitrary_precision */
  {__pyx_k_ViewerWindow, sizeof(__pyx_k_ViewerWindow), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ViewerWindow */
  {__pyx_k_WARNING_Users_should_not_use_th, sizeof(__pyx_k_WARNING_Users_should_not_use_th), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_WARNING_Users_should_not_use_th */
  {__pyx_k_WARNING_Users_should_not_use_th_2, sizeof(__pyx_k_WARNING_Users_should_not_use_th_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_WARNING_Users_should_not_use_th_2 */
  {__pyx_k_WARNING_Users_should_not_use_th_3, sizeof(__pyx_k_WARNING_Users_should_not_use_th_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_WARNING_Users_should_not_use_th_3 */
  {__pyx_k_Warning_Result_is_not_symplectic, sizeof(__pyx_k_Warning_Result_is_not_symplectic), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Warning_Result_is_not_symplectic */
  {__pyx_k_Words_must_be_represented_as_Pyt, sizeof(__pyx_k_Words_must_be_represented_as_Pyt), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Words_must_be_represented_as_Pyt */
  {__pyx_k_Wrong_equation_type, sizeof(__pyx_k_Wrong_equation_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Wrong_equation_type */
  {__pyx_k_X, sizeof(__pyx_k_X), 0, 1, 1}, /* PyObject cname: __pyx_n_u_X */
  {__pyx_k_Xbackward_neighbor, sizeof(__pyx_k_Xbackward_neighbor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Xbackward_neighbor */
  {__pyx_k_Xbackward_strand, sizeof(__pyx_k_Xbackward_strand), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Xbackward_strand */
  {__pyx_k_Xcomponent, sizeof(__pyx_k_Xcomponent), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Xcomponent */
  {__pyx_k_Xforward_neighbor, sizeof(__pyx_k_Xforward_neighbor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Xforward_neighbor */
  {__pyx_k_Xforward_strand, sizeof(__pyx_k_Xforward_strand), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Xforward_strand */
  {__pyx_k_Y, sizeof(__pyx_k_Y), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Y */
  {__pyx_k_Ybackward_neighbor, sizeof(__pyx_k_Ybackward_neighbor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Ybackward_neighbor */
  {__pyx_k_Ybackward_strand, sizeof(__pyx_k_Ybackward_strand), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Ybackward_strand */
  {__pyx_k_Ycomponent, sizeof(__pyx_k_Ycomponent), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Ycomponent */
  {__pyx_k_Yforward_neighbor, sizeof(__pyx_k_Yforward_neighbor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Yforward_neighbor */
  {__pyx_k_Yforward_strand, sizeof(__pyx_k_Yforward_strand), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Yforward_strand */
  {__pyx_k_You_have_specified_a_Hoste_Thist, sizeof(__pyx_k_You_have_specified_a_Hoste_Thist), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_have_specified_a_Hoste_Thist */
  {__pyx_k_You_must_apply_fillings_to_all_o, sizeof(__pyx_k_You_must_apply_fillings_to_all_o), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_must_apply_fillings_to_all_o */
  {__pyx_k_You_must_apply_shortest_to_all_o, sizeof(__pyx_k_You_must_apply_shortest_to_all_o), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_must_apply_shortest_to_all_o */
  {__pyx_k_You_provided_filling_data_for_to, sizeof(__pyx_k_You_provided_filling_data_for_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_provided_filling_data_for_to */
  {__pyx_k_You_provided_more_peripheral_dat, sizeof(__pyx_k_You_provided_more_peripheral_dat), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_provided_more_peripheral_dat */
  {__pyx_k_You_tried_to_create_an_empty_Sym, sizeof(__pyx_k_You_tried_to_create_an_empty_Sym), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_tried_to_create_an_empty_Sym */
  {__pyx_k_Z, sizeof(__pyx_k_Z), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Z */
  {__pyx_k_Z_d, sizeof(__pyx_k_Z_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Z_d */
  {__pyx_k__10, sizeof(__pyx_k__10), 0, 1, 1}, /* PyObject cname: __pyx_n_u__10 */
  {__pyx_k__10, sizeof(__pyx_k__10), 0, 0, 0}, /* PyObject cname: __pyx_kp_b__10 */
  {__pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__10 */
  {__pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__11 */
  {__pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__12 */
  {__pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__13 */
  {__pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__14 */
  {__pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__15 */
  {__pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__16 */
  {__pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__17 */
  {__pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__18 */
  {__pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__19 */
  {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */
  {__pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__20 */
  {__pyx_k__21, sizeof(__pyx_k__21), 0, 1, 1}, /* PyObject cname: __pyx_n_u__21 */
  {__pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__22 */
  {__pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__23 */
  {__pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__24 */
  {__pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__25 */
  {__pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__26 */
  {__pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__27 */
  {__pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__28 */
  {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */
  {__pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__30 */
  {__pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__32 */
  {__pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__33 */
  {__pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__34 */
  {__pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__35 */
  {__pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__36 */
  {__pyx_k__37, sizeof(__pyx_k__37), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__37 */
  {__pyx_k__39, sizeof(__pyx_k__39), 0, 0, 0}, /* PyObject cname: __pyx_kp_b__39 */
  {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */
  {__pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__40 */
  {__pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__41 */
  {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__5 */
  {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__6 */
  {__pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__7 */
  {__pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__8 */
  {__pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__9 */
  {__pyx_k_a, sizeof(__pyx_k_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_a */
  {__pyx_k_a_2, sizeof(__pyx_k_a_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_a_2 */
  {__pyx_k_a_il, sizeof(__pyx_k_a_il), 0, 1, 1}, /* PyObject cname: __pyx_n_u_a_il */
  {__pyx_k_a_zA_Z0_9, sizeof(__pyx_k_a_zA_Z0_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_a_zA_Z0_9 */
  {__pyx_k_abcABC__d_abcABC__d, sizeof(__pyx_k_abcABC__d_abcABC__d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_abcABC__d_abcABC__d */
  {__pyx_k_abcdefghijklmnopqrstuvwxyzZYXWV, sizeof(__pyx_k_abcdefghijklmnopqrstuvwxyzZYXWV), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_abcdefghijklmnopqrstuvwxyzZYXWV */
  {__pyx_k_abelian_description, sizeof(__pyx_k_abelian_description), 0, 1, 1}, /* PyObject cname: __pyx_n_u_abelian_description */
  {__pyx_k_abelianization, sizeof(__pyx_k_abelianization), 0, 1, 1}, /* PyObject cname: __pyx_n_u_abelianization */
  {__pyx_k_absImag, sizeof(__pyx_k_absImag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_absImag */
  {__pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 1, 1}, /* PyObject cname: __pyx_n_u_abspath */
  {__pyx_k_acc_log_im, sizeof(__pyx_k_acc_log_im), 0, 1, 1}, /* PyObject cname: __pyx_n_u_acc_log_im */
  {__pyx_k_acc_log_re, sizeof(__pyx_k_acc_log_re), 0, 1, 1}, /* PyObject cname: __pyx_n_u_acc_log_re */
  {__pyx_k_acc_rec_im, sizeof(__pyx_k_acc_rec_im), 0, 1, 1}, /* PyObject cname: __pyx_n_u_acc_rec_im */
  {__pyx_k_acc_rec_re, sizeof(__pyx_k_acc_rec_re), 0, 1, 1}, /* PyObject cname: __pyx_n_u_acc_rec_re */
  {__pyx_k_accuracies, sizeof(__pyx_k_accuracies), 0, 1, 1}, /* PyObject cname: __pyx_n_u_accuracies */
  {__pyx_k_accuracy, sizeof(__pyx_k_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_accuracy */
  {__pyx_k_add, sizeof(__pyx_k_add), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add */
  {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */
  {__pyx_k_add_rows, sizeof(__pyx_k_add_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_rows */
  {__pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_algorithm */
  {__pyx_k_all, sizeof(__pyx_k_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all */
  {__pyx_k_all_tables, sizeof(__pyx_k_all_tables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_tables */
  {__pyx_k_all_tetrahedra_positively_orient, sizeof(__pyx_k_all_tetrahedra_positively_orient), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_all_tetrahedra_positively_orient */
  {__pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 1, 1}, /* PyObject cname: __pyx_n_u_alpha */
  {__pyx_k_alternating_gz, sizeof(__pyx_k_alternating_gz), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_alternating_gz */
  {__pyx_k_alternation, sizeof(__pyx_k_alternation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_alternation */
  {__pyx_k_ans, sizeof(__pyx_k_ans), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ans */
  {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */
  {__pyx_k_are_isometric, sizeof(__pyx_k_are_isometric), 0, 1, 1}, /* PyObject cname: __pyx_n_u_are_isometric */
  {__pyx_k_args, sizeof(__pyx_k_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_args */
  {__pyx_k_as_ideal, sizeof(__pyx_k_as_ideal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_as_ideal */
  {__pyx_k_as_int_list, sizeof(__pyx_k_as_int_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_as_int_list */
  {__pyx_k_as_string, sizeof(__pyx_k_as_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_as_string */
  {__pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ascii */
  {__pyx_k_ascii_lowercase, sizeof(__pyx_k_ascii_lowercase), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ascii_lowercase */
  {__pyx_k_asksaveasfile, sizeof(__pyx_k_asksaveasfile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asksaveasfile */
  {__pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignments */
  {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */
  {__pyx_k_at_least, sizeof(__pyx_k_at_least), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_at_least */
  {__pyx_k_atexit, sizeof(__pyx_k_atexit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_atexit */
  {__pyx_k_b, sizeof(__pyx_k_b), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_b */
  {__pyx_k_b_2, sizeof(__pyx_k_b_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_2 */
  {__pyx_k_b_RL, sizeof(__pyx_k_b_RL), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_b_RL */
  {__pyx_k_b_RL_2, sizeof(__pyx_k_b_RL_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_b_RL_2 */
  {__pyx_k_b_RRL, sizeof(__pyx_k_b_RRL), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_b_RRL */
  {__pyx_k_b_RRL_2, sizeof(__pyx_k_b_RRL_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_b_RRL_2 */
  {__pyx_k_b_file_name, sizeof(__pyx_k_b_file_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_file_name */
  {__pyx_k_b_new_name, sizeof(__pyx_k_b_new_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_new_name */
  {__pyx_k_b_no_lLrR, sizeof(__pyx_k_b_no_lLrR), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_b_no_lLrR */
  {__pyx_k_b_string, sizeof(__pyx_k_b_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_string */
  {__pyx_k_ball, sizeof(__pyx_k_ball), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ball */
  {__pyx_k_base, sizeof(__pyx_k_base), 0, 1, 1}, /* PyObject cname: __pyx_n_u_base */
  {__pyx_k_bases, sizeof(__pyx_k_bases), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bases */
  {__pyx_k_basis, sizeof(__pyx_k_basis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_basis */
  {__pyx_k_betti_number, sizeof(__pyx_k_betti_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_betti_number */
  {__pyx_k_binary, sizeof(__pyx_k_binary), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_binary */
  {__pyx_k_binary_dihedral_group_2_2_d, sizeof(__pyx_k_binary_dihedral_group_2_2_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_binary_dihedral_group_2_2_d */
  {__pyx_k_bit, sizeof(__pyx_k_bit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bit */
  {__pyx_k_bits_prec, sizeof(__pyx_k_bits_prec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bits_prec */
  {__pyx_k_blowup_multiple, sizeof(__pyx_k_blowup_multiple), 0, 1, 1}, /* PyObject cname: __pyx_n_u_blowup_multiple */
  {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */
  {__pyx_k_browse, sizeof(__pyx_k_browse), 0, 1, 1}, /* PyObject cname: __pyx_n_u_browse */
  {__pyx_k_browser, sizeof(__pyx_k_browser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_browser */
  {__pyx_k_bundle, sizeof(__pyx_k_bundle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bundle */
  {__pyx_k_bundle_from_string, sizeof(__pyx_k_bundle_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bundle_from_string */
  {__pyx_k_byte, sizeof(__pyx_k_byte), 0, 1, 1}, /* PyObject cname: __pyx_n_u_byte */
  {__pyx_k_bytearray_to_bytes, sizeof(__pyx_k_bytearray_to_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bytearray_to_bytes */
  {__pyx_k_byteseq, sizeof(__pyx_k_byteseq), 0, 1, 1}, /* PyObject cname: __pyx_n_u_byteseq */
  {__pyx_k_bytestring, sizeof(__pyx_k_bytestring), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bytestring */
  {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_c */
  {__pyx_k_c0, sizeof(__pyx_k_c0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c0 */
  {__pyx_k_c1, sizeof(__pyx_k_c1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c1 */
  {__pyx_k_c2, sizeof(__pyx_k_c2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c2 */
  {__pyx_k_c3, sizeof(__pyx_k_c3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c3 */
  {__pyx_k_c_2, sizeof(__pyx_k_c_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_2 */
  {__pyx_k_c_abelianization, sizeof(__pyx_k_c_abelianization), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_abelianization */
  {__pyx_k_c_canonized_triangulation, sizeof(__pyx_k_c_canonized_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_canonized_triangulation */
  {__pyx_k_c_center, sizeof(__pyx_k_c_center), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_center */
  {__pyx_k_c_comm_subgroup, sizeof(__pyx_k_c_comm_subgroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_comm_subgroup */
  {__pyx_k_c_core_length, sizeof(__pyx_k_c_core_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_core_length */
  {__pyx_k_c_cover_type, sizeof(__pyx_k_c_cover_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_cover_type */
  {__pyx_k_c_eqns, sizeof(__pyx_k_c_eqns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_eqns */
  {__pyx_k_c_factor_0, sizeof(__pyx_k_c_factor_0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_factor_0 */
  {__pyx_k_c_factor_1, sizeof(__pyx_k_c_factor_1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_factor_1 */
  {__pyx_k_c_filled_tri, sizeof(__pyx_k_c_filled_tri), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_filled_tri */
  {__pyx_k_c_longitude, sizeof(__pyx_k_c_longitude), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_longitude */
  {__pyx_k_c_matrix, sizeof(__pyx_k_c_matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_matrix */
  {__pyx_k_c_meridian, sizeof(__pyx_k_c_meridian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_meridian */
  {__pyx_k_c_moves, sizeof(__pyx_k_c_moves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_moves */
  {__pyx_k_c_new_name, sizeof(__pyx_k_c_new_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_new_name */
  {__pyx_k_c_new_tri, sizeof(__pyx_k_c_new_tri), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_new_tri */
  {__pyx_k_c_obstruction_class, sizeof(__pyx_k_c_obstruction_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_obstruction_class */
  {__pyx_k_c_opacities, sizeof(__pyx_k_c_opacities), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_opacities */
  {__pyx_k_c_representation, sizeof(__pyx_k_c_representation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_representation */
  {__pyx_k_c_retriangulated_triangulation, sizeof(__pyx_k_c_retriangulated_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_retriangulated_triangulation */
  {__pyx_k_c_string, sizeof(__pyx_k_c_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_string */
  {__pyx_k_c_symmetric_triangulation, sizeof(__pyx_k_c_symmetric_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_symmetric_triangulation */
  {__pyx_k_c_target, sizeof(__pyx_k_c_target), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_target */
  {__pyx_k_c_terse, sizeof(__pyx_k_c_terse), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_terse */
  {__pyx_k_c_triangulation, sizeof(__pyx_k_c_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_triangulation */
  {__pyx_k_c_vars, sizeof(__pyx_k_c_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_vars */
  {__pyx_k_c_word, sizeof(__pyx_k_c_word), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_word */
  {__pyx_k_cache, sizeof(__pyx_k_cache), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cache */
  {__pyx_k_callback, sizeof(__pyx_k_callback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_callback */
  {__pyx_k_canonical, sizeof(__pyx_k_canonical), 0, 1, 1}, /* PyObject cname: __pyx_n_u_canonical */
  {__pyx_k_canonical_cells_are_tetrahedra, sizeof(__pyx_k_canonical_cells_are_tetrahedra), 0, 1, 1}, /* PyObject cname: __pyx_n_u_canonical_cells_are_tetrahedra */
  {__pyx_k_canonical_retriangulation, sizeof(__pyx_k_canonical_retriangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_canonical_retriangulation */
  {__pyx_k_canonize, sizeof(__pyx_k_canonize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_canonize */
  {__pyx_k_cb_menu, sizeof(__pyx_k_cb_menu), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cb_menu */
  {__pyx_k_census_index, sizeof(__pyx_k_census_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_census_index */
  {__pyx_k_census_knot_archive, sizeof(__pyx_k_census_knot_archive), 0, 1, 1}, /* PyObject cname: __pyx_n_u_census_knot_archive */
  {__pyx_k_census_knot_numbers, sizeof(__pyx_k_census_knot_numbers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_census_knot_numbers */
  {__pyx_k_center, sizeof(__pyx_k_center), 0, 1, 1}, /* PyObject cname: __pyx_n_u_center */
  {__pyx_k_centroid_at_origin, sizeof(__pyx_k_centroid_at_origin), 0, 1, 1}, /* PyObject cname: __pyx_n_u_centroid_at_origin */
  {__pyx_k_certified_shapes, sizeof(__pyx_k_certified_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_certified_shapes */
  {__pyx_k_character_variety, sizeof(__pyx_k_character_variety), 0, 1, 1}, /* PyObject cname: __pyx_n_u_character_variety */
  {__pyx_k_character_variety_ideal, sizeof(__pyx_k_character_variety_ideal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_character_variety_ideal */
  {__pyx_k_character_variety_vars_and_polys, sizeof(__pyx_k_character_variety_vars_and_polys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_character_variety_vars_and_polys */
  {__pyx_k_check_SnapPea_memory, sizeof(__pyx_k_check_SnapPea_memory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_check_SnapPea_memory */
  {__pyx_k_check_index, sizeof(__pyx_k_check_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_check_index */
  {__pyx_k_chern_simons, sizeof(__pyx_k_chern_simons), 0, 1, 1}, /* PyObject cname: __pyx_n_u_chern_simons */
  {__pyx_k_choose_generators, sizeof(__pyx_k_choose_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choose_generators */
  {__pyx_k_choose_generators_info, sizeof(__pyx_k_choose_generators_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choose_generators_info */
  {__pyx_k_circle, sizeof(__pyx_k_circle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_circle */
  {__pyx_k_class, sizeof(__pyx_k_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class */
  {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */
  {__pyx_k_clear, sizeof(__pyx_k_clear), 0, 1, 1}, /* PyObject cname: __pyx_n_u_clear */
  {__pyx_k_clear_marks, sizeof(__pyx_k_clear_marks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_clear_marks */
  {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */
  {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */
  {__pyx_k_closed_census_directory, sizeof(__pyx_k_closed_census_directory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_closed_census_directory */
  {__pyx_k_closed_nonorientable, sizeof(__pyx_k_closed_nonorientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_closed_nonorientable */
  {__pyx_k_closed_orientable, sizeof(__pyx_k_closed_orientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_closed_orientable */
  {__pyx_k_closest, sizeof(__pyx_k_closest), 0, 1, 1}, /* PyObject cname: __pyx_n_u_closest */
  {__pyx_k_cls, sizeof(__pyx_k_cls), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cls */
  {__pyx_k_cobs, sizeof(__pyx_k_cobs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cobs */
  {__pyx_k_code, sizeof(__pyx_k_code), 0, 1, 1}, /* PyObject cname: __pyx_n_u_code */
  {__pyx_k_codec, sizeof(__pyx_k_codec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_codec */
  {__pyx_k_coefficient_list, sizeof(__pyx_k_coefficient_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_coefficient_list */
  {__pyx_k_coeffs, sizeof(__pyx_k_coeffs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_coeffs */
  {__pyx_k_col_support, sizeof(__pyx_k_col_support), 0, 1, 1}, /* PyObject cname: __pyx_n_u_col_support */
  {__pyx_k_cols, sizeof(__pyx_k_cols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cols */
  {__pyx_k_columns, sizeof(__pyx_k_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_columns */
  {__pyx_k_combinatorial, sizeof(__pyx_k_combinatorial), 0, 1, 1}, /* PyObject cname: __pyx_n_u_combinatorial */
  {__pyx_k_comm_subgroup, sizeof(__pyx_k_comm_subgroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comm_subgroup */
  {__pyx_k_commutator_subgroup, sizeof(__pyx_k_commutator_subgroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_commutator_subgroup */
  {__pyx_k_compile, sizeof(__pyx_k_compile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile */
  {__pyx_k_complete, sizeof(__pyx_k_complete), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_complete */
  {__pyx_k_complete_2, sizeof(__pyx_k_complete_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complete_2 */
  {__pyx_k_complete_3, sizeof(__pyx_k_complete_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_complete_3 */
  {__pyx_k_complete_length, sizeof(__pyx_k_complete_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complete_length */
  {__pyx_k_complete_length_2, sizeof(__pyx_k_complete_length_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_complete_length_2 */
  {__pyx_k_complete_shape_array, sizeof(__pyx_k_complete_shape_array), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complete_shape_array */
  {__pyx_k_complete_shapes, sizeof(__pyx_k_complete_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complete_shapes */
  {__pyx_k_complex, sizeof(__pyx_k_complex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complex */
  {__pyx_k_complex_length, sizeof(__pyx_k_complex_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complex_length */
  {__pyx_k_complex_volume, sizeof(__pyx_k_complex_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complex_volume */
  {__pyx_k_complex_volume_2, sizeof(__pyx_k_complex_volume_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complex_volume_2 */
  {__pyx_k_components, sizeof(__pyx_k_components), 0, 1, 1}, /* PyObject cname: __pyx_n_u_components */
  {__pyx_k_compute_corners, sizeof(__pyx_k_compute_corners), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compute_corners */
  {__pyx_k_compute_cusp_shapes, sizeof(__pyx_k_compute_cusp_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compute_cusp_shapes */
  {__pyx_k_compute_volume, sizeof(__pyx_k_compute_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compute_volume */
  {__pyx_k_contains, sizeof(__pyx_k_contains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contains */
  {__pyx_k_contains_degenerate_tetrahedra, sizeof(__pyx_k_contains_degenerate_tetrahedra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_contains_degenerate_tetrahedra */
  {__pyx_k_contains_flat_tetrahedra, sizeof(__pyx_k_contains_flat_tetrahedra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_contains_flat_tetrahedra */
  {__pyx_k_contains_negatively_oriented_tet, sizeof(__pyx_k_contains_negatively_oriented_tet), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_contains_negatively_oriented_tet */
  {__pyx_k_content, sizeof(__pyx_k_content), 0, 1, 1}, /* PyObject cname: __pyx_n_u_content */
  {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */
  {__pyx_k_copy_c_triangulation, sizeof(__pyx_k_copy_c_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy_c_triangulation */
  {__pyx_k_core_length, sizeof(__pyx_k_core_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_core_length */
  {__pyx_k_corners, sizeof(__pyx_k_corners), 0, 1, 1}, /* PyObject cname: __pyx_n_u_corners */
  {__pyx_k_coset_action, sizeof(__pyx_k_coset_action), 0, 1, 1}, /* PyObject cname: __pyx_n_u_coset_action */
  {__pyx_k_cover, sizeof(__pyx_k_cover), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cover */
  {__pyx_k_cover_c_triangulation, sizeof(__pyx_k_cover_c_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cover_c_triangulation */
  {__pyx_k_cover_count, sizeof(__pyx_k_cover_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cover_count */
  {__pyx_k_cover_info, sizeof(__pyx_k_cover_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cover_info */
  {__pyx_k_cover_locals_genexpr, sizeof(__pyx_k_cover_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cover_locals_genexpr */
  {__pyx_k_cover_type, sizeof(__pyx_k_cover_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cover_type */
  {__pyx_k_cover_types, sizeof(__pyx_k_cover_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cover_types */
  {__pyx_k_covers, sizeof(__pyx_k_covers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_covers */
  {__pyx_k_covers_gap, sizeof(__pyx_k_covers_gap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_covers_gap */
  {__pyx_k_covers_low_index, sizeof(__pyx_k_covers_low_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_covers_low_index */
  {__pyx_k_covers_low_index_locals_index, sizeof(__pyx_k_covers_low_index_locals_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_covers_low_index_locals_index */
  {__pyx_k_covers_magma, sizeof(__pyx_k_covers_magma), 0, 1, 1}, /* PyObject cname: __pyx_n_u_covers_magma */
  {__pyx_k_covers_snappea, sizeof(__pyx_k_covers_snappea), 0, 1, 1}, /* PyObject cname: __pyx_n_u_covers_snappea */
  {__pyx_k_crossings, sizeof(__pyx_k_crossings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_crossings */
  {__pyx_k_cs, sizeof(__pyx_k_cs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cs */
  {__pyx_k_curdir, sizeof(__pyx_k_curdir), 0, 1, 1}, /* PyObject cname: __pyx_n_u_curdir */
  {__pyx_k_current_modulus, sizeof(__pyx_k_current_modulus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_current_modulus */
  {__pyx_k_current_shape, sizeof(__pyx_k_current_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_current_shape */
  {__pyx_k_current_shape_accuracy, sizeof(__pyx_k_current_shape_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_current_shape_accuracy */
  {__pyx_k_curve_list, sizeof(__pyx_k_curve_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_curve_list */
  {__pyx_k_curve_of_length, sizeof(__pyx_k_curve_of_length), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_curve_of_length */
  {__pyx_k_cusp, sizeof(__pyx_k_cusp), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cusp */
  {__pyx_k_cusp_cross_section_info, sizeof(__pyx_k_cusp_cross_section_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_cross_section_info */
  {__pyx_k_cusp_images, sizeof(__pyx_k_cusp_images), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_images */
  {__pyx_k_cusp_images_2, sizeof(__pyx_k_cusp_images_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_images_2 */
  {__pyx_k_cusp_index, sizeof(__pyx_k_cusp_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_index */
  {__pyx_k_cusp_indices, sizeof(__pyx_k_cusp_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_indices */
  {__pyx_k_cusp_info, sizeof(__pyx_k_cusp_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_info */
  {__pyx_k_cusp_maps, sizeof(__pyx_k_cusp_maps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_maps */
  {__pyx_k_cusp_maps_2, sizeof(__pyx_k_cusp_maps_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_maps_2 */
  {__pyx_k_cusp_neighborhood, sizeof(__pyx_k_cusp_neighborhood), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_neighborhood */
  {__pyx_k_cusp_type, sizeof(__pyx_k_cusp_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusp_type */
  {__pyx_k_cusps, sizeof(__pyx_k_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusps */
  {__pyx_k_cusps_compute_cusp_shapes, sizeof(__pyx_k_cusps_compute_cusp_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusps_compute_cusp_shapes */
  {__pyx_k_cusps_to_fill, sizeof(__pyx_k_cusps_to_fill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cusps_to_fill */
  {__pyx_k_cutoff, sizeof(__pyx_k_cutoff), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cutoff */
  {__pyx_k_cutoff_length, sizeof(__pyx_k_cutoff_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cutoff_length */
  {__pyx_k_cutoff_radius, sizeof(__pyx_k_cutoff_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cutoff_radius */
  {__pyx_k_cutout, sizeof(__pyx_k_cutout), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cutout */
  {__pyx_k_cy_eval, sizeof(__pyx_k_cy_eval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cy_eval */
  {__pyx_k_cyclic, sizeof(__pyx_k_cyclic), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cyclic */
  {__pyx_k_cython_core_abelian_group_pyx, sizeof(__pyx_k_cython_core_abelian_group_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_abelian_group_pyx */
  {__pyx_k_cython_core_basic_pyx, sizeof(__pyx_k_cython_core_basic_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_basic_pyx */
  {__pyx_k_cython_core_cusp_neighborhoods_p, sizeof(__pyx_k_cython_core_cusp_neighborhoods_p), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_cusp_neighborhoods_p */
  {__pyx_k_cython_core_dirichlet_pyx, sizeof(__pyx_k_cython_core_dirichlet_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_dirichlet_pyx */
  {__pyx_k_cython_core_fundamental_group_py, sizeof(__pyx_k_cython_core_fundamental_group_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_fundamental_group_py */
  {__pyx_k_cython_core_manifold_pyx, sizeof(__pyx_k_cython_core_manifold_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_manifold_pyx */
  {__pyx_k_cython_core_symmetry_group_pyx, sizeof(__pyx_k_cython_core_symmetry_group_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_symmetry_group_pyx */
  {__pyx_k_cython_core_tail_pyx, sizeof(__pyx_k_cython_core_tail_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_tail_pyx */
  {__pyx_k_cython_core_triangulation_pyx, sizeof(__pyx_k_cython_core_triangulation_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_cython_core_triangulation_pyx */
  {__pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_d */
  {__pyx_k_dB, sizeof(__pyx_k_dB), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dB */
  {__pyx_k_dLQbcccdxwb, sizeof(__pyx_k_dLQbcccdxwb), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dLQbcccdxwb */
  {__pyx_k_d_2, sizeof(__pyx_k_d_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_d_2 */
  {__pyx_k_d_3, sizeof(__pyx_k_d_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_d_3 */
  {__pyx_k_d_4, sizeof(__pyx_k_d_4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_d_4 */
  {__pyx_k_data, sizeof(__pyx_k_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data */
  {__pyx_k_data_1_1_2_2_0_1_3_2_2_3_1_0_0, sizeof(__pyx_k_data_1_1_2_2_0_1_3_2_2_3_1_0_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_data_1_1_2_2_0_1_3_2_2_3_1_0_0 */
  {__pyx_k_data_ijk, sizeof(__pyx_k_data_ijk), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_ijk */
  {__pyx_k_data_spec, sizeof(__pyx_k_data_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_spec */
  {__pyx_k_database, sizeof(__pyx_k_database), 0, 1, 1}, /* PyObject cname: __pyx_n_u_database */
  {__pyx_k_datafile, sizeof(__pyx_k_datafile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_datafile */
  {__pyx_k_dec_prec, sizeof(__pyx_k_dec_prec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dec_prec */
  {__pyx_k_decode, sizeof(__pyx_k_decode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_decode */
  {__pyx_k_decorated, sizeof(__pyx_k_decorated), 0, 1, 1}, /* PyObject cname: __pyx_n_u_decorated */
  {__pyx_k_decorated_isosig, sizeof(__pyx_k_decorated_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_decorated_isosig */
  {__pyx_k_decoration, sizeof(__pyx_k_decoration), 0, 1, 1}, /* PyObject cname: __pyx_n_u_decoration */
  {__pyx_k_default_precision, sizeof(__pyx_k_default_precision), 0, 1, 1}, /* PyObject cname: __pyx_n_u_default_precision */
  {__pyx_k_defaultextension, sizeof(__pyx_k_defaultextension), 0, 1, 1}, /* PyObject cname: __pyx_n_u_defaultextension */
  {__pyx_k_defined_in, sizeof(__pyx_k_defined_in), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_defined_in */
  {__pyx_k_degree, sizeof(__pyx_k_degree), 0, 1, 1}, /* PyObject cname: __pyx_n_u_degree */
  {__pyx_k_dehn_fill, sizeof(__pyx_k_dehn_fill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dehn_fill */
  {__pyx_k_delattr, sizeof(__pyx_k_delattr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_delattr */
  {__pyx_k_delitem, sizeof(__pyx_k_delitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_delitem */
  {__pyx_k_desc, sizeof(__pyx_k_desc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_desc */
  {__pyx_k_det, sizeof(__pyx_k_det), 0, 1, 1}, /* PyObject cname: __pyx_n_u_det */
  {__pyx_k_details, sizeof(__pyx_k_details), 0, 1, 1}, /* PyObject cname: __pyx_n_u_details */
  {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */
  {__pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict_2 */
  {__pyx_k_dict_3, sizeof(__pyx_k_dict_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict_3 */
  {__pyx_k_direct_product_description, sizeof(__pyx_k_direct_product_description), 0, 1, 1}, /* PyObject cname: __pyx_n_u_direct_product_description */
  {__pyx_k_dirichlet_domain, sizeof(__pyx_k_dirichlet_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dirichlet_domain */
  {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */
  {__pyx_k_disp, sizeof(__pyx_k_disp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_disp */
  {__pyx_k_displacement, sizeof(__pyx_k_displacement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_displacement */
  {__pyx_k_distance, sizeof(__pyx_k_distance), 0, 1, 1}, /* PyObject cname: __pyx_n_u_distance */
  {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */
  {__pyx_k_domain, sizeof(__pyx_k_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain */
  {__pyx_k_drill, sizeof(__pyx_k_drill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_drill */
  {__pyx_k_dual_curves, sizeof(__pyx_k_dual_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dual_curves */
  {__pyx_k_dual_rows, sizeof(__pyx_k_dual_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dual_rows */
  {__pyx_k_e, sizeof(__pyx_k_e), 0, 1, 1}, /* PyObject cname: __pyx_n_u_e */
  {__pyx_k_edge, sizeof(__pyx_k_edge), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge */
  {__pyx_k_edge_class, sizeof(__pyx_k_edge_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_class */
  {__pyx_k_edge_image_indices, sizeof(__pyx_k_edge_image_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_image_indices */
  {__pyx_k_edge_index, sizeof(__pyx_k_edge_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_index */
  {__pyx_k_edge_indices, sizeof(__pyx_k_edge_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_indices */
  {__pyx_k_edge_list, sizeof(__pyx_k_edge_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_list */
  {__pyx_k_edge_orientations, sizeof(__pyx_k_edge_orientations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_orientations */
  {__pyx_k_edge_to_index, sizeof(__pyx_k_edge_to_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_to_index */
  {__pyx_k_edge_to_index_dict, sizeof(__pyx_k_edge_to_index_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_to_index_dict */
  {__pyx_k_edge_valences, sizeof(__pyx_k_edge_valences), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edge_valences */
  {__pyx_k_edges, sizeof(__pyx_k_edges), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_edges */
  {__pyx_k_edges_2, sizeof(__pyx_k_edges_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edges_2 */
  {__pyx_k_eight_length, sizeof(__pyx_k_eight_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eight_length */
  {__pyx_k_elementary_divisors, sizeof(__pyx_k_elementary_divisors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_elementary_divisors */
  {__pyx_k_eliminate_fixed_ptolemys, sizeof(__pyx_k_eliminate_fixed_ptolemys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eliminate_fixed_ptolemys */
  {__pyx_k_elt, sizeof(__pyx_k_elt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_elt */
  {__pyx_k_empty, sizeof(__pyx_k_empty), 0, 1, 1}, /* PyObject cname: __pyx_n_u_empty */
  {__pyx_k_empty_save, sizeof(__pyx_k_empty_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_empty_save */
  {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */
  {__pyx_k_encode, sizeof(__pyx_k_encode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode */
  {__pyx_k_end, sizeof(__pyx_k_end), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_end */
  {__pyx_k_end_2, sizeof(__pyx_k_end_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_end_2 */
  {__pyx_k_endpoints, sizeof(__pyx_k_endpoints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_endpoints */
  {__pyx_k_engine, sizeof(__pyx_k_engine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_engine */
  {__pyx_k_enter, sizeof(__pyx_k_enter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enter */
  {__pyx_k_entries, sizeof(__pyx_k_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_entries */
  {__pyx_k_enum, sizeof(__pyx_k_enum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enum */
  {__pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enumerate */
  {__pyx_k_environ, sizeof(__pyx_k_environ), 0, 1, 1}, /* PyObject cname: __pyx_n_u_environ */
  {__pyx_k_eqn, sizeof(__pyx_k_eqn), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eqn */
  {__pyx_k_eqns, sizeof(__pyx_k_eqns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eqns */
  {__pyx_k_equation_type, sizeof(__pyx_k_equation_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_equation_type */
  {__pyx_k_equations, sizeof(__pyx_k_equations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_equations */
  {__pyx_k_euler, sizeof(__pyx_k_euler), 0, 1, 1}, /* PyObject cname: __pyx_n_u_euler */
  {__pyx_k_eval, sizeof(__pyx_k_eval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eval */
  {__pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exceptions */
  {__pyx_k_exit, sizeof(__pyx_k_exit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exit */
  {__pyx_k_exit_2, sizeof(__pyx_k_exit_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exit_2 */
  {__pyx_k_expand_until_certified, sizeof(__pyx_k_expand_until_certified), 0, 1, 1}, /* PyObject cname: __pyx_n_u_expand_until_certified */
  {__pyx_k_explain_cols, sizeof(__pyx_k_explain_cols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_explain_cols */
  {__pyx_k_explain_columns, sizeof(__pyx_k_explain_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_explain_columns */
  {__pyx_k_explain_columns_2, sizeof(__pyx_k_explain_columns_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_explain_columns_2 */
  {__pyx_k_explain_rows, sizeof(__pyx_k_explain_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_explain_rows */
  {__pyx_k_explain_rows_2, sizeof(__pyx_k_explain_rows_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_explain_rows_2 */
  {__pyx_k_explode, sizeof(__pyx_k_explode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_explode */
  {__pyx_k_export_stl, sizeof(__pyx_k_export_stl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_export_stl */
  {__pyx_k_extends_to_link, sizeof(__pyx_k_extends_to_link), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extends_to_link */
  {__pyx_k_extends_to_link_2, sizeof(__pyx_k_extends_to_link_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extends_to_link_2 */
  {__pyx_k_extract_HT_knot, sizeof(__pyx_k_extract_HT_knot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extract_HT_knot */
  {__pyx_k_extractfile, sizeof(__pyx_k_extractfile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extractfile */
  {__pyx_k_f, sizeof(__pyx_k_f), 0, 1, 1}, /* PyObject cname: __pyx_n_u_f */
  {__pyx_k_face, sizeof(__pyx_k_face), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face */
  {__pyx_k_face0_gen, sizeof(__pyx_k_face0_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face0_gen */
  {__pyx_k_face1_gen, sizeof(__pyx_k_face1_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face1_gen */
  {__pyx_k_face2_gen, sizeof(__pyx_k_face2_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face2_gen */
  {__pyx_k_face3_gen, sizeof(__pyx_k_face3_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face3_gen */
  {__pyx_k_face_index, sizeof(__pyx_k_face_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face_index */
  {__pyx_k_face_list, sizeof(__pyx_k_face_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face_list */
  {__pyx_k_face_list_locals_genexpr, sizeof(__pyx_k_face_list_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_face_list_locals_genexpr */
  {__pyx_k_facedicts, sizeof(__pyx_k_facedicts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_facedicts */
  {__pyx_k_faces, sizeof(__pyx_k_faces), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_faces */
  {__pyx_k_faces_2, sizeof(__pyx_k_faces_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_faces_2 */
  {__pyx_k_factor_0, sizeof(__pyx_k_factor_0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_factor_0 */
  {__pyx_k_factor_1, sizeof(__pyx_k_factor_1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_factor_1 */
  {__pyx_k_file, sizeof(__pyx_k_file), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file */
  {__pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_name */
  {__pyx_k_filedata, sizeof(__pyx_k_filedata), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filedata */
  {__pyx_k_filedialog, sizeof(__pyx_k_filedialog), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filedialog */
  {__pyx_k_filename, sizeof(__pyx_k_filename), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filename */
  {__pyx_k_files, sizeof(__pyx_k_files), 0, 1, 1}, /* PyObject cname: __pyx_n_u_files */
  {__pyx_k_filetypes, sizeof(__pyx_k_filetypes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filetypes */
  {__pyx_k_fill, sizeof(__pyx_k_fill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fill */
  {__pyx_k_fill_all, sizeof(__pyx_k_fill_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fill_all */
  {__pyx_k_fill_by_fold, sizeof(__pyx_k_fill_by_fold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fill_by_fold */
  {__pyx_k_fill_cusp_spec, sizeof(__pyx_k_fill_cusp_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fill_cusp_spec */
  {__pyx_k_filled, sizeof(__pyx_k_filled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filled */
  {__pyx_k_filled_2, sizeof(__pyx_k_filled_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filled_2 */
  {__pyx_k_filled_length, sizeof(__pyx_k_filled_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filled_length */
  {__pyx_k_filled_length_2, sizeof(__pyx_k_filled_length_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_filled_length_2 */
  {__pyx_k_filled_shape_array, sizeof(__pyx_k_filled_shape_array), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filled_shape_array */
  {__pyx_k_filled_shapes, sizeof(__pyx_k_filled_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filled_shapes */
  {__pyx_k_filled_tri, sizeof(__pyx_k_filled_tri), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filled_tri */
  {__pyx_k_filled_triangulation, sizeof(__pyx_k_filled_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filled_triangulation */
  {__pyx_k_filling, sizeof(__pyx_k_filling), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filling */
  {__pyx_k_filling_2, sizeof(__pyx_k_filling_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filling_2 */
  {__pyx_k_filling_data, sizeof(__pyx_k_filling_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filling_data */
  {__pyx_k_fillings, sizeof(__pyx_k_fillings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fillings */
  {__pyx_k_fillings_may_affect_generators, sizeof(__pyx_k_fillings_may_affect_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fillings_may_affect_generators */
  {__pyx_k_find, sizeof(__pyx_k_find), 0, 1, 1}, /* PyObject cname: __pyx_n_u_find */
  {__pyx_k_findall, sizeof(__pyx_k_findall), 0, 1, 1}, /* PyObject cname: __pyx_n_u_findall */
  {__pyx_k_finite_vertices, sizeof(__pyx_k_finite_vertices), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_finite_vertices */
  {__pyx_k_first_nybble, sizeof(__pyx_k_first_nybble), 0, 1, 1}, /* PyObject cname: __pyx_n_u_first_nybble */
  {__pyx_k_five_length, sizeof(__pyx_k_five_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_five_length */
  {__pyx_k_five_tet_nonorientable, sizeof(__pyx_k_five_tet_nonorientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_five_tet_nonorientable */
  {__pyx_k_five_tet_orientable, sizeof(__pyx_k_five_tet_orientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_five_tet_orientable */
  {__pyx_k_fixed_alignment, sizeof(__pyx_k_fixed_alignment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fixed_alignment */
  {__pyx_k_flips, sizeof(__pyx_k_flips), 0, 1, 1}, /* PyObject cname: __pyx_n_u_flips */
  {__pyx_k_flush, sizeof(__pyx_k_flush), 0, 1, 1}, /* PyObject cname: __pyx_n_u_flush */
  {__pyx_k_fold, sizeof(__pyx_k_fold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fold */
  {__pyx_k_force_recompute, sizeof(__pyx_k_force_recompute), 0, 1, 1}, /* PyObject cname: __pyx_n_u_force_recompute */
  {__pyx_k_form, sizeof(__pyx_k_form), 0, 1, 1}, /* PyObject cname: __pyx_n_u_form */
  {__pyx_k_format, sizeof(__pyx_k_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format */
  {__pyx_k_format_explain_list, sizeof(__pyx_k_format_explain_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format_explain_list */
  {__pyx_k_format_str, sizeof(__pyx_k_format_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format_str */
  {__pyx_k_format_two_by_two, sizeof(__pyx_k_format_two_by_two), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format_two_by_two */
  {__pyx_k_from_bytes, sizeof(__pyx_k_from_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_bytes */
  {__pyx_k_from_data, sizeof(__pyx_k_from_data), 0, 0, 1}, /* PyObject cname: __pyx_n_b_from_data */
  {__pyx_k_from_isosig, sizeof(__pyx_k_from_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_isosig */
  {__pyx_k_from_pickle, sizeof(__pyx_k_from_pickle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_pickle */
  {__pyx_k_from_string, sizeof(__pyx_k_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_string */
  {__pyx_k_from_tetrahedra_gluing_data, sizeof(__pyx_k_from_tetrahedra_gluing_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_tetrahedra_gluing_data */
  {__pyx_k_full_list, sizeof(__pyx_k_full_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_full_list */
  {__pyx_k_full_rigor, sizeof(__pyx_k_full_rigor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_full_rigor */
  {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */
  {__pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_2 */
  {__pyx_k_func_OK, sizeof(__pyx_k_func_OK), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_OK */
  {__pyx_k_func_bad_input, sizeof(__pyx_k_func_bad_input), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_bad_input */
  {__pyx_k_func_cancelled, sizeof(__pyx_k_func_cancelled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_cancelled */
  {__pyx_k_func_failed, sizeof(__pyx_k_func_failed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_failed */
  {__pyx_k_fundamental_group, sizeof(__pyx_k_fundamental_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fundamental_group */
  {__pyx_k_g, sizeof(__pyx_k_g), 0, 1, 1}, /* PyObject cname: __pyx_n_u_g */
  {__pyx_k_g_eqns, sizeof(__pyx_k_g_eqns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_g_eqns */
  {__pyx_k_g_g, sizeof(__pyx_k_g_g), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_g_g */
  {__pyx_k_gap, sizeof(__pyx_k_gap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gap */
  {__pyx_k_gap_image_gens, sizeof(__pyx_k_gap_image_gens), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gap_image_gens */
  {__pyx_k_gap_init, sizeof(__pyx_k_gap_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gap_init */
  {__pyx_k_gap_string, sizeof(__pyx_k_gap_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gap_string */
  {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */
  {__pyx_k_gen, sizeof(__pyx_k_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gen */
  {__pyx_k_gen_names, sizeof(__pyx_k_gen_names), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gen_names */
  {__pyx_k_generator_bytes, sizeof(__pyx_k_generator_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_generator_bytes */
  {__pyx_k_generator_file, sizeof(__pyx_k_generator_file), 0, 1, 1}, /* PyObject cname: __pyx_n_u_generator_file */
  {__pyx_k_generator_path, sizeof(__pyx_k_generator_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_generator_path */
  {__pyx_k_generators, sizeof(__pyx_k_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_generators */
  {__pyx_k_generators_in_originals, sizeof(__pyx_k_generators_in_originals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_generators_in_originals */
  {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */
  {__pyx_k_gens, sizeof(__pyx_k_gens), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gens */
  {__pyx_k_geodesics, sizeof(__pyx_k_geodesics), 0, 1, 1}, /* PyObject cname: __pyx_n_u_geodesics */
  {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */
  {__pyx_k_get_HT_knot_DT, sizeof(__pyx_k_get_HT_knot_DT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_HT_knot_DT */
  {__pyx_k_get_HT_knot_by_index, sizeof(__pyx_k_get_HT_knot_by_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_HT_knot_by_index */
  {__pyx_k_get_cusp_indices_and_peripheral, sizeof(__pyx_k_get_cusp_indices_and_peripheral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_cusp_indices_and_peripheral */
  {__pyx_k_get_data, sizeof(__pyx_k_get_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_data */
  {__pyx_k_get_displacement, sizeof(__pyx_k_get_displacement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_displacement */
  {__pyx_k_get_from_link_data, sizeof(__pyx_k_get_from_link_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_from_link_data */
  {__pyx_k_get_generalized_ptolemy_obstruct, sizeof(__pyx_k_get_generalized_ptolemy_obstruct), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_generalized_ptolemy_obstruct */
  {__pyx_k_get_ptolemy_obstruction_classes, sizeof(__pyx_k_get_ptolemy_obstruction_classes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_ptolemy_obstruction_classes */
  {__pyx_k_get_ptolemy_variety, sizeof(__pyx_k_get_ptolemy_variety), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_ptolemy_variety */
  {__pyx_k_get_tetrahedra_gluing_data, sizeof(__pyx_k_get_tetrahedra_gluing_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_tetrahedra_gluing_data */
  {__pyx_k_get_tetrahedra_shapes, sizeof(__pyx_k_get_tetrahedra_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_tetrahedra_shapes */
  {__pyx_k_get_tie, sizeof(__pyx_k_get_tie), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_tie */
  {__pyx_k_get_triangulation_tester, sizeof(__pyx_k_get_triangulation_tester), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_triangulation_tester */
  {__pyx_k_get_triangulation_tester_doctes, sizeof(__pyx_k_get_triangulation_tester_doctes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_get_triangulation_tester_doctes */
  {__pyx_k_get_triangulation_tester_line_11, sizeof(__pyx_k_get_triangulation_tester_line_11), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_get_triangulation_tester_line_11 */
  {__pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getitem */
  {__pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getstate */
  {__pyx_k_gluing, sizeof(__pyx_k_gluing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gluing */
  {__pyx_k_gluing_equations, sizeof(__pyx_k_gluing_equations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gluing_equations */
  {__pyx_k_gluing_equations_pgl, sizeof(__pyx_k_gluing_equations_pgl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gluing_equations_pgl */
  {__pyx_k_gluings, sizeof(__pyx_k_gluings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gluings */
  {__pyx_k_group, sizeof(__pyx_k_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_group */
  {__pyx_k_grouped, sizeof(__pyx_k_grouped), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grouped */
  {__pyx_k_groups, sizeof(__pyx_k_groups), 0, 1, 1}, /* PyObject cname: __pyx_n_u_groups */
  {__pyx_k_gui, sizeof(__pyx_k_gui), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gui */
  {__pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gzip */
  {__pyx_k_handles, sizeof(__pyx_k_handles), 0, 1, 1}, /* PyObject cname: __pyx_n_u_handles */
  {__pyx_k_has_finite_vertices, sizeof(__pyx_k_has_finite_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_has_finite_vertices */
  {__pyx_k_header, sizeof(__pyx_k_header), 0, 1, 1}, /* PyObject cname: __pyx_n_u_header */
  {__pyx_k_high_precision, sizeof(__pyx_k_high_precision), 0, 1, 1}, /* PyObject cname: __pyx_n_u_high_precision */
  {__pyx_k_holonomies, sizeof(__pyx_k_holonomies), 0, 1, 1}, /* PyObject cname: __pyx_n_u_holonomies */
  {__pyx_k_holonomy_accuracy, sizeof(__pyx_k_holonomy_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_holonomy_accuracy */
  {__pyx_k_holonomy_precision, sizeof(__pyx_k_holonomy_precision), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_holonomy_precision */
  {__pyx_k_homology, sizeof(__pyx_k_homology), 0, 1, 1}, /* PyObject cname: __pyx_n_u_homology */
  {__pyx_k_horoball_list, sizeof(__pyx_k_horoball_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_horoball_list */
  {__pyx_k_horoballs, sizeof(__pyx_k_horoballs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_horoballs */
  {__pyx_k_horoviewer, sizeof(__pyx_k_horoviewer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_horoviewer */
  {__pyx_k_hue, sizeof(__pyx_k_hue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hue */
  {__pyx_k_hyperbolic_data__sa_gz, sizeof(__pyx_k_hyperbolic_data__sa_gz), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_hyperbolic_data__sa_gz */
  {__pyx_k_hyperbolic_data__sn_gz, sizeof(__pyx_k_hyperbolic_data__sn_gz), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_hyperbolic_data__sn_gz */
  {__pyx_k_i, sizeof(__pyx_k_i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_i */
  {__pyx_k_icosohedral_group, sizeof(__pyx_k_icosohedral_group), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_icosohedral_group */
  {__pyx_k_ideal, sizeof(__pyx_k_ideal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ideal */
  {__pyx_k_ideal_vertices, sizeof(__pyx_k_ideal_vertices), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ideal_vertices */
  {__pyx_k_identify, sizeof(__pyx_k_identify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_identify */
  {__pyx_k_identify_2, sizeof(__pyx_k_identify_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_identify_2 */
  {__pyx_k_ignore_curve_orientations, sizeof(__pyx_k_ignore_curve_orientations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ignore_curve_orientations */
  {__pyx_k_ignore_curves, sizeof(__pyx_k_ignore_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ignore_curves */
  {__pyx_k_ignore_cusp_ordering, sizeof(__pyx_k_ignore_cusp_ordering), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ignore_cusp_ordering */
  {__pyx_k_ignore_filling_orientations, sizeof(__pyx_k_ignore_filling_orientations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ignore_filling_orientations */
  {__pyx_k_ignore_orientation, sizeof(__pyx_k_ignore_orientation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ignore_orientation */
  {__pyx_k_ignore_solution_type, sizeof(__pyx_k_ignore_solution_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ignore_solution_type */
  {__pyx_k_imag, sizeof(__pyx_k_imag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_imag */
  {__pyx_k_images, sizeof(__pyx_k_images), 0, 1, 1}, /* PyObject cname: __pyx_n_u_images */
  {__pyx_k_immutable, sizeof(__pyx_k_immutable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_immutable */
  {__pyx_k_import_itertools_M_Manifold_L14, sizeof(__pyx_k_import_itertools_M_Manifold_L14), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_import_itertools_M_Manifold_L14 */
  {__pyx_k_in_radius, sizeof(__pyx_k_in_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_in_radius */
  {__pyx_k_include_words, sizeof(__pyx_k_include_words), 0, 1, 1}, /* PyObject cname: __pyx_n_u_include_words */
  {__pyx_k_index, sizeof(__pyx_k_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index */
  {__pyx_k_index_within_crossings, sizeof(__pyx_k_index_within_crossings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index_within_crossings */
  {__pyx_k_indices, sizeof(__pyx_k_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_indices */
  {__pyx_k_infinite, sizeof(__pyx_k_infinite), 0, 1, 1}, /* PyObject cname: __pyx_n_u_infinite */
  {__pyx_k_info, sizeof(__pyx_k_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_info */
  {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */
  {__pyx_k_init_hyperbolic_structure, sizeof(__pyx_k_init_hyperbolic_structure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init_hyperbolic_structure */
  {__pyx_k_initial_modulus, sizeof(__pyx_k_initial_modulus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initial_modulus */
  {__pyx_k_initial_shape, sizeof(__pyx_k_initial_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initial_shape */
  {__pyx_k_initial_shape_accuracy, sizeof(__pyx_k_initial_shape_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initial_shape_accuracy */
  {__pyx_k_initialize_structure, sizeof(__pyx_k_initialize_structure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initialize_structure */
  {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */
  {__pyx_k_input_type, sizeof(__pyx_k_input_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_type */
  {__pyx_k_int, sizeof(__pyx_k_int), 0, 1, 1}, /* PyObject cname: __pyx_n_u_int */
  {__pyx_k_int_list, sizeof(__pyx_k_int_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_int_list */
  {__pyx_k_internal, sizeof(__pyx_k_internal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_internal */
  {__pyx_k_interrupted, sizeof(__pyx_k_interrupted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_interrupted */
  {__pyx_k_intervals, sizeof(__pyx_k_intervals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_intervals */
  {__pyx_k_inverse_list_word, sizeof(__pyx_k_inverse_list_word), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inverse_list_word */
  {__pyx_k_irregular, sizeof(__pyx_k_irregular), 0, 1, 1}, /* PyObject cname: __pyx_n_u_irregular */
  {__pyx_k_is_GapElement, sizeof(__pyx_k_is_GapElement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_GapElement */
  {__pyx_k_is_HT_knot, sizeof(__pyx_k_is_HT_knot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_HT_knot */
  {__pyx_k_is_MagmaElement, sizeof(__pyx_k_is_MagmaElement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_MagmaElement */
  {__pyx_k_is_S5, sizeof(__pyx_k_is_S5), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_S5 */
  {__pyx_k_is_abelian, sizeof(__pyx_k_is_abelian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_abelian */
  {__pyx_k_is_alpha_DT_exterior, sizeof(__pyx_k_is_alpha_DT_exterior), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_alpha_DT_exterior */
  {__pyx_k_is_amphicheiral, sizeof(__pyx_k_is_amphicheiral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_amphicheiral */
  {__pyx_k_is_binary_group, sizeof(__pyx_k_is_binary_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_binary_group */
  {__pyx_k_is_braid_complement, sizeof(__pyx_k_is_braid_complement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_braid_complement */
  {__pyx_k_is_complete, sizeof(__pyx_k_is_complete), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_complete */
  {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */
  {__pyx_k_is_decorated_isosig, sizeof(__pyx_k_is_decorated_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_decorated_isosig */
  {__pyx_k_is_dihedral, sizeof(__pyx_k_is_dihedral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_dihedral */
  {__pyx_k_is_direct_product, sizeof(__pyx_k_is_direct_product), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_direct_product */
  {__pyx_k_is_full_group, sizeof(__pyx_k_is_full_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_full_group */
  {__pyx_k_is_geometric, sizeof(__pyx_k_is_geometric), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_geometric */
  {__pyx_k_is_int_DT_exterior, sizeof(__pyx_k_is_int_DT_exterior), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_int_DT_exterior */
  {__pyx_k_is_invertible_knot, sizeof(__pyx_k_is_invertible_knot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_invertible_knot */
  {__pyx_k_is_isometric_to, sizeof(__pyx_k_is_isometric_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_isometric_to */
  {__pyx_k_is_isometric_to_2, sizeof(__pyx_k_is_isometric_to_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_isometric_to_2 */
  {__pyx_k_is_isosig, sizeof(__pyx_k_is_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_isosig */
  {__pyx_k_is_link_complement1, sizeof(__pyx_k_is_link_complement1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_link_complement1 */
  {__pyx_k_is_link_complement1_pat, sizeof(__pyx_k_is_link_complement1_pat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_link_complement1_pat */
  {__pyx_k_is_link_complement2, sizeof(__pyx_k_is_link_complement2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_link_complement2 */
  {__pyx_k_is_link_complement2_pat, sizeof(__pyx_k_is_link_complement2_pat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_link_complement2_pat */
  {__pyx_k_is_link_complement3, sizeof(__pyx_k_is_link_complement3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_link_complement3 */
  {__pyx_k_is_link_complement3_pat, sizeof(__pyx_k_is_link_complement3_pat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_link_complement3_pat */
  {__pyx_k_is_not_acceptable, sizeof(__pyx_k_is_not_acceptable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is_not_acceptable */
  {__pyx_k_is_orientable, sizeof(__pyx_k_is_orientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_orientable */
  {__pyx_k_is_polyhedral, sizeof(__pyx_k_is_polyhedral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_polyhedral */
  {__pyx_k_is_symplectic, sizeof(__pyx_k_is_symplectic), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_symplectic */
  {__pyx_k_is_torus_bundle, sizeof(__pyx_k_is_torus_bundle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_torus_bundle */
  {__pyx_k_is_twister_bundle, sizeof(__pyx_k_is_twister_bundle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_twister_bundle */
  {__pyx_k_is_twister_splitting, sizeof(__pyx_k_is_twister_splitting), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_twister_splitting */
  {__pyx_k_is_two_bridge, sizeof(__pyx_k_is_two_bridge), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_two_bridge */
  {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */
  {__pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isfile */
  {__pyx_k_islower, sizeof(__pyx_k_islower), 0, 1, 1}, /* PyObject cname: __pyx_n_u_islower */
  {__pyx_k_isometries, sizeof(__pyx_k_isometries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isometries */
  {__pyx_k_isomorphisms_to, sizeof(__pyx_k_isomorphisms_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isomorphisms_to */
  {__pyx_k_isomorphisms_to_2, sizeof(__pyx_k_isomorphisms_to_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isomorphisms_to_2 */
  {__pyx_k_isosig, sizeof(__pyx_k_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isosig */
  {__pyx_k_isosig_pattern, sizeof(__pyx_k_isosig_pattern), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isosig_pattern */
  {__pyx_k_item, sizeof(__pyx_k_item), 0, 1, 1}, /* PyObject cname: __pyx_n_u_item */
  {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */
  {__pyx_k_iter, sizeof(__pyx_k_iter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_iter */
  {__pyx_k_its_matrix, sizeof(__pyx_k_its_matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_its_matrix */
  {__pyx_k_j, sizeof(__pyx_k_j), 0, 1, 1}, /* PyObject cname: __pyx_n_u_j */
  {__pyx_k_join, sizeof(__pyx_k_join), 0, 1, 1}, /* PyObject cname: __pyx_n_u_join */
  {__pyx_k_k, sizeof(__pyx_k_k), 0, 1, 1}, /* PyObject cname: __pyx_n_u_k */
  {__pyx_k_key, sizeof(__pyx_k_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_key */
  {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */
  {__pyx_k_kl, sizeof(__pyx_k_kl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_kl */
  {__pyx_k_klein, sizeof(__pyx_k_klein), 0, 1, 1}, /* PyObject cname: __pyx_n_u_klein */
  {__pyx_k_klp, sizeof(__pyx_k_klp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_klp */
  {__pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_kwargs */
  {__pyx_k_l, sizeof(__pyx_k_l), 0, 1, 1}, /* PyObject cname: __pyx_n_u_l */
  {__pyx_k_l0, sizeof(__pyx_k_l0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_l0 */
  {__pyx_k_l1, sizeof(__pyx_k_l1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_l1 */
  {__pyx_k_l2, sizeof(__pyx_k_l2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_l2 */
  {__pyx_k_lL_P_components_0_9_1_P_crossin, sizeof(__pyx_k_lL_P_components_0_9_1_P_crossin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_lL_P_components_0_9_1_P_crossin */
  {__pyx_k_layered, sizeof(__pyx_k_layered), 0, 1, 1}, /* PyObject cname: __pyx_n_u_layered */
  {__pyx_k_layered_and_marked, sizeof(__pyx_k_layered_and_marked), 0, 1, 1}, /* PyObject cname: __pyx_n_u_layered_and_marked */
  {__pyx_k_lazy, sizeof(__pyx_k_lazy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lazy */
  {__pyx_k_left, sizeof(__pyx_k_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left */
  {__pyx_k_left_pad_string, sizeof(__pyx_k_left_pad_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left_pad_string */
  {__pyx_k_len, sizeof(__pyx_k_len), 0, 1, 1}, /* PyObject cname: __pyx_n_u_len */
  {__pyx_k_lenStr, sizeof(__pyx_k_lenStr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lenStr */
  {__pyx_k_len_2, sizeof(__pyx_k_len_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_len_2 */
  {__pyx_k_length, sizeof(__pyx_k_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_length */
  {__pyx_k_length_2, sizeof(__pyx_k_length_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_length_2 */
  {__pyx_k_length_spectrum, sizeof(__pyx_k_length_spectrum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_length_spectrum */
  {__pyx_k_length_spectrum_dicts, sizeof(__pyx_k_length_spectrum_dicts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_length_spectrum_dicts */
  {__pyx_k_letter, sizeof(__pyx_k_letter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_letter */
  {__pyx_k_letter_seperator, sizeof(__pyx_k_letter_seperator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_letter_seperator */
  {__pyx_k_line, sizeof(__pyx_k_line), 0, 1, 1}, /* PyObject cname: __pyx_n_u_line */
  {__pyx_k_line0, sizeof(__pyx_k_line0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_line0 */
  {__pyx_k_line1, sizeof(__pyx_k_line1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_line1 */
  {__pyx_k_line2, sizeof(__pyx_k_line2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_line2 */
  {__pyx_k_line3, sizeof(__pyx_k_line3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_line3 */
  {__pyx_k_link, sizeof(__pyx_k_link), 0, 1, 1}, /* PyObject cname: __pyx_n_u_link */
  {__pyx_k_link_archive, sizeof(__pyx_k_link_archive), 0, 1, 1}, /* PyObject cname: __pyx_n_u_link_archive */
  {__pyx_k_link_directory, sizeof(__pyx_k_link_directory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_link_directory */
  {__pyx_k_list_as_word, sizeof(__pyx_k_list_as_word), 0, 1, 1}, /* PyObject cname: __pyx_n_u_list_as_word */
  {__pyx_k_list_as_word_locals_genexpr, sizeof(__pyx_k_list_as_word_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_list_as_word_locals_genexpr */
  {__pyx_k_list_snappy_Manifold, sizeof(__pyx_k_list_snappy_Manifold), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_snappy_Manifold */
  {__pyx_k_list_snappy_Triangulation, sizeof(__pyx_k_list_snappy_Triangulation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_snappy_Triangulation */
  {__pyx_k_ljust, sizeof(__pyx_k_ljust), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ljust */
  {__pyx_k_log, sizeof(__pyx_k_log), 0, 1, 1}, /* PyObject cname: __pyx_n_u_log */
  {__pyx_k_log_im, sizeof(__pyx_k_log_im), 0, 1, 1}, /* PyObject cname: __pyx_n_u_log_im */
  {__pyx_k_log_re, sizeof(__pyx_k_log_re), 0, 1, 1}, /* PyObject cname: __pyx_n_u_log_re */
  {__pyx_k_log_shape, sizeof(__pyx_k_log_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_log_shape */
  {__pyx_k_long_relators, sizeof(__pyx_k_long_relators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_long_relators */
  {__pyx_k_longitude, sizeof(__pyx_k_longitude), 0, 1, 1}, /* PyObject cname: __pyx_n_u_longitude */
  {__pyx_k_longitude_2, sizeof(__pyx_k_longitude_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_longitude_2 */
  {__pyx_k_longitude_accuracy, sizeof(__pyx_k_longitude_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_longitude_accuracy */
  {__pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lookup */
  {__pyx_k_low_index, sizeof(__pyx_k_low_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_low_index */
  {__pyx_k_lower, sizeof(__pyx_k_lower), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lower */
  {__pyx_k_m, sizeof(__pyx_k_m), 0, 1, 1}, /* PyObject cname: __pyx_n_u_m */
  {__pyx_k_m003, sizeof(__pyx_k_m003), 0, 1, 1}, /* PyObject cname: __pyx_n_u_m003 */
  {__pyx_k_m004, sizeof(__pyx_k_m004), 0, 1, 1}, /* PyObject cname: __pyx_n_u_m004 */
  {__pyx_k_magma, sizeof(__pyx_k_magma), 0, 1, 1}, /* PyObject cname: __pyx_n_u_magma */
  {__pyx_k_magma_init, sizeof(__pyx_k_magma_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_magma_init */
  {__pyx_k_magma_string, sizeof(__pyx_k_magma_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_magma_string */
  {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */
  {__pyx_k_major, sizeof(__pyx_k_major), 0, 1, 1}, /* PyObject cname: __pyx_n_u_major */
  {__pyx_k_manifold, sizeof(__pyx_k_manifold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifold */
  {__pyx_k_manifoldMethods, sizeof(__pyx_k_manifoldMethods), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifoldMethods */
  {__pyx_k_manifold_class, sizeof(__pyx_k_manifold_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifold_class */
  {__pyx_k_manifold_class_2, sizeof(__pyx_k_manifold_class_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifold_class_2 */
  {__pyx_k_manifold_name, sizeof(__pyx_k_manifold_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifold_name */
  {__pyx_k_manifold_path, sizeof(__pyx_k_manifold_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifold_path */
  {__pyx_k_manifold_paths, sizeof(__pyx_k_manifold_paths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifold_paths */
  {__pyx_k_manifolds, sizeof(__pyx_k_manifolds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_manifolds */
  {__pyx_k_map, sizeof(__pyx_k_map), 0, 1, 1}, /* PyObject cname: __pyx_n_u_map */
  {__pyx_k_maps, sizeof(__pyx_k_maps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maps */
  {__pyx_k_mark_solid_tori, sizeof(__pyx_k_mark_solid_tori), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mark_solid_tori */
  {__pyx_k_marked, sizeof(__pyx_k_marked), 0, 1, 1}, /* PyObject cname: __pyx_n_u_marked */
  {__pyx_k_marked_tetrahedra, sizeof(__pyx_k_marked_tetrahedra), 0, 1, 1}, /* PyObject cname: __pyx_n_u_marked_tetrahedra */
  {__pyx_k_mask, sizeof(__pyx_k_mask), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mask */
  {__pyx_k_mat, sizeof(__pyx_k_mat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mat */
  {__pyx_k_match, sizeof(__pyx_k_match), 0, 1, 1}, /* PyObject cname: __pyx_n_u_match */
  {__pyx_k_math, sizeof(__pyx_k_math), 0, 1, 1}, /* PyObject cname: __pyx_n_u_math */
  {__pyx_k_matrices, sizeof(__pyx_k_matrices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matrices */
  {__pyx_k_matrix, sizeof(__pyx_k_matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matrix */
  {__pyx_k_matrix_2, sizeof(__pyx_k_matrix_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matrix_2 */
  {__pyx_k_matsnf, sizeof(__pyx_k_matsnf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matsnf */
  {__pyx_k_max, sizeof(__pyx_k_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max */
  {__pyx_k_max_crossings, sizeof(__pyx_k_max_crossings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_crossings */
  {__pyx_k_max_reach, sizeof(__pyx_k_max_reach), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_reach */
  {__pyx_k_max_segments, sizeof(__pyx_k_max_segments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_segments */
  {__pyx_k_maximize_injectivity_radius, sizeof(__pyx_k_maximize_injectivity_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maximize_injectivity_radius */
  {__pyx_k_meridian, sizeof(__pyx_k_meridian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_meridian */
  {__pyx_k_meridian_2, sizeof(__pyx_k_meridian_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_meridian_2 */
  {__pyx_k_meridian_accuracy, sizeof(__pyx_k_meridian_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_meridian_accuracy */
  {__pyx_k_message, sizeof(__pyx_k_message), 0, 1, 1}, /* PyObject cname: __pyx_n_u_message */
  {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */
  {__pyx_k_method, sizeof(__pyx_k_method), 0, 1, 1}, /* PyObject cname: __pyx_n_u_method */
  {__pyx_k_minimize_number_of_generators, sizeof(__pyx_k_minimize_number_of_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minimize_number_of_generators */
  {__pyx_k_mirrored_arc, sizeof(__pyx_k_mirrored_arc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_mirrored_arc */
  {__pyx_k_mode, sizeof(__pyx_k_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mode */
  {__pyx_k_model, sizeof(__pyx_k_model), 0, 1, 1}, /* PyObject cname: __pyx_n_u_model */
  {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */
  {__pyx_k_modulus, sizeof(__pyx_k_modulus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_modulus */
  {__pyx_k_monodromy, sizeof(__pyx_k_monodromy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_monodromy */
  {__pyx_k_morwen8, sizeof(__pyx_k_morwen8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_morwen8 */
  {__pyx_k_morwen8_tgz, sizeof(__pyx_k_morwen8_tgz), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_morwen8_tgz */
  {__pyx_k_morwen_link_directory, sizeof(__pyx_k_morwen_link_directory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_morwen_link_directory */
  {__pyx_k_moves, sizeof(__pyx_k_moves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_moves */
  {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */
  {__pyx_k_msg_stream, sizeof(__pyx_k_msg_stream), 0, 1, 1}, /* PyObject cname: __pyx_n_u_msg_stream */
  {__pyx_k_mult, sizeof(__pyx_k_mult), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mult */
  {__pyx_k_multiplicities, sizeof(__pyx_k_multiplicities), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multiplicities */
  {__pyx_k_multiplicity, sizeof(__pyx_k_multiplicity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multiplicity */
  {__pyx_k_multiply_elements, sizeof(__pyx_k_multiply_elements), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multiply_elements */
  {__pyx_k_myslice, sizeof(__pyx_k_myslice), 0, 1, 1}, /* PyObject cname: __pyx_n_u_myslice */
  {__pyx_k_n, sizeof(__pyx_k_n), 0, 1, 1}, /* PyObject cname: __pyx_n_u_n */
  {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */
  {__pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name_2 */
  {__pyx_k_ncols, sizeof(__pyx_k_ncols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ncols */
  {__pyx_k_neighbor, sizeof(__pyx_k_neighbor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neighbor */
  {__pyx_k_neighbor0_idx, sizeof(__pyx_k_neighbor0_idx), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neighbor0_idx */
  {__pyx_k_neighbor1_idx, sizeof(__pyx_k_neighbor1_idx), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neighbor1_idx */
  {__pyx_k_neighbor2_idx, sizeof(__pyx_k_neighbor2_idx), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neighbor2_idx */
  {__pyx_k_neighbor3_idx, sizeof(__pyx_k_neighbor3_idx), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neighbor3_idx */
  {__pyx_k_neighbor_end, sizeof(__pyx_k_neighbor_end), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neighbor_end */
  {__pyx_k_neighbors, sizeof(__pyx_k_neighbors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neighbors */
  {__pyx_k_new, sizeof(__pyx_k_new), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new */
  {__pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_2 */
  {__pyx_k_new_displacement, sizeof(__pyx_k_new_displacement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_displacement */
  {__pyx_k_new_name, sizeof(__pyx_k_new_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_name */
  {__pyx_k_new_tie, sizeof(__pyx_k_new_tie), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_tie */
  {__pyx_k_new_tri, sizeof(__pyx_k_new_tri), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_tri */
  {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */
  {__pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next_2 */
  {__pyx_k_no_arcs, sizeof(__pyx_k_no_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_no_arcs */
  {__pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_no_default___reduce___due_to_non */
  {__pyx_k_no_solution_found, sizeof(__pyx_k_no_solution_found), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_no_solution_found */
  {__pyx_k_non_peripheral, sizeof(__pyx_k_non_peripheral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_non_peripheral */
  {__pyx_k_nonabelian_group_of_order_d, sizeof(__pyx_k_nonabelian_group_of_order_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_nonabelian_group_of_order_d */
  {__pyx_k_nonalternating_gz, sizeof(__pyx_k_nonalternating_gz), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_nonalternating_gz */
  {__pyx_k_nonorientable, sizeof(__pyx_k_nonorientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nonorientable */
  {__pyx_k_nonzeros, sizeof(__pyx_k_nonzeros), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nonzeros */
  {__pyx_k_not_attempted, sizeof(__pyx_k_not_attempted), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_not_attempted */
  {__pyx_k_not_filled, sizeof(__pyx_k_not_filled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_not_filled */
  {__pyx_k_nrows, sizeof(__pyx_k_nrows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nrows */
  {__pyx_k_num, sizeof(__pyx_k_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num */
  {__pyx_k_num_cols, sizeof(__pyx_k_num_cols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_cols */
  {__pyx_k_num_components, sizeof(__pyx_k_num_components), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_components */
  {__pyx_k_num_crossings, sizeof(__pyx_k_num_crossings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_crossings */
  {__pyx_k_num_curves, sizeof(__pyx_k_num_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_curves */
  {__pyx_k_num_cusps, sizeof(__pyx_k_num_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_cusps */
  {__pyx_k_num_edges, sizeof(__pyx_k_num_edges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_edges */
  {__pyx_k_num_faces, sizeof(__pyx_k_num_faces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_faces */
  {__pyx_k_num_fake_cusps, sizeof(__pyx_k_num_fake_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_fake_cusps */
  {__pyx_k_num_finite_vertices, sizeof(__pyx_k_num_finite_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_finite_vertices */
  {__pyx_k_num_gen, sizeof(__pyx_k_num_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_gen */
  {__pyx_k_num_generators, sizeof(__pyx_k_num_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_generators */
  {__pyx_k_num_gens, sizeof(__pyx_k_num_gens), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_gens */
  {__pyx_k_num_ideal_vertices, sizeof(__pyx_k_num_ideal_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_ideal_vertices */
  {__pyx_k_num_lengths, sizeof(__pyx_k_num_lengths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_lengths */
  {__pyx_k_num_links, sizeof(__pyx_k_num_links), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_links */
  {__pyx_k_num_nonor_cusps, sizeof(__pyx_k_num_nonor_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_nonor_cusps */
  {__pyx_k_num_or_cusps, sizeof(__pyx_k_num_or_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_or_cusps */
  {__pyx_k_num_orig_gens, sizeof(__pyx_k_num_orig_gens), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_orig_gens */
  {__pyx_k_num_original_generators, sizeof(__pyx_k_num_original_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_original_generators */
  {__pyx_k_num_relations, sizeof(__pyx_k_num_relations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_relations */
  {__pyx_k_num_relators, sizeof(__pyx_k_num_relators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_relators */
  {__pyx_k_num_rows, sizeof(__pyx_k_num_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_rows */
  {__pyx_k_num_subdivisions, sizeof(__pyx_k_num_subdivisions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_subdivisions */
  {__pyx_k_num_surfaces, sizeof(__pyx_k_num_surfaces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_surfaces */
  {__pyx_k_num_tet, sizeof(__pyx_k_num_tet), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_tet */
  {__pyx_k_num_tetrahedra, sizeof(__pyx_k_num_tetrahedra), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_tetrahedra */
  {__pyx_k_num_threads, sizeof(__pyx_k_num_threads), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_threads */
  {__pyx_k_num_vertices, sizeof(__pyx_k_num_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_vertices */
  {__pyx_k_number, sizeof(__pyx_k_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number */
  {__pyx_k_number_2, sizeof(__pyx_k_number_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number_2 */
  {__pyx_k_number_to_native_number, sizeof(__pyx_k_number_to_native_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number_to_native_number */
  {__pyx_k_obsolete, sizeof(__pyx_k_obsolete), 0, 1, 1}, /* PyObject cname: __pyx_n_u_obsolete */
  {__pyx_k_obstruction_class, sizeof(__pyx_k_obstruction_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_obstruction_class */
  {__pyx_k_octahedral_group, sizeof(__pyx_k_octahedral_group), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_octahedral_group */
  {__pyx_k_of, sizeof(__pyx_k_of), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_of */
  {__pyx_k_of_link, sizeof(__pyx_k_of_link), 0, 1, 1}, /* PyObject cname: __pyx_n_u_of_link */
  {__pyx_k_of_shape, sizeof(__pyx_k_of_shape), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_of_shape */
  {__pyx_k_offset, sizeof(__pyx_k_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_offset */
  {__pyx_k_old, sizeof(__pyx_k_old), 0, 1, 1}, /* PyObject cname: __pyx_n_u_old */
  {__pyx_k_omega, sizeof(__pyx_k_omega), 0, 1, 1}, /* PyObject cname: __pyx_n_u_omega */
  {__pyx_k_one_manifold, sizeof(__pyx_k_one_manifold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_one_manifold */
  {__pyx_k_one_sided, sizeof(__pyx_k_one_sided), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_one_sided */
  {__pyx_k_one_tet_lengths, sizeof(__pyx_k_one_tet_lengths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_one_tet_lengths */
  {__pyx_k_one_tet_tilts, sizeof(__pyx_k_one_tet_tilts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_one_tet_tilts */
  {__pyx_k_one_vertex_lengths, sizeof(__pyx_k_one_vertex_lengths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_one_vertex_lengths */
  {__pyx_k_opacities, sizeof(__pyx_k_opacities), 0, 1, 1}, /* PyObject cname: __pyx_n_u_opacities */
  {__pyx_k_open, sizeof(__pyx_k_open), 0, 1, 1}, /* PyObject cname: __pyx_n_u_open */
  {__pyx_k_operator, sizeof(__pyx_k_operator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operator */
  {__pyx_k_order, sizeof(__pyx_k_order), 0, 1, 1}, /* PyObject cname: __pyx_n_u_order */
  {__pyx_k_orient, sizeof(__pyx_k_orient), 0, 1, 1}, /* PyObject cname: __pyx_n_u_orient */
  {__pyx_k_orientability, sizeof(__pyx_k_orientability), 0, 1, 1}, /* PyObject cname: __pyx_n_u_orientability */
  {__pyx_k_orientable, sizeof(__pyx_k_orientable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_orientable */
  {__pyx_k_orientation_cover, sizeof(__pyx_k_orientation_cover), 0, 1, 1}, /* PyObject cname: __pyx_n_u_orientation_cover */
  {__pyx_k_orientation_preserving, sizeof(__pyx_k_orientation_preserving), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_orientation_preserving */
  {__pyx_k_orientation_reversing, sizeof(__pyx_k_orientation_reversing), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_orientation_reversing */
  {__pyx_k_orig_gens, sizeof(__pyx_k_orig_gens), 0, 1, 1}, /* PyObject cname: __pyx_n_u_orig_gens */
  {__pyx_k_original_generators, sizeof(__pyx_k_original_generators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_original_generators */
  {__pyx_k_original_index, sizeof(__pyx_k_original_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_original_index */
  {__pyx_k_os, sizeof(__pyx_k_os), 0, 1, 1}, /* PyObject cname: __pyx_n_u_os */
  {__pyx_k_other, sizeof(__pyx_k_other), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other */
  {__pyx_k_out_radius, sizeof(__pyx_k_out_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_out_radius */
  {__pyx_k_output, sizeof(__pyx_k_output), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output */
  {__pyx_k_output_file, sizeof(__pyx_k_output_file), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_file */
  {__pyx_k_owns_c_symmetry_group, sizeof(__pyx_k_owns_c_symmetry_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_owns_c_symmetry_group */
  {__pyx_k_p, sizeof(__pyx_k_p), 0, 1, 1}, /* PyObject cname: __pyx_n_u_p */
  {__pyx_k_pad, sizeof(__pyx_k_pad), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pad */
  {__pyx_k_pair, sizeof(__pyx_k_pair), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pair */
  {__pyx_k_pairing_matrices, sizeof(__pyx_k_pairing_matrices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pairing_matrices */
  {__pyx_k_pairing_words, sizeof(__pyx_k_pairing_words), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pairing_words */
  {__pyx_k_pari, sizeof(__pyx_k_pari), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pari */
  {__pyx_k_parity, sizeof(__pyx_k_parity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parity */
  {__pyx_k_part, sizeof(__pyx_k_part), 0, 1, 1}, /* PyObject cname: __pyx_n_u_part */
  {__pyx_k_parts, sizeof(__pyx_k_parts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parts */
  {__pyx_k_passes_at_fours, sizeof(__pyx_k_passes_at_fours), 0, 1, 1}, /* PyObject cname: __pyx_n_u_passes_at_fours */
  {__pyx_k_path, sizeof(__pyx_k_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_path */
  {__pyx_k_path_2, sizeof(__pyx_k_path_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_path_2 */
  {__pyx_k_peripheral, sizeof(__pyx_k_peripheral), 0, 1, 1}, /* PyObject cname: __pyx_n_u_peripheral */
  {__pyx_k_peripheral_curves, sizeof(__pyx_k_peripheral_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_peripheral_curves */
  {__pyx_k_peripheral_data, sizeof(__pyx_k_peripheral_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_peripheral_data */
  {__pyx_k_perm, sizeof(__pyx_k_perm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_perm */
  {__pyx_k_perm0, sizeof(__pyx_k_perm0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_perm0 */
  {__pyx_k_perm1, sizeof(__pyx_k_perm1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_perm1 */
  {__pyx_k_perm2, sizeof(__pyx_k_perm2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_perm2 */
  {__pyx_k_perm3, sizeof(__pyx_k_perm3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_perm3 */
  {__pyx_k_perms, sizeof(__pyx_k_perms), 0, 1, 1}, /* PyObject cname: __pyx_n_u_perms */
  {__pyx_k_permutation, sizeof(__pyx_k_permutation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_permutation */
  {__pyx_k_permutation_rep, sizeof(__pyx_k_permutation_rep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_permutation_rep */
  {__pyx_k_permutation_reps, sizeof(__pyx_k_permutation_reps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_permutation_reps */
  {__pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 0}, /* PyObject cname: __pyx_kp_b_pickle */
  {__pyx_k_pickle_2, sizeof(__pyx_k_pickle_2), 0, 0, 1}, /* PyObject cname: __pyx_n_b_pickle_2 */
  {__pyx_k_pickle_2, sizeof(__pyx_k_pickle_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pickle_2 */
  {__pyx_k_pieces, sizeof(__pyx_k_pieces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pieces */
  {__pyx_k_plink, sizeof(__pyx_k_plink), 0, 1, 1}, /* PyObject cname: __pyx_n_u_plink */
  {__pyx_k_plink_callback, sizeof(__pyx_k_plink_callback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_plink_callback */
  {__pyx_k_plink_callback_2, sizeof(__pyx_k_plink_callback_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_plink_callback_2 */
  {__pyx_k_polish_hyperbolic_structures, sizeof(__pyx_k_polish_hyperbolic_structures), 0, 1, 1}, /* PyObject cname: __pyx_n_u_polish_hyperbolic_structures */
  {__pyx_k_polished_tetrahedra_shapes, sizeof(__pyx_k_polished_tetrahedra_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_polished_tetrahedra_shapes */
  {__pyx_k_polyhedral_description, sizeof(__pyx_k_polyhedral_description), 0, 1, 1}, /* PyObject cname: __pyx_n_u_polyhedral_description */
  {__pyx_k_polyviewer, sizeof(__pyx_k_polyviewer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_polyviewer */
  {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */
  {__pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_popitem */
  {__pyx_k_position, sizeof(__pyx_k_position), 0, 1, 1}, /* PyObject cname: __pyx_n_u_position */
  {__pyx_k_precision, sizeof(__pyx_k_precision), 0, 1, 1}, /* PyObject cname: __pyx_n_u_precision */
  {__pyx_k_precision_2, sizeof(__pyx_k_precision_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_precision_2 */
  {__pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prefix */
  {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */
  {__pyx_k_presentation, sizeof(__pyx_k_presentation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_presentation */
  {__pyx_k_presentation_matrix, sizeof(__pyx_k_presentation_matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_presentation_matrix */
  {__pyx_k_print, sizeof(__pyx_k_print), 0, 1, 1}, /* PyObject cname: __pyx_n_u_print */
  {__pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_protocol */
  {__pyx_k_ptolemy, sizeof(__pyx_k_ptolemy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy */
  {__pyx_k_ptolemyManifoldMethods, sizeof(__pyx_k_ptolemyManifoldMethods), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemyManifoldMethods */
  {__pyx_k_ptolemy_equations_action_by_dec, sizeof(__pyx_k_ptolemy_equations_action_by_dec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_equations_action_by_dec */
  {__pyx_k_ptolemy_equations_boundary_map, sizeof(__pyx_k_ptolemy_equations_boundary_map), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_equations_boundary_map */
  {__pyx_k_ptolemy_equations_boundary_map_2, sizeof(__pyx_k_ptolemy_equations_boundary_map_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_equations_boundary_map_2 */
  {__pyx_k_ptolemy_equations_boundary_map_3, sizeof(__pyx_k_ptolemy_equations_boundary_map_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_equations_boundary_map_3 */
  {__pyx_k_ptolemy_equations_identified_co, sizeof(__pyx_k_ptolemy_equations_identified_co), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_equations_identified_co */
  {__pyx_k_ptolemy_equations_identified_fa, sizeof(__pyx_k_ptolemy_equations_identified_fa), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_equations_identified_fa */
  {__pyx_k_ptolemy_generalized_obstruction, sizeof(__pyx_k_ptolemy_generalized_obstruction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_generalized_obstruction */
  {__pyx_k_ptolemy_obstruction_classes, sizeof(__pyx_k_ptolemy_obstruction_classes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_obstruction_classes */
  {__pyx_k_ptolemy_variety, sizeof(__pyx_k_ptolemy_variety), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptolemy_variety */
  {__pyx_k_python_major_version, sizeof(__pyx_k_python_major_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_python_major_version */
  {__pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_PickleError */
  {__pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_checksum */
  {__pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_result */
  {__pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_state */
  {__pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_type */
  {__pyx_k_pyx_unpickle_PresentationMatri, sizeof(__pyx_k_pyx_unpickle_PresentationMatri), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_PresentationMatri */
  {__pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_vtable */
  {__pyx_k_q_2, sizeof(__pyx_k_q_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_q_2 */
  {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */
  {__pyx_k_r, sizeof(__pyx_k_r), 0, 1, 1}, /* PyObject cname: __pyx_n_u_r */
  {__pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_r_2 */
  {__pyx_k_radius, sizeof(__pyx_k_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_radius */
  {__pyx_k_randomize, sizeof(__pyx_k_randomize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_randomize */
  {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */
  {__pyx_k_rank, sizeof(__pyx_k_rank), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rank */
  {__pyx_k_raw_form, sizeof(__pyx_k_raw_form), 0, 1, 1}, /* PyObject cname: __pyx_n_u_raw_form */
  {__pyx_k_rb, sizeof(__pyx_k_rb), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rb */
  {__pyx_k_re, sizeof(__pyx_k_re), 0, 1, 1}, /* PyObject cname: __pyx_n_u_re */
  {__pyx_k_reach, sizeof(__pyx_k_reach), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reach */
  {__pyx_k_read, sizeof(__pyx_k_read), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read */
  {__pyx_k_readline, sizeof(__pyx_k_readline), 0, 1, 1}, /* PyObject cname: __pyx_n_u_readline */
  {__pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_readlines */
  {__pyx_k_real, sizeof(__pyx_k_real), 0, 1, 1}, /* PyObject cname: __pyx_n_u_real */
  {__pyx_k_real_coerced_to_bits_prec, sizeof(__pyx_k_real_coerced_to_bits_prec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_real_coerced_to_bits_prec */
  {__pyx_k_recompute, sizeof(__pyx_k_recompute), 0, 1, 1}, /* PyObject cname: __pyx_n_u_recompute */
  {__pyx_k_record, sizeof(__pyx_k_record), 0, 1, 1}, /* PyObject cname: __pyx_n_u_record */
  {__pyx_k_rect, sizeof(__pyx_k_rect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rect */
  {__pyx_k_rect_im, sizeof(__pyx_k_rect_im), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rect_im */
  {__pyx_k_rect_re, sizeof(__pyx_k_rect_re), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rect_re */
  {__pyx_k_rect_shape, sizeof(__pyx_k_rect_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rect_shape */
  {__pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce */
  {__pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_cython */
  {__pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_ex */
  {__pyx_k_reduce_list_word, sizeof(__pyx_k_reduce_list_word), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_list_word */
  {__pyx_k_regular, sizeof(__pyx_k_regular), 0, 1, 1}, /* PyObject cname: __pyx_n_u_regular */
  {__pyx_k_reindex_cusps, sizeof(__pyx_k_reindex_cusps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reindex_cusps */
  {__pyx_k_rel, sizeof(__pyx_k_rel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rel */
  {__pyx_k_relation, sizeof(__pyx_k_relation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_relation */
  {__pyx_k_relation_list, sizeof(__pyx_k_relation_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_relation_list */
  {__pyx_k_relators, sizeof(__pyx_k_relators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_relators */
  {__pyx_k_rels, sizeof(__pyx_k_rels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rels */
  {__pyx_k_remove, sizeof(__pyx_k_remove), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove */
  {__pyx_k_remove_finite_vertices, sizeof(__pyx_k_remove_finite_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove_finite_vertices */
  {__pyx_k_remove_finite_vertices_2, sizeof(__pyx_k_remove_finite_vertices_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove_finite_vertices_2 */
  {__pyx_k_reopen, sizeof(__pyx_k_reopen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reopen */
  {__pyx_k_rep, sizeof(__pyx_k_rep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rep */
  {__pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace */
  {__pyx_k_repr, sizeof(__pyx_k_repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_repr */
  {__pyx_k_repr_2, sizeof(__pyx_k_repr_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_repr_2 */
  {__pyx_k_reps, sizeof(__pyx_k_reps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reps */
  {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */
  {__pyx_k_result_curves, sizeof(__pyx_k_result_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result_curves */
  {__pyx_k_result_cusp_indices, sizeof(__pyx_k_result_cusp_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result_cusp_indices */
  {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */
  {__pyx_k_return_F, sizeof(__pyx_k_return_F), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_return_F */
  {__pyx_k_return_isometries, sizeof(__pyx_k_return_isometries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return_isometries */
  {__pyx_k_return_matrices, sizeof(__pyx_k_return_matrices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return_matrices */
  {__pyx_k_return_type, sizeof(__pyx_k_return_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return_type */
  {__pyx_k_retval, sizeof(__pyx_k_retval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_retval */
  {__pyx_k_rev_spec_dict, sizeof(__pyx_k_rev_spec_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rev_spec_dict */
  {__pyx_k_reverse_orientation, sizeof(__pyx_k_reverse_orientation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reverse_orientation */
  {__pyx_k_right, sizeof(__pyx_k_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right */
  {__pyx_k_rjust, sizeof(__pyx_k_rjust), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rjust */
  {__pyx_k_rolfsen_link_regexs, sizeof(__pyx_k_rolfsen_link_regexs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rolfsen_link_regexs */
  {__pyx_k_round, sizeof(__pyx_k_round), 0, 1, 1}, /* PyObject cname: __pyx_n_u_round */
  {__pyx_k_row, sizeof(__pyx_k_row), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row */
  {__pyx_k_row_entries, sizeof(__pyx_k_row_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_entries */
  {__pyx_k_row_op, sizeof(__pyx_k_row_op), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_op */
  {__pyx_k_rows, sizeof(__pyx_k_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rows */
  {__pyx_k_s, sizeof(__pyx_k_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s */
  {__pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_s_2 */
  {__pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_s_3 */
  {__pyx_k_s_4, sizeof(__pyx_k_s_4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_s_4 */
  {__pyx_k_s_x_s, sizeof(__pyx_k_s_x_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_s_x_s */
  {__pyx_k_sage, sizeof(__pyx_k_sage), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage */
  {__pyx_k_sage_groups_free_group, sizeof(__pyx_k_sage_groups_free_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_groups_free_group */
  {__pyx_k_sage_groups_perm_gps_permgroup, sizeof(__pyx_k_sage_groups_perm_gps_permgroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_groups_perm_gps_permgroup */
  {__pyx_k_sage_groups_perm_gps_permgroup_e, sizeof(__pyx_k_sage_groups_perm_gps_permgroup_e), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_groups_perm_gps_permgroup_e */
  {__pyx_k_sage_helper, sizeof(__pyx_k_sage_helper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_helper */
  {__pyx_k_sage_interfaces_abc, sizeof(__pyx_k_sage_interfaces_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_interfaces_abc */
  {__pyx_k_sage_interfaces_gap, sizeof(__pyx_k_sage_interfaces_gap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_interfaces_gap */
  {__pyx_k_sage_interfaces_magma, sizeof(__pyx_k_sage_interfaces_magma), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_interfaces_magma */
  {__pyx_k_sage_matrix, sizeof(__pyx_k_sage_matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_matrix */
  {__pyx_k_sage_matrix_constructor, sizeof(__pyx_k_sage_matrix_constructor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_matrix_constructor */
  {__pyx_k_sage_object, sizeof(__pyx_k_sage_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_object */
  {__pyx_k_sage_rings_integer, sizeof(__pyx_k_sage_rings_integer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_rings_integer */
  {__pyx_k_sage_structure_sage_object, sizeof(__pyx_k_sage_structure_sage_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sage_structure_sage_object */
  {__pyx_k_save, sizeof(__pyx_k_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_save */
  {__pyx_k_savefile, sizeof(__pyx_k_savefile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_savefile */
  {__pyx_k_second_char, sizeof(__pyx_k_second_char), 0, 1, 1}, /* PyObject cname: __pyx_n_u_second_char */
  {__pyx_k_second_nybble, sizeof(__pyx_k_second_nybble), 0, 1, 1}, /* PyObject cname: __pyx_n_u_second_nybble */
  {__pyx_k_seed, sizeof(__pyx_k_seed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed */
  {__pyx_k_seek, sizeof(__pyx_k_seek), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seek */
  {__pyx_k_segment, sizeof(__pyx_k_segment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segment */
  {__pyx_k_segment_list, sizeof(__pyx_k_segment_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segment_list */
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
  {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
  {__pyx_k_sep, sizeof(__pyx_k_sep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sep */
  {__pyx_k_set_DTcode, sizeof(__pyx_k_set_DTcode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_DTcode */
  {__pyx_k_set_PDcode, sizeof(__pyx_k_set_PDcode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_PDcode */
  {__pyx_k_set_displacement, sizeof(__pyx_k_set_displacement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_displacement */
  {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */
  {__pyx_k_set_name_2, sizeof(__pyx_k_set_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name_2 */
  {__pyx_k_set_peripheral_curves, sizeof(__pyx_k_set_peripheral_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_peripheral_curves */
  {__pyx_k_set_peripheral_from_decoration, sizeof(__pyx_k_set_peripheral_from_decoration), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_peripheral_from_decoration */
  {__pyx_k_set_rand_seed, sizeof(__pyx_k_set_rand_seed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_rand_seed */
  {__pyx_k_set_real_precision, sizeof(__pyx_k_set_real_precision), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_real_precision */
  {__pyx_k_set_target_holonomy, sizeof(__pyx_k_set_target_holonomy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_target_holonomy */
  {__pyx_k_set_test_flag, sizeof(__pyx_k_set_test_flag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_test_flag */
  {__pyx_k_set_tetrahedra_shapes, sizeof(__pyx_k_set_tetrahedra_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_tetrahedra_shapes */
  {__pyx_k_set_tie, sizeof(__pyx_k_set_tie), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_tie */
  {__pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setattr */
  {__pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setitem */
  {__pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate */
  {__pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate_cython */
  {__pyx_k_seven_length, sizeof(__pyx_k_seven_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seven_length */
  {__pyx_k_shape, sizeof(__pyx_k_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shape */
  {__pyx_k_shape_accuracy, sizeof(__pyx_k_shape_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shape_accuracy */
  {__pyx_k_shape_precision, sizeof(__pyx_k_shape_precision), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_shape_precision */
  {__pyx_k_shapes, sizeof(__pyx_k_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shapes */
  {__pyx_k_short_relators, sizeof(__pyx_k_short_relators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_short_relators */
  {__pyx_k_shortest, sizeof(__pyx_k_shortest), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shortest */
  {__pyx_k_shortest_longitudes, sizeof(__pyx_k_shortest_longitudes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shortest_longitudes */
  {__pyx_k_shortest_meridians, sizeof(__pyx_k_shortest_meridians), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shortest_meridians */
  {__pyx_k_show_uAcknowledge, sizeof(__pyx_k_show_uAcknowledge), 0, 1, 1}, /* PyObject cname: __pyx_n_u_show_uAcknowledge */
  {__pyx_k_shrink_factor, sizeof(__pyx_k_shrink_factor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shrink_factor */
  {__pyx_k_side, sizeof(__pyx_k_side), 0, 1, 1}, /* PyObject cname: __pyx_n_u_side */
  {__pyx_k_side_lengths, sizeof(__pyx_k_side_lengths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_side_lengths */
  {__pyx_k_sided, sizeof(__pyx_k_sided), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sided */
  {__pyx_k_sign, sizeof(__pyx_k_sign), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sign */
  {__pyx_k_signs, sizeof(__pyx_k_signs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_signs */
  {__pyx_k_signtype, sizeof(__pyx_k_signtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_signtype */
  {__pyx_k_simplified_matrix, sizeof(__pyx_k_simplified_matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_simplified_matrix */
  {__pyx_k_simplify, sizeof(__pyx_k_simplify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_simplify */
  {__pyx_k_simplify_presentation, sizeof(__pyx_k_simplify_presentation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_simplify_presentation */
  {__pyx_k_singularity_index, sizeof(__pyx_k_singularity_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_singularity_index */
  {__pyx_k_six_length, sizeof(__pyx_k_six_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_six_length */
  {__pyx_k_size, sizeof(__pyx_k_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size */
  {__pyx_k_smith_form, sizeof(__pyx_k_smith_form), 0, 1, 1}, /* PyObject cname: __pyx_n_u_smith_form */
  {__pyx_k_snap, sizeof(__pyx_k_snap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_snap */
  {__pyx_k_snapPea, sizeof(__pyx_k_snapPea), 0, 1, 1}, /* PyObject cname: __pyx_n_u_snapPea */
  {__pyx_k_snappea, sizeof(__pyx_k_snappea), 0, 1, 1}, /* PyObject cname: __pyx_n_u_snappea */
  {__pyx_k_snappy, sizeof(__pyx_k_snappy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_snappy */
  {__pyx_k_snappy_Manifold, sizeof(__pyx_k_snappy_Manifold), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_snappy_Manifold */
  {__pyx_k_snappy_Triangulation, sizeof(__pyx_k_snappy_Triangulation), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_snappy_Triangulation */
  {__pyx_k_so_far, sizeof(__pyx_k_so_far), 0, 1, 1}, /* PyObject cname: __pyx_n_u_so_far */
  {__pyx_k_soln, sizeof(__pyx_k_soln), 0, 1, 1}, /* PyObject cname: __pyx_n_u_soln */
  {__pyx_k_solution_type, sizeof(__pyx_k_solution_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solution_type */
  {__pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sorted */
  {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */
  {__pyx_k_spec_2, sizeof(__pyx_k_spec_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec_2 */
  {__pyx_k_specs, sizeof(__pyx_k_specs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_specs */
  {__pyx_k_spectrum, sizeof(__pyx_k_spectrum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spectrum */
  {__pyx_k_spherogram, sizeof(__pyx_k_spherogram), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spherogram */
  {__pyx_k_spin_short, sizeof(__pyx_k_spin_short), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spin_short */
  {__pyx_k_spine_radius, sizeof(__pyx_k_spine_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spine_radius */
  {__pyx_k_split, sizeof(__pyx_k_split), 0, 1, 1}, /* PyObject cname: __pyx_n_u_split */
  {__pyx_k_split_filling_info, sizeof(__pyx_k_split_filling_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_split_filling_info */
  {__pyx_k_splitting, sizeof(__pyx_k_splitting), 0, 1, 1}, /* PyObject cname: __pyx_n_u_splitting */
  {__pyx_k_splitting_from_string, sizeof(__pyx_k_splitting_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_splitting_from_string */
  {__pyx_k_splitting_surfaces, sizeof(__pyx_k_splitting_surfaces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_splitting_surfaces */
  {__pyx_k_start, sizeof(__pyx_k_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_start */
  {__pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 1, 1}, /* PyObject cname: __pyx_n_u_startswith */
  {__pyx_k_state, sizeof(__pyx_k_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_state */
  {__pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_staticmethod */
  {__pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stderr */
  {__pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stdout */
  {__pyx_k_step, sizeof(__pyx_k_step), 0, 1, 1}, /* PyObject cname: __pyx_n_u_step */
  {__pyx_k_stl, sizeof(__pyx_k_stl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stl */
  {__pyx_k_stop, sizeof(__pyx_k_stop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stop */
  {__pyx_k_stopper, sizeof(__pyx_k_stopper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stopper */
  {__pyx_k_stopping_displacement, sizeof(__pyx_k_stopping_displacement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stopping_displacement */
  {__pyx_k_str, sizeof(__pyx_k_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str */
  {__pyx_k_strandtype, sizeof(__pyx_k_strandtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_strandtype */
  {__pyx_k_strategy, sizeof(__pyx_k_strategy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_strategy */
  {__pyx_k_string, sizeof(__pyx_k_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_string */
  {__pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_stringsource */
  {__pyx_k_strip, sizeof(__pyx_k_strip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_strip */
  {__pyx_k_strline, sizeof(__pyx_k_strline), 0, 1, 1}, /* PyObject cname: __pyx_n_u_strline */
  {__pyx_k_struct, sizeof(__pyx_k_struct), 0, 1, 1}, /* PyObject cname: __pyx_n_u_struct */
  {__pyx_k_structure, sizeof(__pyx_k_structure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_structure */
  {__pyx_k_subgroup, sizeof(__pyx_k_subgroup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_subgroup */
  {__pyx_k_success, sizeof(__pyx_k_success), 0, 1, 1}, /* PyObject cname: __pyx_n_u_success */
  {__pyx_k_sum, sizeof(__pyx_k_sum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum */
  {__pyx_k_super, sizeof(__pyx_k_super), 0, 1, 1}, /* PyObject cname: __pyx_n_u_super */
  {__pyx_k_surface, sizeof(__pyx_k_surface), 0, 1, 1}, /* PyObject cname: __pyx_n_u_surface */
  {__pyx_k_surfaces, sizeof(__pyx_k_surfaces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_surfaces */
  {__pyx_k_surfaces_but_you_asked_for_surf, sizeof(__pyx_k_surfaces_but_you_asked_for_surf), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_surfaces_but_you_asked_for_surf */
  {__pyx_k_symmetric_triangulation, sizeof(__pyx_k_symmetric_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symmetric_triangulation */
  {__pyx_k_symmetries_of_link, sizeof(__pyx_k_symmetries_of_link), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symmetries_of_link */
  {__pyx_k_symmetries_of_manifold, sizeof(__pyx_k_symmetries_of_manifold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symmetries_of_manifold */
  {__pyx_k_symmetry_group, sizeof(__pyx_k_symmetry_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symmetry_group */
  {__pyx_k_symplectic_basis, sizeof(__pyx_k_symplectic_basis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symplectic_basis */
  {__pyx_k_symplectic_form, sizeof(__pyx_k_symplectic_form), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symplectic_form */
  {__pyx_k_sys, sizeof(__pyx_k_sys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sys */
  {__pyx_k_t, sizeof(__pyx_k_t), 0, 1, 1}, /* PyObject cname: __pyx_n_u_t */
  {__pyx_k_table, sizeof(__pyx_k_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_table */
  {__pyx_k_table_directory, sizeof(__pyx_k_table_directory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_table_directory */
  {__pyx_k_tail, sizeof(__pyx_k_tail), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tail */
  {__pyx_k_tail_vertex_index, sizeof(__pyx_k_tail_vertex_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tail_vertex_index */
  {__pyx_k_tarfile, sizeof(__pyx_k_tarfile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tarfile */
  {__pyx_k_target, sizeof(__pyx_k_target), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target */
  {__pyx_k_tarpath, sizeof(__pyx_k_tarpath), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tarpath */
  {__pyx_k_temp, sizeof(__pyx_k_temp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_temp */
  {__pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tempfile */
  {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */
  {__pyx_k_tet, sizeof(__pyx_k_tet), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tet */
  {__pyx_k_tet_num, sizeof(__pyx_k_tet_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tet_num */
  {__pyx_k_tetrahedra_data, sizeof(__pyx_k_tetrahedra_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tetrahedra_data */
  {__pyx_k_tetrahedra_shapes, sizeof(__pyx_k_tetrahedra_shapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tetrahedra_shapes */
  {__pyx_k_tetrahedra_shapes_were_inserted, sizeof(__pyx_k_tetrahedra_shapes_were_inserted), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tetrahedra_shapes_were_inserted */
  {__pyx_k_tetrahedral_group, sizeof(__pyx_k_tetrahedral_group), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tetrahedral_group */
  {__pyx_k_the_gap_method_for_covers_requir, sizeof(__pyx_k_the_gap_method_for_covers_requir), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_the_gap_method_for_covers_requir */
  {__pyx_k_the_magma_method_for_covers_requ, sizeof(__pyx_k_the_magma_method_for_covers_requ), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_the_magma_method_for_covers_requ */
  {__pyx_k_three_to_two, sizeof(__pyx_k_three_to_two), 0, 1, 1}, /* PyObject cname: __pyx_n_u_three_to_two */
  {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */
  {__pyx_k_tilts, sizeof(__pyx_k_tilts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tilts */
  {__pyx_k_time, sizeof(__pyx_k_time), 0, 1, 1}, /* PyObject cname: __pyx_n_u_time */
  {__pyx_k_tip, sizeof(__pyx_k_tip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tip */
  {__pyx_k_tip_vertex_index, sizeof(__pyx_k_tip_vertex_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tip_vertex_index */
  {__pyx_k_title, sizeof(__pyx_k_title), 0, 1, 1}, /* PyObject cname: __pyx_n_u_title */
  {__pyx_k_to_byte_str, sizeof(__pyx_k_to_byte_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_byte_str */
  {__pyx_k_to_bytes, sizeof(__pyx_k_to_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_bytes */
  {__pyx_k_to_do, sizeof(__pyx_k_to_do), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_do */
  {__pyx_k_to_str, sizeof(__pyx_k_to_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_str */
  {__pyx_k_to_string, sizeof(__pyx_k_to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_string */
  {__pyx_k_to_string_locals_genexpr, sizeof(__pyx_k_to_string_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_string_locals_genexpr */
  {__pyx_k_top_level_tries, sizeof(__pyx_k_top_level_tries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_top_level_tries */
  {__pyx_k_topology, sizeof(__pyx_k_topology), 0, 1, 1}, /* PyObject cname: __pyx_n_u_topology */
  {__pyx_k_torus_cusp, sizeof(__pyx_k_torus_cusp), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_torus_cusp */
  {__pyx_k_total, sizeof(__pyx_k_total), 0, 1, 1}, /* PyObject cname: __pyx_n_u_total */
  {__pyx_k_translations, sizeof(__pyx_k_translations), 0, 1, 1}, /* PyObject cname: __pyx_n_u_translations */
  {__pyx_k_tri, sizeof(__pyx_k_tri), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tri */
  {__pyx_k_tri_txt, sizeof(__pyx_k_tri_txt), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tri_txt */
  {__pyx_k_triangulation, sizeof(__pyx_k_triangulation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_triangulation */
  {__pyx_k_triangulation_class, sizeof(__pyx_k_triangulation_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_triangulation_class */
  {__pyx_k_triangulation_help, sizeof(__pyx_k_triangulation_help), 0, 1, 1}, /* PyObject cname: __pyx_n_u_triangulation_help */
  {__pyx_k_triangulation_isosig, sizeof(__pyx_k_triangulation_isosig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_triangulation_isosig */
  {__pyx_k_try_hard_to_shorten_relators, sizeof(__pyx_k_try_hard_to_shorten_relators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_try_hard_to_shorten_relators */
  {__pyx_k_twister, sizeof(__pyx_k_twister), 0, 1, 1}, /* PyObject cname: __pyx_n_u_twister */
  {__pyx_k_twister_word, sizeof(__pyx_k_twister_word), 0, 1, 1}, /* PyObject cname: __pyx_n_u_twister_word */
  {__pyx_k_two_sided, sizeof(__pyx_k_two_sided), 0, 1, 1}, /* PyObject cname: __pyx_n_u_two_sided */
  {__pyx_k_two_sided_2, sizeof(__pyx_k_two_sided_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_two_sided_2 */
  {__pyx_k_two_to_three, sizeof(__pyx_k_two_to_three), 0, 1, 1}, /* PyObject cname: __pyx_n_u_two_to_three */
  {__pyx_k_type, sizeof(__pyx_k_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_type */
  {__pyx_k_type_str, sizeof(__pyx_k_type_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_type_str */
  {__pyx_k_types, sizeof(__pyx_k_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_types */
  {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */
  {__pyx_k_typing_Optional_str, sizeof(__pyx_k_typing_Optional_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Optional_str */
  {__pyx_k_u, sizeof(__pyx_k_u), 0, 1, 1}, /* PyObject cname: __pyx_n_u_u */
  {__pyx_k_undecorated_triangulation_isosi, sizeof(__pyx_k_undecorated_triangulation_isosi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_undecorated_triangulation_isosi */
  {__pyx_k_unit, sizeof(__pyx_k_unit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unit */
  {__pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unknown */
  {__pyx_k_unnamed, sizeof(__pyx_k_unnamed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unnamed */
  {__pyx_k_unnamed_link, sizeof(__pyx_k_unnamed_link), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unnamed_link */
  {__pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unpack */
  {__pyx_k_unpickle_dirichlet_domain, sizeof(__pyx_k_unpickle_dirichlet_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unpickle_dirichlet_domain */
  {__pyx_k_unrecognized_solution_type, sizeof(__pyx_k_unrecognized_solution_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unrecognized_solution_type */
  {__pyx_k_unsimplified_filled_triangulati, sizeof(__pyx_k_unsimplified_filled_triangulati), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unsimplified_filled_triangulati */
  {__pyx_k_unsimplified_filled_triangulati_2, sizeof(__pyx_k_unsimplified_filled_triangulati_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unsimplified_filled_triangulati_2 */
  {__pyx_k_update, sizeof(__pyx_k_update), 0, 1, 1}, /* PyObject cname: __pyx_n_u_update */
  {__pyx_k_upper, sizeof(__pyx_k_upper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_upper */
  {__pyx_k_use_field_conversion, sizeof(__pyx_k_use_field_conversion), 0, 1, 1}, /* PyObject cname: __pyx_n_u_use_field_conversion */
  {__pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_use_setstate */
  {__pyx_k_user_radius, sizeof(__pyx_k_user_radius), 0, 1, 1}, /* PyObject cname: __pyx_n_u_user_radius */
  {__pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_utf_8 */
  {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */
  {__pyx_k_v1205_2_3, sizeof(__pyx_k_v1205_2_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_v1205_2_3 */
  {__pyx_k_valid_index, sizeof(__pyx_k_valid_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_valid_index */
  {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */
  {__pyx_k_values, sizeof(__pyx_k_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_values */
  {__pyx_k_verbose_form, sizeof(__pyx_k_verbose_form), 0, 1, 1}, /* PyObject cname: __pyx_n_u_verbose_form */
  {__pyx_k_verified, sizeof(__pyx_k_verified), 0, 1, 1}, /* PyObject cname: __pyx_n_u_verified */
  {__pyx_k_verify, sizeof(__pyx_k_verify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_verify */
  {__pyx_k_verify_complex_volume, sizeof(__pyx_k_verify_complex_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_verify_complex_volume */
  {__pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_version_info */
  {__pyx_k_vertex, sizeof(__pyx_k_vertex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex */
  {__pyx_k_vertex_class, sizeof(__pyx_k_vertex_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_class */
  {__pyx_k_vertex_data_list, sizeof(__pyx_k_vertex_data_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_data_list */
  {__pyx_k_vertex_epsilon, sizeof(__pyx_k_vertex_epsilon), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_epsilon */
  {__pyx_k_vertex_image_indices, sizeof(__pyx_k_vertex_image_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_image_indices */
  {__pyx_k_vertex_indices, sizeof(__pyx_k_vertex_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_indices */
  {__pyx_k_vertex_list, sizeof(__pyx_k_vertex_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_list */
  {__pyx_k_vertex_list_2, sizeof(__pyx_k_vertex_list_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_list_2 */
  {__pyx_k_vertex_to_index, sizeof(__pyx_k_vertex_to_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_to_index */
  {__pyx_k_vertex_to_index_dict, sizeof(__pyx_k_vertex_to_index_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_to_index_dict */
  {__pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertices */
  {__pyx_k_view, sizeof(__pyx_k_view), 0, 1, 1}, /* PyObject cname: __pyx_n_u_view */
  {__pyx_k_vol, sizeof(__pyx_k_vol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vol */
  {__pyx_k_volume, sizeof(__pyx_k_volume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_volume */
  {__pyx_k_w, sizeof(__pyx_k_w), 0, 1, 1}, /* PyObject cname: __pyx_n_u_w */
  {__pyx_k_w0, sizeof(__pyx_k_w0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_w0 */
  {__pyx_k_w1, sizeof(__pyx_k_w1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_w1 */
  {__pyx_k_was_not_found, sizeof(__pyx_k_was_not_found), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_was_not_found */
  {__pyx_k_wb, sizeof(__pyx_k_wb), 0, 1, 1}, /* PyObject cname: __pyx_n_u_wb */
  {__pyx_k_where_to_resume, sizeof(__pyx_k_where_to_resume), 0, 1, 1}, /* PyObject cname: __pyx_n_u_where_to_resume */
  {__pyx_k_which_curve, sizeof(__pyx_k_which_curve), 0, 1, 1}, /* PyObject cname: __pyx_n_u_which_curve */
  {__pyx_k_which_cusp, sizeof(__pyx_k_which_cusp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_which_cusp */
  {__pyx_k_which_solution, sizeof(__pyx_k_which_solution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_which_solution */
  {__pyx_k_which_surface, sizeof(__pyx_k_which_surface), 0, 1, 1}, /* PyObject cname: __pyx_n_u_which_surface */
  {__pyx_k_with_Dehn_filling_coefficients, sizeof(__pyx_k_with_Dehn_filling_coefficients), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_with_Dehn_filling_coefficients */
  {__pyx_k_with_euler, sizeof(__pyx_k_with_euler), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_with_euler */
  {__pyx_k_with_hyperbolic_structure, sizeof(__pyx_k_with_hyperbolic_structure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_with_hyperbolic_structure */
  {__pyx_k_within_sage, sizeof(__pyx_k_within_sage), 0, 1, 1}, /* PyObject cname: __pyx_n_u_within_sage */
  {__pyx_k_without_hyperbolic_structure, sizeof(__pyx_k_without_hyperbolic_structure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_without_hyperbolic_structure */
  {__pyx_k_word, sizeof(__pyx_k_word), 0, 1, 1}, /* PyObject cname: __pyx_n_u_word */
  {__pyx_k_word_as_list, sizeof(__pyx_k_word_as_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_word_as_list */
  {__pyx_k_word_list, sizeof(__pyx_k_word_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_word_list */
  {__pyx_k_word_moves, sizeof(__pyx_k_word_moves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_word_moves */
  {__pyx_k_words, sizeof(__pyx_k_words), 0, 1, 1}, /* PyObject cname: __pyx_n_u_words */
  {__pyx_k_write, sizeof(__pyx_k_write), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write */
  {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */
  {__pyx_k_x012, sizeof(__pyx_k_x012), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x012 */
  {__pyx_k_xX_d, sizeof(__pyx_k_xX_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_xX_d */
  {__pyx_k_x_d_1, sizeof(__pyx_k_x_d_1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_x_d_1 */
  {__pyx_k_y, sizeof(__pyx_k_y), 0, 1, 1}, /* PyObject cname: __pyx_n_u_y */
  {__pyx_k_y123, sizeof(__pyx_k_y123), 0, 1, 1}, /* PyObject cname: __pyx_n_u_y123 */
  {__pyx_k_z, sizeof(__pyx_k_z), 0, 1, 1}, /* PyObject cname: __pyx_n_u_z */
  {__pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zeros */
  {0, 0, 0, 0, 0}
};
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names);

/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 41, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(2, 85, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(3, 214, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(3, 530, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 103, __pyx_L1_error)
  __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(1, 257, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_map); if (!__pyx_builtin_map) __PYX_ERR(1, 380, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 457, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 469, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 509, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(1, 511, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(1, 515, __pyx_L1_error)
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(1, 551, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 705, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(4, 122, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(4, 292, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(4, 308, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(4, 1058, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 1225, __pyx_L1_error)
  __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_all); if (!__pyx_builtin_all) __PYX_ERR(4, 1344, __pyx_L1_error)
  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(4, 2570, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(5, 55, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(3, 310, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(3, 314, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "cython/core/basic.pyx":380
 * 
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr, l[:3])),             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr, l[-3:])))
 * 
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_3, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "cython/core/basic.pyx":381
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr, l[:3])),
 *                 ', '.join(map(repr, l[-3:])))             # <<<<<<<<<<<<<<
 * 
 *         return (
*/
  __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_neg_3, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);

  /* "cython/core/basic.pyx":454
 *         # e.g., "1.0 E-10" (note the space before "E").
 *         # Remove it - otherwise it cannot be parsed.
 *         string = string.replace(' ', '')             # <<<<<<<<<<<<<<
 *         float(string)
 *     except:
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__9, __pyx_mstate_global->__pyx_kp_u__10); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "cython/core/basic.pyx":615
 *         if len(self) > 0 and 'word' in self[0]:
 *             base = LengthSpectrumFormatStringWithWord % (
 *                 'mult', ' length', 'topology', 'parity', 'word')             # <<<<<<<<<<<<<<
 *         else:
 *             base = LengthSpectrumFormatString % (
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(5, __pyx_mstate_global->__pyx_n_u_mult, __pyx_mstate_global->__pyx_kp_u_length_2, __pyx_mstate_global->__pyx_n_u_topology, __pyx_mstate_global->__pyx_n_u_parity, __pyx_mstate_global->__pyx_n_u_word); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "cython/core/basic.pyx":618
 *         else:
 *             base = LengthSpectrumFormatString % (
 *                 'mult', ' length', 'topology', 'parity')             # <<<<<<<<<<<<<<
 *         return '\n'.join([base] + [repr(s) for s in self])
 * 
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_n_u_mult, __pyx_mstate_global->__pyx_kp_u_length_2, __pyx_mstate_global->__pyx_n_u_topology, __pyx_mstate_global->__pyx_n_u_parity); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(1, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "cython/core/basic.pyx":630
 * 
 * def format_two_by_two(mat):
 *     a,b,c,d = ['%d' % x for x in [mat[0,0], mat[0,1], mat[1,0], mat[1,1]]]             # <<<<<<<<<<<<<<
 *     w0 = max(len(a), len(c))
 *     w1 = max(len(b), len(d))
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(1, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(1, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(1, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(1, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "cython/core/triangulation.pyx":94
 *         self._link_file_full_path = None
 * 
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:             # <<<<<<<<<<<<<<
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_snappy, __pyx_mstate_global->__pyx_n_u_snapPea, __pyx_mstate_global->__pyx_n_u_to_string); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(4, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "cython/core/triangulation.pyx":140
 *         m = split_filling_info.match(spec)
 *         name = m.group(1)
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})             # <<<<<<<<<<<<<<
 * 
 *         self.get_triangulation_from_name(name, remove_finite_vertices)
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__18, __pyx_mstate_global->__pyx_kp_u__19); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(4, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "cython/core/triangulation.pyx":172
 *             if m:
 *                 if int(m.group('components')) > 1:
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),             # <<<<<<<<<<<<<<
 *                                                  int(m.group('components')),
 *                                                  int(m.group('index')))
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_crossings); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(4, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);

  /* "cython/core/triangulation.pyx":173
 *                 if int(m.group('components')) > 1:
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
 *                                                  int(m.group('components')),             # <<<<<<<<<<<<<<
 *                                                  int(m.group('index')))
 *                 else:
*/
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_components); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(4, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);

  /* "cython/core/triangulation.pyx":174
 *                     rolfsen_name = '%d^%d_%d' % (int(m.group('crossings')),
 *                                                  int(m.group('components')),
 *                                                  int(m.group('index')))             # <<<<<<<<<<<<<<
 *                 else:
 *                     rolfsen_name = '%d_%d' % (int(m.group('crossings')),
*/
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(4, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);

  /* "cython/core/triangulation.pyx":293
 *             if os.path.isfile(pathname):
 *                 file = open(pathname, 'r')
 *                 first_line = file.readline()[:-1]             # <<<<<<<<<<<<<<
 *                 file.close()
 *                 if first_line.find('% Link Projection') > -1:
*/
  __pyx_mstate_global->__pyx_slice[2] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(4, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]);

  /* "cython/core/triangulation.pyx":642
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 *                 filetypes = [
 *                     ('Triangulation and text files', '*.tri *.txt', 'TEXT'),             # <<<<<<<<<<<<<<
 *                     ('All text files', '', 'TEXT'),
 *                     ('All files', '')])
*/
  __pyx_mstate_global->__pyx_tuple[12] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_kp_u_Triangulation_and_text_files, __pyx_mstate_global->__pyx_kp_u_tri_txt, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(4, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);

  /* "cython/core/triangulation.pyx":643
 *                 filetypes = [
 *                     ('Triangulation and text files', '*.tri *.txt', 'TEXT'),
 *                     ('All text files', '', 'TEXT'),             # <<<<<<<<<<<<<<
 *                     ('All files', '')])
 *             if savefile:
*/
  __pyx_mstate_global->__pyx_tuple[13] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_kp_u_All_text_files, __pyx_mstate_global->__pyx_kp_u__10, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_mstate_global->__pyx_tuple[13])) __PYX_ERR(4, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[13]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);

  /* "cython/core/triangulation.pyx":644
 *                     ('Triangulation and text files', '*.tri *.txt', 'TEXT'),
 *                     ('All text files', '', 'TEXT'),
 *                     ('All files', '')])             # <<<<<<<<<<<<<<
 *             if savefile:
 *                 filename = savefile.name
*/
  __pyx_mstate_global->__pyx_tuple[14] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_All_files, __pyx_mstate_global->__pyx_kp_u__10); if (unlikely(!__pyx_mstate_global->__pyx_tuple[14])) __PYX_ERR(4, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);

  /* "cython/core/triangulation.pyx":2388
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
  __pyx_mstate_global->__pyx_tuple[15] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_fundamental_group); if (unlikely(!__pyx_mstate_global->__pyx_tuple[15])) __PYX_ERR(4, 2388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[15]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[15]);

  /* "cython/core/triangulation.pyx":2843
 * 
 *             for n in range(self.num_cusps()):
 *                 for i,j in [(0,0),(0,1),(1,0),(1,1)]:             # <<<<<<<<<<<<<<
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
*/
  __pyx_mstate_global->__pyx_tuple[16] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_tuple[3], __pyx_mstate_global->__pyx_tuple[4], __pyx_mstate_global->__pyx_tuple[5], __pyx_mstate_global->__pyx_tuple[6]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[16])) __PYX_ERR(4, 2843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[16]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[16]);

  /* "cython/core/triangulation.pyx":3205
 *                 ignore_orientation)
 *         try:
 *             return self._cache.lookup('triangulation_isosig', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
  __pyx_mstate_global->__pyx_tuple[17] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_triangulation_isosig); if (unlikely(!__pyx_mstate_global->__pyx_tuple[17])) __PYX_ERR(4, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[17]);

  /* "cython/core/manifold.pyx":338
 *     def dirichlet_domain(self,
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),             # <<<<<<<<<<<<<<
 *                          centroid_at_origin : bool = True,
 *                          maximize_injectivity_radius : bool = True,
*/
  __pyx_mstate_global->__pyx_tuple[18] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_float_0_0, __pyx_mstate_global->__pyx_float_0_0, __pyx_mstate_global->__pyx_float_0_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[18])) __PYX_ERR(2, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[18]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[18]);

  /* "cython/core/manifold.pyx":379
 *                 maximize_injectivity_radius, include_words)
 *         try:
 *             return self._cache.lookup('dirichlet_domain', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
  __pyx_mstate_global->__pyx_tuple[19] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_dirichlet_domain); if (unlikely(!__pyx_mstate_global->__pyx_tuple[19])) __PYX_ERR(2, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[19]);

  /* "cython/core/manifold.pyx":924
 *                                        fixed_alignment=fixed_alignment,
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]             # <<<<<<<<<<<<<<
 *             if part is not None:
 *                 return result
*/
  __pyx_mstate_global->__pyx_slice[3] = PySlice_New(Py_None, Py_None, __pyx_mstate_global->__pyx_int_2); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(2, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]);

  /* "cython/core/manifold.pyx":942
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(self.num_tetrahedra()):
*/
  __pyx_mstate_global->__pyx_tuple[20] = PyTuple_Pack(4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[20])) __PYX_ERR(2, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[20]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[20]);

  /* "cython/core/manifold.pyx":1493
 *         args = (cutoff, full_rigor, grouped, include_words)
 *         try:
 *             return self._cache.lookup('length_spectrum', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
  __pyx_mstate_global->__pyx_tuple[21] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_length_spectrum); if (unlikely(!__pyx_mstate_global->__pyx_tuple[21])) __PYX_ERR(2, 1493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[21]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[21]);

  /* "cython/core/fundamental_group.pyx":10
 * 
 * def inverse_list_word(word):
 *     return [ -x for x in word[::-1] ]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_mstate_global->__pyx_slice[4] = PySlice_New(Py_None, Py_None, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_slice[4])) __PYX_ERR(8, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[4]);

  /* "cython/core/symmetry_group.pyx":191
 *         c_factor_1 = get_symmetry_group_factor(self.c_symmetry_group, 1)
 * 
 *         factor_0 = SymmetryGroup(True, False)             # <<<<<<<<<<<<<<
 *         factor_1 = SymmetryGroup(True, False)
 *         factor_0._set_c_symmetry_group(c_factor_0)
*/
  __pyx_mstate_global->__pyx_tuple[22] = PyTuple_Pack(2, Py_True, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[22])) __PYX_ERR(9, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[22]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[22]);

  /* "cython/core/dirichlet.pyx":17
 *                          '"% Generators"')
 *     nums = []
 *     for line in data[1:]:             # <<<<<<<<<<<<<<
 *         nums += line.split()
 *     num_gens = int(nums[0])
*/
  __pyx_mstate_global->__pyx_slice[5] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[5])) __PYX_ERR(10, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[5]);

  /* "cython/core/dirichlet.pyx":122
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':
 *             with open(generator_file, mode='rb') as input_file:             # <<<<<<<<<<<<<<
 *                 data = input_file.read()
 *             self.c_dirichlet_domain, self.c_num_generators = (
*/
  __pyx_mstate_global->__pyx_tuple[23] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[23])) __PYX_ERR(10, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[23]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[23]);

  /* "cython/core/tail.pyx":35
 *         g, n, monodromy = m.groups()
 *         g, n = int(g), int(n)
 *         monodromy = monodromy.replace(',', '*').replace('_', '')             # <<<<<<<<<<<<<<
 *         surface = twister.Surface((g, n))
 *         return surface.bundle(monodromy, return_type='string')
*/
  __pyx_mstate_global->__pyx_tuple[24] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__28, __pyx_mstate_global->__pyx_kp_u__32); if (unlikely(!__pyx_mstate_global->__pyx_tuple[24])) __PYX_ERR(3, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[24]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[24]);
  __pyx_mstate_global->__pyx_tuple[25] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u__21, __pyx_mstate_global->__pyx_kp_u__10); if (unlikely(!__pyx_mstate_global->__pyx_tuple[25])) __PYX_ERR(3, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[25]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[25]);

  /* "cython/core/tail.pyx":301
 *     length = 0
 * 
 *     def __init__(self, indices=(0, 0, 0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
*/
  __pyx_mstate_global->__pyx_tuple[26] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[26])) __PYX_ERR(3, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[26]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[26]);

  /* "cython/core/tail.pyx":461
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 11031, 1)):             # <<<<<<<<<<<<<<
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/
  __pyx_mstate_global->__pyx_tuple[27] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_11031, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[27])) __PYX_ERR(3, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[27]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[27]);

  /* "cython/core/tail.pyx":496
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 17, 1)):             # <<<<<<<<<<<<<<
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/
  __pyx_mstate_global->__pyx_tuple[28] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_17, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[28])) __PYX_ERR(3, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[28]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[28]);

  /* "cython/core/tail.pyx":619
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0, 10000, 1)):             # <<<<<<<<<<<<<<
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
*/
  __pyx_mstate_global->__pyx_tuple[29] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_10000, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[29])) __PYX_ERR(3, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[29]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[29]);

  /* "cython/core/tail.pyx":691
 *             return
 * 
 *         crossings = range(4, 15) if num_crossings is None else [num_crossings]             # <<<<<<<<<<<<<<
 *         files = []
 *         for c in crossings:
*/
  __pyx_mstate_global->__pyx_tuple[30] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_int_15); if (unlikely(!__pyx_mstate_global->__pyx_tuple[30])) __PYX_ERR(3, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[30]);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59cf8a3, 0x3a22a1e, 0x3df3bb8):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59cf8a3, 0x3a22a1e, 0x3df3bb8) = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum
*/
  __pyx_mstate_global->__pyx_tuple[31] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_94173347, __pyx_mstate_global->__pyx_int_60959262, __pyx_mstate_global->__pyx_int_64961464); if (unlikely(!__pyx_mstate_global->__pyx_tuple[31])) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[31]);

  /* "cython/core/basic.pyx":22
 * from .pari import pari as pari
 * try:
 *     import sage.structure.sage_object             # <<<<<<<<<<<<<<
 *     from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
*/
  __pyx_mstate_global->__pyx_tuple[32] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_sage, __pyx_mstate_global->__pyx_n_u_structure, __pyx_mstate_global->__pyx_n_u_sage_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[32])) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[32]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[32]);

  /* "cython/core/basic.pyx":373
 *         self.explain_columns = explain_columns
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
*/
  __pyx_mstate_global->__pyx_tuple[33] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_n_u_MatrixWithExplanations)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[33])) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[33]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[33]);

  /* "cython/core/basic.pyx":723
 * # Conversion functions Manifold <-> Triangulation
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,             # <<<<<<<<<<<<<<
 *                                 manifold_class=None):
 *     cdef c_Triangulation *c_triangulation
*/
  __pyx_mstate_global->__pyx_tuple[34] = PyTuple_Pack(2, ((PyObject*)Py_True), Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[34])) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[34]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[34]);

  /* "cython/core/triangulation.pyx":279
 *         free_LR_factorization(gluing)
 * 
 *     def _get_from_link_data(self, data, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
*/
  __pyx_mstate_global->__pyx_tuple[35] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[35])) __PYX_ERR(4, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[35]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[35]);

  /* "cython/core/triangulation.pyx":387
 *         self.c_triangulation = c_triangulation
 * 
 *     def num_cusps(self, cusp_type='all') -> int:             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of cusps.  By giving the optional argument
*/
  __pyx_mstate_global->__pyx_tuple[36] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_mstate_global->__pyx_tuple[36])) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[36]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[36]);

  /* "cython/core/triangulation.pyx":483
 *         return new_tri
 * 
 *     def randomize(self, blowup_multiple=4, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Perform random Pachner moves on the underlying triangulation,
*/
  __pyx_mstate_global->__pyx_tuple[37] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_int_6); if (unlikely(!__pyx_mstate_global->__pyx_tuple[37])) __PYX_ERR(4, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[37]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[37]);

  /* "cython/core/triangulation.pyx":497
 *         self._cache.clear(message='randomize')
 * 
 *     def simplify(self, passes_at_fours=6):             # <<<<<<<<<<<<<<
 *         """
 *         Try to simplify the triangulation by doing Pachner moves.
*/
  __pyx_mstate_global->__pyx_tuple[38] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_6); if (unlikely(!__pyx_mstate_global->__pyx_tuple[38])) __PYX_ERR(4, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[38]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[38]);

  /* "cython/core/triangulation.pyx":653
 *         raise ValueError('Please specify a file name.')
 * 
 *     def save(self, file_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Save the triangulation as a SnapPea triangulation file.
*/
  __pyx_mstate_global->__pyx_tuple[39] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[39])) __PYX_ERR(4, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[39]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[39]);

  /* "cython/core/triangulation.pyx":791
 *             self._remove_finite_vertices()
 * 
 *     def _from_tetrahedra_gluing_data(self, tetrahedra_data,             # <<<<<<<<<<<<<<
 *                                      num_or_cusps=0,
 *                                      num_nonor_cusps=0,
*/
  __pyx_mstate_global->__pyx_tuple[40] = PyTuple_Pack(5, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, Py_None, Py_None, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[40])) __PYX_ERR(4, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[40]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[40]);

  /* "cython/core/triangulation.pyx":1108
 *         set_triangulation_name(self.c_triangulation, c_new_name)
 * 
 *     def DT_code(self, alpha=False, flips=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Dowker-Thistlethwaite code of this link complement,
*/
  __pyx_mstate_global->__pyx_tuple[41] = PyTuple_Pack(2, Py_False, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[41])) __PYX_ERR(4, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[41]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[41]);

  /* "cython/core/triangulation.pyx":1353
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self, method='fold'):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
*/
  __pyx_mstate_global->__pyx_tuple[42] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_fold); if (unlikely(!__pyx_mstate_global->__pyx_tuple[42])) __PYX_ERR(4, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[42]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[42]);

  /* "cython/core/triangulation.pyx":1425
 *         return filled_tri
 * 
 *     def _marked_tetrahedra(self, clear_marks=False):             # <<<<<<<<<<<<<<
 *         cdef int *marked = NULL
 *         n = self.num_tetrahedra()
*/
  __pyx_mstate_global->__pyx_tuple[43] = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[43])) __PYX_ERR(4, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[43]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[43]);

  /* "cython/core/triangulation.pyx":1457
 *         return ans
 * 
 *     def gluing_equations_pgl(self, N =2, equation_type='all'):             # <<<<<<<<<<<<<<
 * 
 *         """
*/
  __pyx_mstate_global->__pyx_tuple[44] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_mstate_global->__pyx_tuple[44])) __PYX_ERR(4, 1457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[44]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[44]);

  /* "cython/core/triangulation.pyx":1923
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
*/
  __pyx_mstate_global->__pyx_tuple[45] = PyTuple_Pack(3, Py_None, Py_True, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[45])) __PYX_ERR(4, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[45]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[45]);

  /* "cython/core/triangulation.pyx":2108
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)
 * 
 *     def gluing_equations(self,form='log'):             # <<<<<<<<<<<<<<
 *         """
 *         In the default mode, this function returns a matrix with rows
*/
  __pyx_mstate_global->__pyx_tuple[46] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_mstate_global->__pyx_tuple[46])) __PYX_ERR(4, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[46]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[46]);

  /* "cython/core/triangulation.pyx":2346
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(             # <<<<<<<<<<<<<<
 *             self,
 *             simplify_presentation : bool = True,
*/
  __pyx_mstate_global->__pyx_tuple[47] = PyTuple_Pack(4, Py_True, Py_True, Py_True, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[47])) __PYX_ERR(4, 2346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[47]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[47]);

  /* "cython/core/triangulation.pyx":2497
 *         return cover
 * 
 *     def covers(             # <<<<<<<<<<<<<<
 *             self,
 *             degree,
*/
  __pyx_mstate_global->__pyx_tuple[48] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_mstate_global->__pyx_tuple[48])) __PYX_ERR(4, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[48]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[48]);

  /* "cython/core/triangulation.pyx":2564
 *                          "and 'snappea'")
 * 
 *     def _covers_low_index(self, degree, num_threads=0):             # <<<<<<<<<<<<<<
 *         """
 *         Compute all covers using low_index.
*/
  __pyx_mstate_global->__pyx_tuple[49] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[49])) __PYX_ERR(4, 2564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[49]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[49]);

  /* "cython/core/triangulation.pyx":2776
 *         return c_repn_in_original_gens
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
*/
  __pyx_mstate_global->__pyx_tuple[50] = PyTuple_Pack(2, Py_None, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[50])) __PYX_ERR(4, 2776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[50]);

  /* "cython/core/triangulation.pyx":2938
 *         return get_num_fake_cusps(self.c_triangulation) > 0
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated : bool = True,
 *                              ignore_cusp_ordering : bool = False,
*/
  __pyx_mstate_global->__pyx_tuple[51] = PyTuple_Pack(6, Py_True, Py_False, Py_False, Py_False, Py_False, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[51])) __PYX_ERR(4, 2938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[51]);

  /* "cython/core/manifold.pyx":170
 *         self._cache.clear(message='canonize')
 * 
 *     def _canonical_retriangulation(self, opacities=None, top_level_tries=10):             # <<<<<<<<<<<<<<
 *         """
 *         If this triangulation is a subdivision of the canonical cell
*/
  __pyx_mstate_global->__pyx_tuple[52] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_int_10); if (unlikely(!__pyx_mstate_global->__pyx_tuple[52])) __PYX_ERR(2, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[52]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[52]);

  /* "cython/core/manifold.pyx":728
 *         return self._number_(result)
 * 
 *     def volume(self, accuracy=False, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the volume of the current solution to the hyperbolic
*/
  __pyx_mstate_global->__pyx_tuple[53] = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[53])) __PYX_ERR(2, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[53]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[53]);

  /* "cython/core/manifold.pyx":878
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,             # <<<<<<<<<<<<<<
 *                           bits_prec=None, dec_prec=None,
 *                           intervals=False):
*/
  __pyx_mstate_global->__pyx_tuple[54] = PyTuple_Pack(5, Py_None, Py_True, Py_None, Py_None, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[54])) __PYX_ERR(2, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[54]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[54]);

  /* "cython/core/manifold.pyx":1113
 *             return SolutionType[solution_type]
 * 
 *     def set_target_holonomy(self, target, which_cusp=0, recompute=True):             # <<<<<<<<<<<<<<
 *         """
 *         M.set_target_holonomy(target, which_cusp=0, recompute=True)
*/
  __pyx_mstate_global->__pyx_tuple[55] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[55])) __PYX_ERR(2, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[55]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[55]);

  /* "cython/core/manifold.pyx":1128
 *                             which_cusp, c_target, recompute)
 * 
 *     def cusp_info(self, data_spec=None, verified = False, bits_prec = None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
*/
  __pyx_mstate_global->__pyx_tuple[56] = PyTuple_Pack(3, Py_None, Py_False, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[56])) __PYX_ERR(2, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[56]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[56]);

  /* "cython/core/manifold.pyx":1469
 *         return ListOnePerLine(result)
 * 
 *     def length_spectrum(self,             # <<<<<<<<<<<<<<
 *                         cutoff=1.0,
 *                         full_rigor : bool =True,
*/
  __pyx_mstate_global->__pyx_tuple[57] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_float_1_0, Py_True, Py_True, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[57])) __PYX_ERR(2, 1469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[57]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[57]);

  /* "cython/core/fundamental_group.pyx":177
 *         return orig_gens
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form=False, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the current generators in terms of the original
*/
  __pyx_mstate_global->__pyx_tuple[58] = PyTuple_Pack(3, Py_False, Py_False, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[58])) __PYX_ERR(8, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[58]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[58]);

  /* "cython/core/fundamental_group.pyx":306
 *         return relation_list
 * 
 *     def meridian(self, int which_cusp=0, as_int_list=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a word representing a conjugate of the current
*/
  __pyx_mstate_global->__pyx_tuple[59] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[59])) __PYX_ERR(8, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[59]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[59]);

  /* "cython/core/dirichlet.pyx":236
 *         return self._number_(radius)
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,             # <<<<<<<<<<<<<<
 *                               full_rigor=True,
 *                               multiplicities=True,
*/
  __pyx_mstate_global->__pyx_tuple[60] = PyTuple_Pack(5, __pyx_mstate_global->__pyx_float_1_0, Py_True, Py_True, __pyx_mstate_global->__pyx_float_0_0, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[60])) __PYX_ERR(10, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[60]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[60]);

  /* "cython/core/dirichlet.pyx":666
 *             output.write(self._to_string().encode('ascii'))
 * 
 *     def export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3,             # <<<<<<<<<<<<<<
 *                    shrink_factor=0.9, cutoff_radius=0.9, callback=None):
 *         """
*/
  __pyx_mstate_global->__pyx_tuple[61] = PyTuple_Pack(6, __pyx_mstate_global->__pyx_n_u_klein, Py_False, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_float_0_9, __pyx_mstate_global->__pyx_float_0_9, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[61])) __PYX_ERR(10, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[61]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[61]);

  /* "cython/core/cusp_neighborhoods.pyx":190
 *         return self._number_(M), self._number_(L)
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,             # <<<<<<<<<<<<<<
 *                   high_precision=False):
 *         """
*/
  __pyx_mstate_global->__pyx_tuple[62] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_float_0_1, __pyx_mstate_global->__pyx_int_0, Py_True, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[62])) __PYX_ERR(11, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[62]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[62]);

  /* "cython/core/cusp_neighborhoods.pyx":289
 *         return result
 * 
 *     def view(self, which_cusp=0, cutoff=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a 3D picture of the horoball packing.  One can specify
*/
  __pyx_mstate_global->__pyx_tuple[63] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[63])) __PYX_ERR(11, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[63]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[63]);

  /* "cython/core/tail.pyx":53
 * 
 * # Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',             # <<<<<<<<<<<<<<
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
*/
  __pyx_mstate_global->__pyx_tuple[64] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[64])) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[64]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[64]);

  /* "cython/core/tail.pyx":54
 * # Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',             # <<<<<<<<<<<<<<
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
*/
  __pyx_mstate_global->__pyx_tuple[65] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[65])) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[65]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[65]);

  /* "cython/core/tail.pyx":55
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',             # <<<<<<<<<<<<<<
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
*/
  __pyx_mstate_global->__pyx_tuple[66] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_6, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[66])) __PYX_ERR(3, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[66]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[66]);

  /* "cython/core/tail.pyx":56
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',             # <<<<<<<<<<<<<<
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}
*/
  __pyx_mstate_global->__pyx_tuple[67] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[67])) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[67]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[67]);

  /* "cython/core/tail.pyx":57
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',             # <<<<<<<<<<<<<<
 *                  (7, 1) : 'y'}
 * 
*/
  __pyx_mstate_global->__pyx_tuple[68] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_6, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[68])) __PYX_ERR(3, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[68]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[68]);

  /* "cython/core/tail.pyx":58
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}             # <<<<<<<<<<<<<<
 * 
 * triangulation_help = """
*/
  __pyx_mstate_global->__pyx_tuple[69] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[69])) __PYX_ERR(3, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[69]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[69]);

  /* "cython/core/tail.pyx":301
 *     length = 0
 * 
 *     def __init__(self, indices=(0, 0, 0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
*/
  __pyx_mstate_global->__pyx_tuple[70] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_tuple[26])); if (unlikely(!__pyx_mstate_global->__pyx_tuple[70])) __PYX_ERR(3, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[70]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[70]);

  /* "cython/core/tail.pyx":330
 * #  Cusped Census
 * 
 * Orientable_lengths = (301, 962, 3552, 12846, 301+962+3552+12846)             # <<<<<<<<<<<<<<
 * Nonorientable_lengths = (114, 259, 887, 114+259+887)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[71] = PyTuple_Pack(5, __pyx_mstate_global->__pyx_int_301, __pyx_mstate_global->__pyx_int_962, __pyx_mstate_global->__pyx_int_3552, __pyx_mstate_global->__pyx_int_12846, __pyx_mstate_global->__pyx_int_17661); if (unlikely(!__pyx_mstate_global->__pyx_tuple[71])) __PYX_ERR(3, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[71]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[71]);

  /* "cython/core/tail.pyx":331
 * 
 * Orientable_lengths = (301, 962, 3552, 12846, 301+962+3552+12846)
 * Nonorientable_lengths = (114, 259, 887, 114+259+887)             # <<<<<<<<<<<<<<
 * 
 * five_tet_orientable = (
*/
  __pyx_mstate_global->__pyx_tuple[72] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_int_114, __pyx_mstate_global->__pyx_int_259, __pyx_mstate_global->__pyx_int_887, __pyx_mstate_global->__pyx_int_1260); if (unlikely(!__pyx_mstate_global->__pyx_tuple[72])) __PYX_ERR(3, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[72]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[72]);

  /* "cython/core/tail.pyx":334
 * 
 * five_tet_orientable = (
 *    3, 4, 6, 7, 9, 10, 11, 15, 16, 17, 19, 22, 23, 26, 27, 29, 30, 32, 33,             # <<<<<<<<<<<<<<
 *    34, 35, 36, 37, 38, 39, 40, 43, 44, 45, 46, 47, 49, 52, 53, 54, 55, 58,
 *    59, 60, 61, 62, 64, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 80,
*/
  __pyx_mstate_global->__pyx_tuple[73] = PyTuple_Pack(301, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_int_6, __pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_int_9, __pyx_mstate_global->__pyx_int_10, __pyx_mstate_global->__pyx_int_11, __pyx_mstate_global->__pyx_int_15, __pyx_mstate_global->__pyx_int_16, __pyx_mstate_global->__pyx_int_17, __pyx_mstate_global->__pyx_int_19, __pyx_mstate_global->__pyx_int_22, __pyx_mstate_global->__pyx_int_23, __pyx_mstate_global->__pyx_int_26, __pyx_mstate_global->__pyx_int_27, __pyx_mstate_global->__pyx_int_29, __pyx_mstate_global->__pyx_int_30, __pyx_mstate_global->__pyx_int_32, __pyx_mstate_global->__pyx_int_33, __pyx_mstate_global->__pyx_int_34, __pyx_mstate_global->__pyx_int_35, __pyx_mstate_global->__pyx_int_36, __pyx_mstate_global->__pyx_int_37, __pyx_mstate_global->__pyx_int_38, __pyx_mstate_global->__pyx_int_39, __pyx_mstate_global->__pyx_int_40, __pyx_mstate_global->__pyx_int_43, __pyx_mstate_global->__pyx_int_44, __pyx_mstate_global->__pyx_int_45, __pyx_mstate_global->__pyx_int_46, __pyx_mstate_global->__pyx_int_47, __pyx_mstate_global->__pyx_int_49, __pyx_mstate_global->__pyx_int_52, __pyx_mstate_global->__pyx_int_53, __pyx_mstate_global->__pyx_int_54, __pyx_mstate_global->__pyx_int_55, __pyx_mstate_global->__pyx_int_58, __pyx_mstate_global->__pyx_int_59, __pyx_mstate_global->__pyx_int_60, __pyx_mstate_global->__pyx_int_61, __pyx_mstate_global->__pyx_int_62, __pyx_mstate_global->__pyx_int_64, __pyx_mstate_global->__pyx_int_66, __pyx_mstate_global->__pyx_int_67, __pyx_mstate_global->__pyx_int_69, __pyx_mstate_global->__pyx_int_70, __pyx_mstate_global->__pyx_int_71, __pyx_mstate_global->__pyx_int_72, __pyx_mstate_global->__pyx_int_73, __pyx_mstate_global->__pyx_int_74, __pyx_mstate_global->__pyx_int_76, __pyx_mstate_global->__pyx_int_77, __pyx_mstate_global->__pyx_int_78, __pyx_mstate_global->__pyx_int_79, __pyx_mstate_global->__pyx_int_80, __pyx_mstate_global->__pyx_int_81, __pyx_mstate_global->__pyx_int_82, __pyx_mstate_global->__pyx_int_83, __pyx_mstate_global->__pyx_int_84, __pyx_mstate_global->__pyx_int_85, __pyx_mstate_global->__pyx_int_87, __pyx_mstate_global->__pyx_int_89, __pyx_mstate_global->__pyx_int_90, __pyx_mstate_global->__pyx_int_93, __pyx_mstate_global->__pyx_int_94, __pyx_mstate_global->__pyx_int_95, __pyx_mstate_global->__pyx_int_96, __pyx_mstate_global->__pyx_int_98, __pyx_mstate_global->__pyx_int_99, __pyx_mstate_global->__pyx_int_100, __pyx_mstate_global->__pyx_int_102, __pyx_mstate_global->__pyx_int_103, __pyx_mstate_global->__pyx_int_104, __pyx_mstate_global->__pyx_int_105, __pyx_mstate_global->__pyx_int_106, __pyx_mstate_global->__pyx_int_108, __pyx_mstate_global->__pyx_int_110, __pyx_mstate_global->__pyx_int_111, __pyx_mstate_global->__pyx_int_112, __pyx_mstate_global->__pyx_int_113, __pyx_mstate_global->__pyx_int_115, __pyx_mstate_global->__pyx_int_116, __pyx_mstate_global->__pyx_int_117, __pyx_mstate_global->__pyx_int_118, __pyx_mstate_global->__pyx_int_119, __pyx_mstate_global->__pyx_int_120, __pyx_mstate_global->__pyx_int_121, __pyx_mstate_global->__pyx_int_122, __pyx_mstate_global->__pyx_int_123, __pyx_mstate_global->__pyx_int_125, __pyx_mstate_global->__pyx_int_129, __pyx_mstate_global->__pyx_int_130, __pyx_mstate_global->__pyx_int_135, __pyx_mstate_global->__pyx_int_136, __pyx_mstate_global->__pyx_int_137, __pyx_mstate_global->__pyx_int_139, __pyx_mstate_global->__pyx_int_140, __pyx_mstate_global->__pyx_int_141, __pyx_mstate_global->__pyx_int_142, __pyx_mstate_global->__pyx_int_143, __pyx_mstate_global->__pyx_int_144, __pyx_mstate_global->__pyx_int_145, __pyx_mstate_global->__pyx_int_146, __pyx_mstate_global->__pyx_int_147, __pyx_mstate_global->__pyx_int_148, __pyx_mstate_global->__pyx_int_149, __pyx_mstate_global->__pyx_int_150, __pyx_mstate_global->__pyx_int_151, __pyx_mstate_global->__pyx_int_154, __pyx_mstate_global->__pyx_int_155, __pyx_mstate_global->__pyx_int_157, __pyx_mstate_global->__pyx_int_159, __pyx_mstate_global->__pyx_int_160, __pyx_mstate_global->__pyx_int_161, __pyx_mstate_global->__pyx_int_162, __pyx_mstate_global->__pyx_int_163, __pyx_mstate_global->__pyx_int_164, __pyx_mstate_global->__pyx_int_165, __pyx_mstate_global->__pyx_int_166, __pyx_mstate_global->__pyx_int_167, __pyx_mstate_global->__pyx_int_168, __pyx_mstate_global->__pyx_int_169, __pyx_mstate_global->__pyx_int_170, __pyx_mstate_global->__pyx_int_171, __pyx_mstate_global->__pyx_int_172, __pyx_mstate_global->__pyx_int_173, __pyx_mstate_global->__pyx_int_175, __pyx_mstate_global->__pyx_int_178, __pyx_mstate_global->__pyx_int_179, __pyx_mstate_global->__pyx_int_180, __pyx_mstate_global->__pyx_int_181, __pyx_mstate_global->__pyx_int_182, __pyx_mstate_global->__pyx_int_183, __pyx_mstate_global->__pyx_int_184, __pyx_mstate_global->__pyx_int_185, __pyx_mstate_global->__pyx_int_186, __pyx_mstate_global->__pyx_int_188, __pyx_mstate_global->__pyx_int_189, __pyx_mstate_global->__pyx_int_190, __pyx_mstate_global->__pyx_int_191, __pyx_mstate_global->__pyx_int_192, __pyx_mstate_global->__pyx_int_193, __pyx_mstate_global->__pyx_int_194, __pyx_mstate_global->__pyx_int_195, __pyx_mstate_global->__pyx_int_196, __pyx_mstate_global->__pyx_int_197, __pyx_mstate_global->__pyx_int_198, __pyx_mstate_global->__pyx_int_199, __pyx_mstate_global->__pyx_int_200, __pyx_mstate_global->__pyx_int_201, __pyx_mstate_global->__pyx_int_202, __pyx_mstate_global->__pyx_int_203, __pyx_mstate_global->__pyx_int_206, __pyx_mstate_global->__pyx_int_207, __pyx_mstate_global->__pyx_int_208, __pyx_mstate_global->__pyx_int_209, __pyx_mstate_global->__pyx_int_210, __pyx_mstate_global->__pyx_int_211, __pyx_mstate_global->__pyx_int_212, __pyx_mstate_global->__pyx_int_213, __pyx_mstate_global->__pyx_int_214, __pyx_mstate_global->__pyx_int_215, __pyx_mstate_global->__pyx_int_216, __pyx_mstate_global->__pyx_int_217, __pyx_mstate_global->__pyx_int_218, __pyx_mstate_global->__pyx_int_219, __pyx_mstate_global->__pyx_int_220, __pyx_mstate_global->__pyx_int_221, __pyx_mstate_global->__pyx_int_222, __pyx_mstate_global->__pyx_int_223, __pyx_mstate_global->__pyx_int_224, __pyx_mstate_global->__pyx_int_225, __pyx_mstate_global->__pyx_int_227, __pyx_mstate_global->__pyx_int_228, __pyx_mstate_global->__pyx_int_229, __pyx_mstate_global->__pyx_int_230, __pyx_mstate_global->__pyx_int_231, __pyx_mstate_global->__pyx_int_232, __pyx_mstate_global->__pyx_int_233, __pyx_mstate_global->__pyx_int_234, __pyx_mstate_global->__pyx_int_235, __pyx_mstate_global->__pyx_int_236, __pyx_mstate_global->__pyx_int_238, __pyx_mstate_global->__pyx_int_239, __pyx_mstate_global->__pyx_int_240, __pyx_mstate_global->__pyx_int_241, __pyx_mstate_global->__pyx_int_242, __pyx_mstate_global->__pyx_int_243, __pyx_mstate_global->__pyx_int_244, __pyx_mstate_global->__pyx_int_246, __pyx_mstate_global->__pyx_int_247, __pyx_mstate_global->__pyx_int_248, __pyx_mstate_global->__pyx_int_249, __pyx_mstate_global->__pyx_int_250, __pyx_mstate_global->__pyx_int_251, __pyx_mstate_global->__pyx_int_252, __pyx_mstate_global->__pyx_int_253, __pyx_mstate_global->__pyx_int_255, __pyx_mstate_global->__pyx_int_256, __pyx_mstate_global->__pyx_int_257, __pyx_mstate_global->__pyx_int_258, __pyx_mstate_global->__pyx_int_259, __pyx_mstate_global->__pyx_int_260, __pyx_mstate_global->__pyx_int_261, __pyx_mstate_global->__pyx_int_262, __pyx_mstate_global->__pyx_int_263, __pyx_mstate_global->__pyx_int_266, __pyx_mstate_global->__pyx_int_267, __pyx_mstate_global->__pyx_int_269, __pyx_mstate_global->__pyx_int_270, __pyx_mstate_global->__pyx_int_271, __pyx_mstate_global->__pyx_int_272, __pyx_mstate_global->__pyx_int_273, __pyx_mstate_global->__pyx_int_275, __pyx_mstate_global->__pyx_int_276, __pyx_mstate_global->__pyx_int_277, __pyx_mstate_global->__pyx_int_278, __pyx_mstate_global->__pyx_int_279, __pyx_mstate_global->__pyx_int_280, __pyx_mstate_global->__pyx_int_281, __pyx_mstate_global->__pyx_int_282, __pyx_mstate_global->__pyx_int_284, __pyx_mstate_global->__pyx_int_285, __pyx_mstate_global->__pyx_int_286, __pyx_mstate_global->__pyx_int_287, __pyx_mstate_global->__pyx_int_288, __pyx_mstate_global->__pyx_int_289, __pyx_mstate_global->__pyx_int_290, __pyx_mstate_global->__pyx_int_291, __pyx_mstate_global->__pyx_int_292, __pyx_mstate_global->__pyx_int_293, __pyx_mstate_global->__pyx_int_294, __pyx_mstate_global->__pyx_int_295, __pyx_mstate_global->__pyx_int_296, __pyx_mstate_global->__pyx_int_297, __pyx_mstate_global->__pyx_int_299, __pyx_mstate_global->__pyx_int_300, __pyx_mstate_global->__pyx_int_302, __pyx_mstate_global->__pyx_int_303, __pyx_mstate_global->__pyx_int_304, __pyx_mstate_global->__pyx_int_305, __pyx_mstate_global->__pyx_int_306, __pyx_mstate_global->__pyx_int_307, __pyx_mstate_global->__pyx_int_310, __pyx_mstate_global->__pyx_int_312, __pyx_mstate_global->__pyx_int_316, __pyx_mstate_global->__pyx_int_318, __pyx_mstate_global->__pyx_int_319, __pyx_mstate_global->__pyx_int_320, __pyx_mstate_global->__pyx_int_322, __pyx_mstate_global->__pyx_int_326, __pyx_mstate_global->__pyx_int_328, __pyx_mstate_global->__pyx_int_329, __pyx_mstate_global->__pyx_int_335, __pyx_mstate_global->__pyx_int_336, __pyx_mstate_global->__pyx_int_337, __pyx_mstate_global->__pyx_int_338, __pyx_mstate_global->__pyx_int_339, __pyx_mstate_global->__pyx_int_340, __pyx_mstate_global->__pyx_int_342, __pyx_mstate_global->__pyx_int_343, __pyx_mstate_global->__pyx_int_345, __pyx_mstate_global->__pyx_int_346, __pyx_mstate_global->__pyx_int_349, __pyx_mstate_global->__pyx_int_350, __pyx_mstate_global->__pyx_int_351, __pyx_mstate_global->__pyx_int_352, __pyx_mstate_global->__pyx_int_356, __pyx_mstate_global->__pyx_int_357, __pyx_mstate_global->__pyx_int_358, __pyx_mstate_global->__pyx_int_359, __pyx_mstate_global->__pyx_int_360, __pyx_mstate_global->__pyx_int_361, __pyx_mstate_global->__pyx_int_363, __pyx_mstate_global->__pyx_int_364, __pyx_mstate_global->__pyx_int_366, __pyx_mstate_global->__pyx_int_367, __pyx_mstate_global->__pyx_int_368, __pyx_mstate_global->__pyx_int_369, __pyx_mstate_global->__pyx_int_370, __pyx_mstate_global->__pyx_int_371, __pyx_mstate_global->__pyx_int_372, __pyx_mstate_global->__pyx_int_373, __pyx_mstate_global->__pyx_int_374, __pyx_mstate_global->__pyx_int_376, __pyx_mstate_global->__pyx_int_378, __pyx_mstate_global->__pyx_int_385, __pyx_mstate_global->__pyx_int_388, __pyx_mstate_global->__pyx_int_389, __pyx_mstate_global->__pyx_int_390, __pyx_mstate_global->__pyx_int_391, __pyx_mstate_global->__pyx_int_392, __pyx_mstate_global->__pyx_int_393, __pyx_mstate_global->__pyx_int_395, __pyx_mstate_global->__pyx_int_397, __pyx_mstate_global->__pyx_int_400, __pyx_mstate_global->__pyx_int_401, __pyx_mstate_global->__pyx_int_402, __pyx_mstate_global->__pyx_int_403, __pyx_mstate_global->__pyx_int_410, __pyx_mstate_global->__pyx_int_412); if (unlikely(!__pyx_mstate_global->__pyx_tuple[73])) __PYX_ERR(3, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[73]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[73]);

  /* "cython/core/tail.pyx":357
 * 
 * five_tet_nonorientable = (
 *    0, 1, 2, 5, 8, 12, 13, 14, 18, 20, 21, 24, 25, 28, 31, 41, 42, 48, 50,             # <<<<<<<<<<<<<<
 *    51, 56, 57, 63, 65, 68, 75, 86, 88, 91, 92, 97, 101, 107, 109, 114, 124,
 *    126, 127, 128, 131, 132, 133, 134, 138, 152, 153, 156, 158, 174, 176,
*/
  __pyx_mstate_global->__pyx_tuple[74] = PyTuple_Pack(114, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_int_8, __pyx_mstate_global->__pyx_int_12, __pyx_mstate_global->__pyx_int_13, __pyx_mstate_global->__pyx_int_14, __pyx_mstate_global->__pyx_int_18, __pyx_mstate_global->__pyx_int_20, __pyx_mstate_global->__pyx_int_21, __pyx_mstate_global->__pyx_int_24, __pyx_mstate_global->__pyx_int_25, __pyx_mstate_global->__pyx_int_28, __pyx_mstate_global->__pyx_int_31, __pyx_mstate_global->__pyx_int_41, __pyx_mstate_global->__pyx_int_42, __pyx_mstate_global->__pyx_int_48, __pyx_mstate_global->__pyx_int_50, __pyx_mstate_global->__pyx_int_51, __pyx_mstate_global->__pyx_int_56, __pyx_mstate_global->__pyx_int_57, __pyx_mstate_global->__pyx_int_63, __pyx_mstate_global->__pyx_int_65, __pyx_mstate_global->__pyx_int_68, __pyx_mstate_global->__pyx_int_75, __pyx_mstate_global->__pyx_int_86, __pyx_mstate_global->__pyx_int_88, __pyx_mstate_global->__pyx_int_91, __pyx_mstate_global->__pyx_int_92, __pyx_mstate_global->__pyx_int_97, __pyx_mstate_global->__pyx_int_101, __pyx_mstate_global->__pyx_int_107, __pyx_mstate_global->__pyx_int_109, __pyx_mstate_global->__pyx_int_114, __pyx_mstate_global->__pyx_int_124, __pyx_mstate_global->__pyx_int_126, __pyx_mstate_global->__pyx_int_127, __pyx_mstate_global->__pyx_int_128, __pyx_mstate_global->__pyx_int_131, __pyx_mstate_global->__pyx_int_132, __pyx_mstate_global->__pyx_int_133, __pyx_mstate_global->__pyx_int_134, __pyx_mstate_global->__pyx_int_138, __pyx_mstate_global->__pyx_int_152, __pyx_mstate_global->__pyx_int_153, __pyx_mstate_global->__pyx_int_156, __pyx_mstate_global->__pyx_int_158, __pyx_mstate_global->__pyx_int_174, __pyx_mstate_global->__pyx_int_176, __pyx_mstate_global->__pyx_int_177, __pyx_mstate_global->__pyx_int_187, __pyx_mstate_global->__pyx_int_204, __pyx_mstate_global->__pyx_int_205, __pyx_mstate_global->__pyx_int_226, __pyx_mstate_global->__pyx_int_237, __pyx_mstate_global->__pyx_int_245, __pyx_mstate_global->__pyx_int_254, __pyx_mstate_global->__pyx_int_264, __pyx_mstate_global->__pyx_int_265, __pyx_mstate_global->__pyx_int_268, __pyx_mstate_global->__pyx_int_274, __pyx_mstate_global->__pyx_int_283, __pyx_mstate_global->__pyx_int_298, __pyx_mstate_global->__pyx_int_301, __pyx_mstate_global->__pyx_int_308, __pyx_mstate_global->__pyx_int_309, __pyx_mstate_global->__pyx_int_311, __pyx_mstate_global->__pyx_int_313, __pyx_mstate_global->__pyx_int_314, __pyx_mstate_global->__pyx_int_315, __pyx_mstate_global->__pyx_int_317, __pyx_mstate_global->__pyx_int_321, __pyx_mstate_global->__pyx_int_323, __pyx_mstate_global->__pyx_int_324, __pyx_mstate_global->__pyx_int_325, __pyx_mstate_global->__pyx_int_327, __pyx_mstate_global->__pyx_int_330, __pyx_mstate_global->__pyx_int_331, __pyx_mstate_global->__pyx_int_332, __pyx_mstate_global->__pyx_int_333, __pyx_mstate_global->__pyx_int_334, __pyx_mstate_global->__pyx_int_341, __pyx_mstate_global->__pyx_int_344, __pyx_mstate_global->__pyx_int_347, __pyx_mstate_global->__pyx_int_348, __pyx_mstate_global->__pyx_int_353, __pyx_mstate_global->__pyx_int_354, __pyx_mstate_global->__pyx_int_355, __pyx_mstate_global->__pyx_int_362, __pyx_mstate_global->__pyx_int_365, __pyx_mstate_global->__pyx_int_375, __pyx_mstate_global->__pyx_int_377, __pyx_mstate_global->__pyx_int_379, __pyx_mstate_global->__pyx_int_380, __pyx_mstate_global->__pyx_int_381, __pyx_mstate_global->__pyx_int_382, __pyx_mstate_global->__pyx_int_383, __pyx_mstate_global->__pyx_int_384, __pyx_mstate_global->__pyx_int_386, __pyx_mstate_global->__pyx_int_387, __pyx_mstate_global->__pyx_int_394, __pyx_mstate_global->__pyx_int_396, __pyx_mstate_global->__pyx_int_398, __pyx_mstate_global->__pyx_int_399, __pyx_mstate_global->__pyx_int_404, __pyx_mstate_global->__pyx_int_405, __pyx_mstate_global->__pyx_int_406, __pyx_mstate_global->__pyx_int_407, __pyx_mstate_global->__pyx_int_408, __pyx_mstate_global->__pyx_int_409, __pyx_mstate_global->__pyx_int_411, __pyx_mstate_global->__pyx_int_413, __pyx_mstate_global->__pyx_int_414); if (unlikely(!__pyx_mstate_global->__pyx_tuple[74])) __PYX_ERR(3, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[74]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[74]);

  /* "cython/core/tail.pyx":461
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 11031, 1)):             # <<<<<<<<<<<<<<
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/
  __pyx_mstate_global->__pyx_tuple[75] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_tuple[27])); if (unlikely(!__pyx_mstate_global->__pyx_tuple[75])) __PYX_ERR(3, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[75]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[75]);

  /* "cython/core/tail.pyx":496
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0, 17, 1)):             # <<<<<<<<<<<<<<
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
*/
  __pyx_mstate_global->__pyx_tuple[76] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_tuple[28])); if (unlikely(!__pyx_mstate_global->__pyx_tuple[76])) __PYX_ERR(3, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[76]);

  /* "cython/core/tail.pyx":619
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0, 10000, 1)):             # <<<<<<<<<<<<<<
 *         self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
*/
  __pyx_mstate_global->__pyx_tuple[77] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_tuple[29])); if (unlikely(!__pyx_mstate_global->__pyx_tuple[77])) __PYX_ERR(3, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[77]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[77]);

  /* "cython/core/tail.pyx":679
 * 
 * 
 * def left_pad_string(str,  length, pad=' '):             # <<<<<<<<<<<<<<
 *     return pad*(length - len(str)) + str
 * 
*/
  __pyx_mstate_global->__pyx_tuple[78] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_kp_u__9)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[78])) __PYX_ERR(3, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[78]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[78]);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type;
  __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyBytes_Type__split.type = (PyObject*)(&PyBytes_Type);
  __pyx_mstate->__pyx_umethod_PyBytes_Type__split.method_name = &__pyx_mstate->__pyx_n_u_split;
  __pyx_mstate->__pyx_umethod_PyDict_Type__update.type = (PyObject*)(&PyDict_Type);
  __pyx_mstate->__pyx_umethod_PyDict_Type__update.method_name = &__pyx_mstate->__pyx_n_u_update;
  __pyx_mstate->__pyx_umethod_PyUnicode_Type__ljust.type = (PyObject*)(&PyUnicode_Type);
  __pyx_mstate->__pyx_umethod_PyUnicode_Type__ljust.method_name = &__pyx_mstate->__pyx_n_u_ljust;
  __pyx_mstate->__pyx_umethod_PyUnicode_Type__lower.type = (PyObject*)(&PyUnicode_Type);
  __pyx_mstate->__pyx_umethod_PyUnicode_Type__lower.method_name = &__pyx_mstate->__pyx_n_u_lower;
  if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_mstate->__pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_mstate->__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_mstate->__pyx_float_0_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_2 = PyFloat_FromDouble(0.2); if (unlikely(!__pyx_mstate->__pyx_float_0_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_9 = PyFloat_FromDouble(0.9); if (unlikely(!__pyx_mstate->__pyx_float_0_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_mstate->__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_1eneg_9 = PyFloat_FromDouble(1e-9); if (unlikely(!__pyx_mstate->__pyx_float_1eneg_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_2 = PyLong_FromLong(2); if (unlikely(!__pyx_mstate->__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_3 = PyLong_FromLong(3); if (unlikely(!__pyx_mstate->__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_4 = PyLong_FromLong(4); if (unlikely(!__pyx_mstate->__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_5 = PyLong_FromLong(5); if (unlikely(!__pyx_mstate->__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_6 = PyLong_FromLong(6); if (unlikely(!__pyx_mstate->__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_7 = PyLong_FromLong(7); if (unlikely(!__pyx_mstate->__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_8 = PyLong_FromLong(8); if (unlikely(!__pyx_mstate->__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_9 = PyLong_FromLong(9); if (unlikely(!__pyx_mstate->__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_10 = PyLong_FromLong(10); if (unlikely(!__pyx_mstate->__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_11 = PyLong_FromLong(11); if (unlikely(!__pyx_mstate->__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_12 = PyLong_FromLong(12); if (unlikely(!__pyx_mstate->__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_13 = PyLong_FromLong(13); if (unlikely(!__pyx_mstate->__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_14 = PyLong_FromLong(14); if (unlikely(!__pyx_mstate->__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_15 = PyLong_FromLong(15); if (unlikely(!__pyx_mstate->__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_16 = PyLong_FromLong(16); if (unlikely(!__pyx_mstate->__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_17 = PyLong_FromLong(17); if (unlikely(!__pyx_mstate->__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_18 = PyLong_FromLong(18); if (unlikely(!__pyx_mstate->__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_19 = PyLong_FromLong(19); if (unlikely(!__pyx_mstate->__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_20 = PyLong_FromLong(20); if (unlikely(!__pyx_mstate->__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_21 = PyLong_FromLong(21); if (unlikely(!__pyx_mstate->__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_22 = PyLong_FromLong(22); if (unlikely(!__pyx_mstate->__pyx_int_22)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_23 = PyLong_FromLong(23); if (unlikely(!__pyx_mstate->__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_24 = PyLong_FromLong(24); if (unlikely(!__pyx_mstate->__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_25 = PyLong_FromLong(25); if (unlikely(!__pyx_mstate->__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_26 = PyLong_FromLong(26); if (unlikely(!__pyx_mstate->__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_27 = PyLong_FromLong(27); if (unlikely(!__pyx_mstate->__pyx_int_27)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_28 = PyLong_FromLong(28); if (unlikely(!__pyx_mstate->__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_29 = PyLong_FromLong(29); if (unlikely(!__pyx_mstate->__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_30 = PyLong_FromLong(30); if (unlikely(!__pyx_mstate->__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_31 = PyLong_FromLong(31); if (unlikely(!__pyx_mstate->__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_32 = PyLong_FromLong(32); if (unlikely(!__pyx_mstate->__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_33 = PyLong_FromLong(33); if (unlikely(!__pyx_mstate->__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_34 = PyLong_FromLong(34); if (unlikely(!__pyx_mstate->__pyx_int_34)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_35 = PyLong_FromLong(35); if (unlikely(!__pyx_mstate->__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_36 = PyLong_FromLong(36); if (unlikely(!__pyx_mstate->__pyx_int_36)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_37 = PyLong_FromLong(37); if (unlikely(!__pyx_mstate->__pyx_int_37)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_38 = PyLong_FromLong(38); if (unlikely(!__pyx_mstate->__pyx_int_38)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_39 = PyLong_FromLong(39); if (unlikely(!__pyx_mstate->__pyx_int_39)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_40 = PyLong_FromLong(40); if (unlikely(!__pyx_mstate->__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_41 = PyLong_FromLong(41); if (unlikely(!__pyx_mstate->__pyx_int_41)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_42 = PyLong_FromLong(42); if (unlikely(!__pyx_mstate->__pyx_int_42)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_43 = PyLong_FromLong(43); if (unlikely(!__pyx_mstate->__pyx_int_43)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_44 = PyLong_FromLong(44); if (unlikely(!__pyx_mstate->__pyx_int_44)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_45 = PyLong_FromLong(45); if (unlikely(!__pyx_mstate->__pyx_int_45)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_46 = PyLong_FromLong(46); if (unlikely(!__pyx_mstate->__pyx_int_46)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_47 = PyLong_FromLong(47); if (unlikely(!__pyx_mstate->__pyx_int_47)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_48 = PyLong_FromLong(48); if (unlikely(!__pyx_mstate->__pyx_int_48)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_49 = PyLong_FromLong(49); if (unlikely(!__pyx_mstate->__pyx_int_49)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_50 = PyLong_FromLong(50); if (unlikely(!__pyx_mstate->__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_51 = PyLong_FromLong(51); if (unlikely(!__pyx_mstate->__pyx_int_51)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_52 = PyLong_FromLong(52); if (unlikely(!__pyx_mstate->__pyx_int_52)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_53 = PyLong_FromLong(53); if (unlikely(!__pyx_mstate->__pyx_int_53)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_54 = PyLong_FromLong(54); if (unlikely(!__pyx_mstate->__pyx_int_54)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_55 = PyLong_FromLong(55); if (unlikely(!__pyx_mstate->__pyx_int_55)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_56 = PyLong_FromLong(56); if (unlikely(!__pyx_mstate->__pyx_int_56)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_57 = PyLong_FromLong(57); if (unlikely(!__pyx_mstate->__pyx_int_57)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_58 = PyLong_FromLong(58); if (unlikely(!__pyx_mstate->__pyx_int_58)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_59 = PyLong_FromLong(59); if (unlikely(!__pyx_mstate->__pyx_int_59)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_60 = PyLong_FromLong(60); if (unlikely(!__pyx_mstate->__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_61 = PyLong_FromLong(61); if (unlikely(!__pyx_mstate->__pyx_int_61)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_62 = PyLong_FromLong(62); if (unlikely(!__pyx_mstate->__pyx_int_62)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_63 = PyLong_FromLong(63); if (unlikely(!__pyx_mstate->__pyx_int_63)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_64 = PyLong_FromLong(64); if (unlikely(!__pyx_mstate->__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_65 = PyLong_FromLong(65); if (unlikely(!__pyx_mstate->__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_66 = PyLong_FromLong(66); if (unlikely(!__pyx_mstate->__pyx_int_66)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_67 = PyLong_FromLong(67); if (unlikely(!__pyx_mstate->__pyx_int_67)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_68 = PyLong_FromLong(68); if (unlikely(!__pyx_mstate->__pyx_int_68)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_69 = PyLong_FromLong(69); if (unlikely(!__pyx_mstate->__pyx_int_69)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_70 = PyLong_FromLong(70); if (unlikely(!__pyx_mstate->__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_71 = PyLong_FromLong(71); if (unlikely(!__pyx_mstate->__pyx_int_71)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_72 = PyLong_FromLong(72); if (unlikely(!__pyx_mstate->__pyx_int_72)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_73 = PyLong_FromLong(73); if (unlikely(!__pyx_mstate->__pyx_int_73)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_74 = PyLong_FromLong(74); if (unlikely(!__pyx_mstate->__pyx_int_74)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_75 = PyLong_FromLong(75); if (unlikely(!__pyx_mstate->__pyx_int_75)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_76 = PyLong_FromLong(76); if (unlikely(!__pyx_mstate->__pyx_int_76)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_77 = PyLong_FromLong(77); if (unlikely(!__pyx_mstate->__pyx_int_77)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_78 = PyLong_FromLong(78); if (unlikely(!__pyx_mstate->__pyx_int_78)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_79 = PyLong_FromLong(79); if (unlikely(!__pyx_mstate->__pyx_int_79)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_80 = PyLong_FromLong(80); if (unlikely(!__pyx_mstate->__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_81 = PyLong_FromLong(81); if (unlikely(!__pyx_mstate->__pyx_int_81)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_82 = PyLong_FromLong(82); if (unlikely(!__pyx_mstate->__pyx_int_82)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_83 = PyLong_FromLong(83); if (unlikely(!__pyx_mstate->__pyx_int_83)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_84 = PyLong_FromLong(84); if (unlikely(!__pyx_mstate->__pyx_int_84)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_85 = PyLong_FromLong(85); if (unlikely(!__pyx_mstate->__pyx_int_85)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_86 = PyLong_FromLong(86); if (unlikely(!__pyx_mstate->__pyx_int_86)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_87 = PyLong_FromLong(87); if (unlikely(!__pyx_mstate->__pyx_int_87)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_88 = PyLong_FromLong(88); if (unlikely(!__pyx_mstate->__pyx_int_88)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_89 = PyLong_FromLong(89); if (unlikely(!__pyx_mstate->__pyx_int_89)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_90 = PyLong_FromLong(90); if (unlikely(!__pyx_mstate->__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_91 = PyLong_FromLong(91); if (unlikely(!__pyx_mstate->__pyx_int_91)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_92 = PyLong_FromLong(92); if (unlikely(!__pyx_mstate->__pyx_int_92)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_93 = PyLong_FromLong(93); if (unlikely(!__pyx_mstate->__pyx_int_93)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_94 = PyLong_FromLong(94); if (unlikely(!__pyx_mstate->__pyx_int_94)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_95 = PyLong_FromLong(95); if (unlikely(!__pyx_mstate->__pyx_int_95)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_96 = PyLong_FromLong(96); if (unlikely(!__pyx_mstate->__pyx_int_96)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_97 = PyLong_FromLong(97); if (unlikely(!__pyx_mstate->__pyx_int_97)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_98 = PyLong_FromLong(98); if (unlikely(!__pyx_mstate->__pyx_int_98)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_99 = PyLong_FromLong(99); if (unlikely(!__pyx_mstate->__pyx_int_99)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_100 = PyLong_FromLong(100); if (unlikely(!__pyx_mstate->__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_101 = PyLong_FromLong(101); if (unlikely(!__pyx_mstate->__pyx_int_101)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_102 = PyLong_FromLong(102); if (unlikely(!__pyx_mstate->__pyx_int_102)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_103 = PyLong_FromLong(103); if (unlikely(!__pyx_mstate->__pyx_int_103)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_104 = PyLong_FromLong(104); if (unlikely(!__pyx_mstate->__pyx_int_104)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_105 = PyLong_FromLong(105); if (unlikely(!__pyx_mstate->__pyx_int_105)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_106 = PyLong_FromLong(106); if (unlikely(!__pyx_mstate->__pyx_int_106)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_107 = PyLong_FromLong(107); if (unlikely(!__pyx_mstate->__pyx_int_107)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_108 = PyLong_FromLong(108); if (unlikely(!__pyx_mstate->__pyx_int_108)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_109 = PyLong_FromLong(109); if (unlikely(!__pyx_mstate->__pyx_int_109)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_110 = PyLong_FromLong(110); if (unlikely(!__pyx_mstate->__pyx_int_110)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_111 = PyLong_FromLong(111); if (unlikely(!__pyx_mstate->__pyx_int_111)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_112 = PyLong_FromLong(112); if (unlikely(!__pyx_mstate->__pyx_int_112)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_113 = PyLong_FromLong(113); if (unlikely(!__pyx_mstate->__pyx_int_113)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_114 = PyLong_FromLong(114); if (unlikely(!__pyx_mstate->__pyx_int_114)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_115 = PyLong_FromLong(115); if (unlikely(!__pyx_mstate->__pyx_int_115)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_116 = PyLong_FromLong(116); if (unlikely(!__pyx_mstate->__pyx_int_116)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_117 = PyLong_FromLong(117); if (unlikely(!__pyx_mstate->__pyx_int_117)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_118 = PyLong_FromLong(118); if (unlikely(!__pyx_mstate->__pyx_int_118)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_119 = PyLong_FromLong(119); if (unlikely(!__pyx_mstate->__pyx_int_119)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_120 = PyLong_FromLong(120); if (unlikely(!__pyx_mstate->__pyx_int_120)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_121 = PyLong_FromLong(121); if (unlikely(!__pyx_mstate->__pyx_int_121)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_122 = PyLong_FromLong(122); if (unlikely(!__pyx_mstate->__pyx_int_122)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_123 = PyLong_FromLong(123); if (unlikely(!__pyx_mstate->__pyx_int_123)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_124 = PyLong_FromLong(124); if (unlikely(!__pyx_mstate->__pyx_int_124)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_125 = PyLong_FromLong(125); if (unlikely(!__pyx_mstate->__pyx_int_125)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_126 = PyLong_FromLong(126); if (unlikely(!__pyx_mstate->__pyx_int_126)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_127 = PyLong_FromLong(127); if (unlikely(!__pyx_mstate->__pyx_int_127)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_128 = PyLong_FromLong(128); if (unlikely(!__pyx_mstate->__pyx_int_128)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_129 = PyLong_FromLong(129); if (unlikely(!__pyx_mstate->__pyx_int_129)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_130 = PyLong_FromLong(130); if (unlikely(!__pyx_mstate->__pyx_int_130)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_131 = PyLong_FromLong(131); if (unlikely(!__pyx_mstate->__pyx_int_131)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_132 = PyLong_FromLong(132); if (unlikely(!__pyx_mstate->__pyx_int_132)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_133 = PyLong_FromLong(133); if (unlikely(!__pyx_mstate->__pyx_int_133)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_134 = PyLong_FromLong(134); if (unlikely(!__pyx_mstate->__pyx_int_134)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_135 = PyLong_FromLong(135); if (unlikely(!__pyx_mstate->__pyx_int_135)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_136 = PyLong_FromLong(136); if (unlikely(!__pyx_mstate->__pyx_int_136)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_137 = PyLong_FromLong(137); if (unlikely(!__pyx_mstate->__pyx_int_137)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_138 = PyLong_FromLong(138); if (unlikely(!__pyx_mstate->__pyx_int_138)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_139 = PyLong_FromLong(139); if (unlikely(!__pyx_mstate->__pyx_int_139)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_140 = PyLong_FromLong(140); if (unlikely(!__pyx_mstate->__pyx_int_140)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_141 = PyLong_FromLong(141); if (unlikely(!__pyx_mstate->__pyx_int_141)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_142 = PyLong_FromLong(142); if (unlikely(!__pyx_mstate->__pyx_int_142)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_143 = PyLong_FromLong(143); if (unlikely(!__pyx_mstate->__pyx_int_143)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_144 = PyLong_FromLong(144); if (unlikely(!__pyx_mstate->__pyx_int_144)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_145 = PyLong_FromLong(145); if (unlikely(!__pyx_mstate->__pyx_int_145)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_146 = PyLong_FromLong(146); if (unlikely(!__pyx_mstate->__pyx_int_146)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_147 = PyLong_FromLong(147); if (unlikely(!__pyx_mstate->__pyx_int_147)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_148 = PyLong_FromLong(148); if (unlikely(!__pyx_mstate->__pyx_int_148)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_149 = PyLong_FromLong(149); if (unlikely(!__pyx_mstate->__pyx_int_149)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_150 = PyLong_FromLong(150); if (unlikely(!__pyx_mstate->__pyx_int_150)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_151 = PyLong_FromLong(151); if (unlikely(!__pyx_mstate->__pyx_int_151)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_152 = PyLong_FromLong(152); if (unlikely(!__pyx_mstate->__pyx_int_152)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_153 = PyLong_FromLong(153); if (unlikely(!__pyx_mstate->__pyx_int_153)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_154 = PyLong_FromLong(154); if (unlikely(!__pyx_mstate->__pyx_int_154)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_155 = PyLong_FromLong(155); if (unlikely(!__pyx_mstate->__pyx_int_155)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_156 = PyLong_FromLong(156); if (unlikely(!__pyx_mstate->__pyx_int_156)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_157 = PyLong_FromLong(157); if (unlikely(!__pyx_mstate->__pyx_int_157)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_158 = PyLong_FromLong(158); if (unlikely(!__pyx_mstate->__pyx_int_158)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_159 = PyLong_FromLong(159); if (unlikely(!__pyx_mstate->__pyx_int_159)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_160 = PyLong_FromLong(160); if (unlikely(!__pyx_mstate->__pyx_int_160)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_161 = PyLong_FromLong(161); if (unlikely(!__pyx_mstate->__pyx_int_161)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_162 = PyLong_FromLong(162); if (unlikely(!__pyx_mstate->__pyx_int_162)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_163 = PyLong_FromLong(163); if (unlikely(!__pyx_mstate->__pyx_int_163)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_164 = PyLong_FromLong(164); if (unlikely(!__pyx_mstate->__pyx_int_164)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_165 = PyLong_FromLong(165); if (unlikely(!__pyx_mstate->__pyx_int_165)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_166 = PyLong_FromLong(166); if (unlikely(!__pyx_mstate->__pyx_int_166)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_167 = PyLong_FromLong(167); if (unlikely(!__pyx_mstate->__pyx_int_167)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_168 = PyLong_FromLong(168); if (unlikely(!__pyx_mstate->__pyx_int_168)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_169 = PyLong_FromLong(169); if (unlikely(!__pyx_mstate->__pyx_int_169)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_170 = PyLong_FromLong(170); if (unlikely(!__pyx_mstate->__pyx_int_170)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_171 = PyLong_FromLong(171); if (unlikely(!__pyx_mstate->__pyx_int_171)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_172 = PyLong_FromLong(172); if (unlikely(!__pyx_mstate->__pyx_int_172)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_173 = PyLong_FromLong(173); if (unlikely(!__pyx_mstate->__pyx_int_173)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_174 = PyLong_FromLong(174); if (unlikely(!__pyx_mstate->__pyx_int_174)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_175 = PyLong_FromLong(175); if (unlikely(!__pyx_mstate->__pyx_int_175)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_176 = PyLong_FromLong(176); if (unlikely(!__pyx_mstate->__pyx_int_176)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_177 = PyLong_FromLong(177); if (unlikely(!__pyx_mstate->__pyx_int_177)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_178 = PyLong_FromLong(178); if (unlikely(!__pyx_mstate->__pyx_int_178)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_179 = PyLong_FromLong(179); if (unlikely(!__pyx_mstate->__pyx_int_179)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_180 = PyLong_FromLong(180); if (unlikely(!__pyx_mstate->__pyx_int_180)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_181 = PyLong_FromLong(181); if (unlikely(!__pyx_mstate->__pyx_int_181)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_182 = PyLong_FromLong(182); if (unlikely(!__pyx_mstate->__pyx_int_182)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_183 = PyLong_FromLong(183); if (unlikely(!__pyx_mstate->__pyx_int_183)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_184 = PyLong_FromLong(184); if (unlikely(!__pyx_mstate->__pyx_int_184)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_185 = PyLong_FromLong(185); if (unlikely(!__pyx_mstate->__pyx_int_185)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_186 = PyLong_FromLong(186); if (unlikely(!__pyx_mstate->__pyx_int_186)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_187 = PyLong_FromLong(187); if (unlikely(!__pyx_mstate->__pyx_int_187)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_188 = PyLong_FromLong(188); if (unlikely(!__pyx_mstate->__pyx_int_188)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_189 = PyLong_FromLong(189); if (unlikely(!__pyx_mstate->__pyx_int_189)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_190 = PyLong_FromLong(190); if (unlikely(!__pyx_mstate->__pyx_int_190)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_191 = PyLong_FromLong(191); if (unlikely(!__pyx_mstate->__pyx_int_191)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_192 = PyLong_FromLong(192); if (unlikely(!__pyx_mstate->__pyx_int_192)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_193 = PyLong_FromLong(193); if (unlikely(!__pyx_mstate->__pyx_int_193)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_194 = PyLong_FromLong(194); if (unlikely(!__pyx_mstate->__pyx_int_194)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_195 = PyLong_FromLong(195); if (unlikely(!__pyx_mstate->__pyx_int_195)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_196 = PyLong_FromLong(196); if (unlikely(!__pyx_mstate->__pyx_int_196)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_197 = PyLong_FromLong(197); if (unlikely(!__pyx_mstate->__pyx_int_197)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_198 = PyLong_FromLong(198); if (unlikely(!__pyx_mstate->__pyx_int_198)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_199 = PyLong_FromLong(199); if (unlikely(!__pyx_mstate->__pyx_int_199)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_200 = PyLong_FromLong(200); if (unlikely(!__pyx_mstate->__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_201 = PyLong_FromLong(201); if (unlikely(!__pyx_mstate->__pyx_int_201)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_202 = PyLong_FromLong(202); if (unlikely(!__pyx_mstate->__pyx_int_202)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_203 = PyLong_FromLong(203); if (unlikely(!__pyx_mstate->__pyx_int_203)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_204 = PyLong_FromLong(204); if (unlikely(!__pyx_mstate->__pyx_int_204)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_205 = PyLong_FromLong(205); if (unlikely(!__pyx_mstate->__pyx_int_205)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_206 = PyLong_FromLong(206); if (unlikely(!__pyx_mstate->__pyx_int_206)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_207 = PyLong_FromLong(207); if (unlikely(!__pyx_mstate->__pyx_int_207)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_208 = PyLong_FromLong(208); if (unlikely(!__pyx_mstate->__pyx_int_208)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_209 = PyLong_FromLong(209); if (unlikely(!__pyx_mstate->__pyx_int_209)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_210 = PyLong_FromLong(210); if (unlikely(!__pyx_mstate->__pyx_int_210)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_211 = PyLong_FromLong(211); if (unlikely(!__pyx_mstate->__pyx_int_211)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_212 = PyLong_FromLong(212); if (unlikely(!__pyx_mstate->__pyx_int_212)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_213 = PyLong_FromLong(213); if (unlikely(!__pyx_mstate->__pyx_int_213)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_214 = PyLong_FromLong(214); if (unlikely(!__pyx_mstate->__pyx_int_214)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_215 = PyLong_FromLong(215); if (unlikely(!__pyx_mstate->__pyx_int_215)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_216 = PyLong_FromLong(216); if (unlikely(!__pyx_mstate->__pyx_int_216)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_217 = PyLong_FromLong(217); if (unlikely(!__pyx_mstate->__pyx_int_217)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_218 = PyLong_FromLong(218); if (unlikely(!__pyx_mstate->__pyx_int_218)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_219 = PyLong_FromLong(219); if (unlikely(!__pyx_mstate->__pyx_int_219)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_220 = PyLong_FromLong(220); if (unlikely(!__pyx_mstate->__pyx_int_220)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_221 = PyLong_FromLong(221); if (unlikely(!__pyx_mstate->__pyx_int_221)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_222 = PyLong_FromLong(222); if (unlikely(!__pyx_mstate->__pyx_int_222)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_223 = PyLong_FromLong(223); if (unlikely(!__pyx_mstate->__pyx_int_223)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_224 = PyLong_FromLong(224); if (unlikely(!__pyx_mstate->__pyx_int_224)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_225 = PyLong_FromLong(225); if (unlikely(!__pyx_mstate->__pyx_int_225)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_226 = PyLong_FromLong(226); if (unlikely(!__pyx_mstate->__pyx_int_226)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_227 = PyLong_FromLong(227); if (unlikely(!__pyx_mstate->__pyx_int_227)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_228 = PyLong_FromLong(228); if (unlikely(!__pyx_mstate->__pyx_int_228)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_229 = PyLong_FromLong(229); if (unlikely(!__pyx_mstate->__pyx_int_229)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_230 = PyLong_FromLong(230); if (unlikely(!__pyx_mstate->__pyx_int_230)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_231 = PyLong_FromLong(231); if (unlikely(!__pyx_mstate->__pyx_int_231)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_232 = PyLong_FromLong(232); if (unlikely(!__pyx_mstate->__pyx_int_232)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_233 = PyLong_FromLong(233); if (unlikely(!__pyx_mstate->__pyx_int_233)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_234 = PyLong_FromLong(234); if (unlikely(!__pyx_mstate->__pyx_int_234)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_235 = PyLong_FromLong(235); if (unlikely(!__pyx_mstate->__pyx_int_235)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_236 = PyLong_FromLong(236); if (unlikely(!__pyx_mstate->__pyx_int_236)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_237 = PyLong_FromLong(237); if (unlikely(!__pyx_mstate->__pyx_int_237)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_238 = PyLong_FromLong(238); if (unlikely(!__pyx_mstate->__pyx_int_238)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_239 = PyLong_FromLong(239); if (unlikely(!__pyx_mstate->__pyx_int_239)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_240 = PyLong_FromLong(240); if (unlikely(!__pyx_mstate->__pyx_int_240)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_241 = PyLong_FromLong(241); if (unlikely(!__pyx_mstate->__pyx_int_241)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_242 = PyLong_FromLong(242); if (unlikely(!__pyx_mstate->__pyx_int_242)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_243 = PyLong_FromLong(243); if (unlikely(!__pyx_mstate->__pyx_int_243)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_244 = PyLong_FromLong(244); if (unlikely(!__pyx_mstate->__pyx_int_244)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_245 = PyLong_FromLong(245); if (unlikely(!__pyx_mstate->__pyx_int_245)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_246 = PyLong_FromLong(246); if (unlikely(!__pyx_mstate->__pyx_int_246)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_247 = PyLong_FromLong(247); if (unlikely(!__pyx_mstate->__pyx_int_247)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_248 = PyLong_FromLong(248); if (unlikely(!__pyx_mstate->__pyx_int_248)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_249 = PyLong_FromLong(249); if (unlikely(!__pyx_mstate->__pyx_int_249)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_250 = PyLong_FromLong(250); if (unlikely(!__pyx_mstate->__pyx_int_250)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_251 = PyLong_FromLong(251); if (unlikely(!__pyx_mstate->__pyx_int_251)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_252 = PyLong_FromLong(252); if (unlikely(!__pyx_mstate->__pyx_int_252)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_253 = PyLong_FromLong(253); if (unlikely(!__pyx_mstate->__pyx_int_253)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_254 = PyLong_FromLong(254); if (unlikely(!__pyx_mstate->__pyx_int_254)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_255 = PyLong_FromLong(255); if (unlikely(!__pyx_mstate->__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_256 = PyLong_FromLong(256); if (unlikely(!__pyx_mstate->__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_257 = PyLong_FromLong(257); if (unlikely(!__pyx_mstate->__pyx_int_257)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_258 = PyLong_FromLong(258); if (unlikely(!__pyx_mstate->__pyx_int_258)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_259 = PyLong_FromLong(259); if (unlikely(!__pyx_mstate->__pyx_int_259)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_260 = PyLong_FromLong(260); if (unlikely(!__pyx_mstate->__pyx_int_260)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_261 = PyLong_FromLong(261); if (unlikely(!__pyx_mstate->__pyx_int_261)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_262 = PyLong_FromLong(262); if (unlikely(!__pyx_mstate->__pyx_int_262)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_263 = PyLong_FromLong(263); if (unlikely(!__pyx_mstate->__pyx_int_263)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_264 = PyLong_FromLong(264); if (unlikely(!__pyx_mstate->__pyx_int_264)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_265 = PyLong_FromLong(265); if (unlikely(!__pyx_mstate->__pyx_int_265)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_266 = PyLong_FromLong(266); if (unlikely(!__pyx_mstate->__pyx_int_266)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_267 = PyLong_FromLong(267); if (unlikely(!__pyx_mstate->__pyx_int_267)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_268 = PyLong_FromLong(268); if (unlikely(!__pyx_mstate->__pyx_int_268)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_269 = PyLong_FromLong(269); if (unlikely(!__pyx_mstate->__pyx_int_269)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_270 = PyLong_FromLong(270); if (unlikely(!__pyx_mstate->__pyx_int_270)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_271 = PyLong_FromLong(271); if (unlikely(!__pyx_mstate->__pyx_int_271)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_272 = PyLong_FromLong(272); if (unlikely(!__pyx_mstate->__pyx_int_272)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_273 = PyLong_FromLong(273); if (unlikely(!__pyx_mstate->__pyx_int_273)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_274 = PyLong_FromLong(274); if (unlikely(!__pyx_mstate->__pyx_int_274)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_275 = PyLong_FromLong(275); if (unlikely(!__pyx_mstate->__pyx_int_275)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_276 = PyLong_FromLong(276); if (unlikely(!__pyx_mstate->__pyx_int_276)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_277 = PyLong_FromLong(277); if (unlikely(!__pyx_mstate->__pyx_int_277)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_278 = PyLong_FromLong(278); if (unlikely(!__pyx_mstate->__pyx_int_278)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_279 = PyLong_FromLong(279); if (unlikely(!__pyx_mstate->__pyx_int_279)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_280 = PyLong_FromLong(280); if (unlikely(!__pyx_mstate->__pyx_int_280)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_281 = PyLong_FromLong(281); if (unlikely(!__pyx_mstate->__pyx_int_281)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_282 = PyLong_FromLong(282); if (unlikely(!__pyx_mstate->__pyx_int_282)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_283 = PyLong_FromLong(283); if (unlikely(!__pyx_mstate->__pyx_int_283)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_284 = PyLong_FromLong(284); if (unlikely(!__pyx_mstate->__pyx_int_284)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_285 = PyLong_FromLong(285); if (unlikely(!__pyx_mstate->__pyx_int_285)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_286 = PyLong_FromLong(286); if (unlikely(!__pyx_mstate->__pyx_int_286)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_287 = PyLong_FromLong(287); if (unlikely(!__pyx_mstate->__pyx_int_287)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_288 = PyLong_FromLong(288); if (unlikely(!__pyx_mstate->__pyx_int_288)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_289 = PyLong_FromLong(289); if (unlikely(!__pyx_mstate->__pyx_int_289)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_290 = PyLong_FromLong(290); if (unlikely(!__pyx_mstate->__pyx_int_290)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_291 = PyLong_FromLong(291); if (unlikely(!__pyx_mstate->__pyx_int_291)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_292 = PyLong_FromLong(292); if (unlikely(!__pyx_mstate->__pyx_int_292)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_293 = PyLong_FromLong(293); if (unlikely(!__pyx_mstate->__pyx_int_293)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_294 = PyLong_FromLong(294); if (unlikely(!__pyx_mstate->__pyx_int_294)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_295 = PyLong_FromLong(295); if (unlikely(!__pyx_mstate->__pyx_int_295)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_296 = PyLong_FromLong(296); if (unlikely(!__pyx_mstate->__pyx_int_296)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_297 = PyLong_FromLong(297); if (unlikely(!__pyx_mstate->__pyx_int_297)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_298 = PyLong_FromLong(298); if (unlikely(!__pyx_mstate->__pyx_int_298)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_299 = PyLong_FromLong(299); if (unlikely(!__pyx_mstate->__pyx_int_299)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_300 = PyLong_FromLong(300); if (unlikely(!__pyx_mstate->__pyx_int_300)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_301 = PyLong_FromLong(301); if (unlikely(!__pyx_mstate->__pyx_int_301)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_302 = PyLong_FromLong(302); if (unlikely(!__pyx_mstate->__pyx_int_302)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_303 = PyLong_FromLong(303); if (unlikely(!__pyx_mstate->__pyx_int_303)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_304 = PyLong_FromLong(304); if (unlikely(!__pyx_mstate->__pyx_int_304)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_305 = PyLong_FromLong(305); if (unlikely(!__pyx_mstate->__pyx_int_305)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_306 = PyLong_FromLong(306); if (unlikely(!__pyx_mstate->__pyx_int_306)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_307 = PyLong_FromLong(307); if (unlikely(!__pyx_mstate->__pyx_int_307)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_308 = PyLong_FromLong(308); if (unlikely(!__pyx_mstate->__pyx_int_308)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_309 = PyLong_FromLong(309); if (unlikely(!__pyx_mstate->__pyx_int_309)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_310 = PyLong_FromLong(310); if (unlikely(!__pyx_mstate->__pyx_int_310)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_311 = PyLong_FromLong(311); if (unlikely(!__pyx_mstate->__pyx_int_311)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_312 = PyLong_FromLong(312); if (unlikely(!__pyx_mstate->__pyx_int_312)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_313 = PyLong_FromLong(313); if (unlikely(!__pyx_mstate->__pyx_int_313)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_314 = PyLong_FromLong(314); if (unlikely(!__pyx_mstate->__pyx_int_314)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_315 = PyLong_FromLong(315); if (unlikely(!__pyx_mstate->__pyx_int_315)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_316 = PyLong_FromLong(316); if (unlikely(!__pyx_mstate->__pyx_int_316)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_317 = PyLong_FromLong(317); if (unlikely(!__pyx_mstate->__pyx_int_317)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_318 = PyLong_FromLong(318); if (unlikely(!__pyx_mstate->__pyx_int_318)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_319 = PyLong_FromLong(319); if (unlikely(!__pyx_mstate->__pyx_int_319)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_320 = PyLong_FromLong(320); if (unlikely(!__pyx_mstate->__pyx_int_320)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_321 = PyLong_FromLong(321); if (unlikely(!__pyx_mstate->__pyx_int_321)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_322 = PyLong_FromLong(322); if (unlikely(!__pyx_mstate->__pyx_int_322)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_323 = PyLong_FromLong(323); if (unlikely(!__pyx_mstate->__pyx_int_323)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_324 = PyLong_FromLong(324); if (unlikely(!__pyx_mstate->__pyx_int_324)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_325 = PyLong_FromLong(325); if (unlikely(!__pyx_mstate->__pyx_int_325)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_326 = PyLong_FromLong(326); if (unlikely(!__pyx_mstate->__pyx_int_326)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_327 = PyLong_FromLong(327); if (unlikely(!__pyx_mstate->__pyx_int_327)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_328 = PyLong_FromLong(328); if (unlikely(!__pyx_mstate->__pyx_int_328)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_329 = PyLong_FromLong(329); if (unlikely(!__pyx_mstate->__pyx_int_329)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_330 = PyLong_FromLong(330); if (unlikely(!__pyx_mstate->__pyx_int_330)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_331 = PyLong_FromLong(331); if (unlikely(!__pyx_mstate->__pyx_int_331)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_332 = PyLong_FromLong(332); if (unlikely(!__pyx_mstate->__pyx_int_332)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_333 = PyLong_FromLong(333); if (unlikely(!__pyx_mstate->__pyx_int_333)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_334 = PyLong_FromLong(334); if (unlikely(!__pyx_mstate->__pyx_int_334)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_335 = PyLong_FromLong(335); if (unlikely(!__pyx_mstate->__pyx_int_335)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_336 = PyLong_FromLong(336); if (unlikely(!__pyx_mstate->__pyx_int_336)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_337 = PyLong_FromLong(337); if (unlikely(!__pyx_mstate->__pyx_int_337)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_338 = PyLong_FromLong(338); if (unlikely(!__pyx_mstate->__pyx_int_338)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_339 = PyLong_FromLong(339); if (unlikely(!__pyx_mstate->__pyx_int_339)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_340 = PyLong_FromLong(340); if (unlikely(!__pyx_mstate->__pyx_int_340)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_341 = PyLong_FromLong(341); if (unlikely(!__pyx_mstate->__pyx_int_341)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_342 = PyLong_FromLong(342); if (unlikely(!__pyx_mstate->__pyx_int_342)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_343 = PyLong_FromLong(343); if (unlikely(!__pyx_mstate->__pyx_int_343)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_344 = PyLong_FromLong(344); if (unlikely(!__pyx_mstate->__pyx_int_344)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_345 = PyLong_FromLong(345); if (unlikely(!__pyx_mstate->__pyx_int_345)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_346 = PyLong_FromLong(346); if (unlikely(!__pyx_mstate->__pyx_int_346)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_347 = PyLong_FromLong(347); if (unlikely(!__pyx_mstate->__pyx_int_347)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_348 = PyLong_FromLong(348); if (unlikely(!__pyx_mstate->__pyx_int_348)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_349 = PyLong_FromLong(349); if (unlikely(!__pyx_mstate->__pyx_int_349)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_350 = PyLong_FromLong(350); if (unlikely(!__pyx_mstate->__pyx_int_350)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_351 = PyLong_FromLong(351); if (unlikely(!__pyx_mstate->__pyx_int_351)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_352 = PyLong_FromLong(352); if (unlikely(!__pyx_mstate->__pyx_int_352)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_353 = PyLong_FromLong(353); if (unlikely(!__pyx_mstate->__pyx_int_353)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_354 = PyLong_FromLong(354); if (unlikely(!__pyx_mstate->__pyx_int_354)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_355 = PyLong_FromLong(355); if (unlikely(!__pyx_mstate->__pyx_int_355)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_356 = PyLong_FromLong(356); if (unlikely(!__pyx_mstate->__pyx_int_356)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_357 = PyLong_FromLong(357); if (unlikely(!__pyx_mstate->__pyx_int_357)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_358 = PyLong_FromLong(358); if (unlikely(!__pyx_mstate->__pyx_int_358)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_359 = PyLong_FromLong(359); if (unlikely(!__pyx_mstate->__pyx_int_359)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_360 = PyLong_FromLong(360); if (unlikely(!__pyx_mstate->__pyx_int_360)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_361 = PyLong_FromLong(361); if (unlikely(!__pyx_mstate->__pyx_int_361)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_362 = PyLong_FromLong(362); if (unlikely(!__pyx_mstate->__pyx_int_362)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_363 = PyLong_FromLong(363); if (unlikely(!__pyx_mstate->__pyx_int_363)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_364 = PyLong_FromLong(364); if (unlikely(!__pyx_mstate->__pyx_int_364)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_365 = PyLong_FromLong(365); if (unlikely(!__pyx_mstate->__pyx_int_365)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_366 = PyLong_FromLong(366); if (unlikely(!__pyx_mstate->__pyx_int_366)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_367 = PyLong_FromLong(367); if (unlikely(!__pyx_mstate->__pyx_int_367)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_368 = PyLong_FromLong(368); if (unlikely(!__pyx_mstate->__pyx_int_368)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_369 = PyLong_FromLong(369); if (unlikely(!__pyx_mstate->__pyx_int_369)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_370 = PyLong_FromLong(370); if (unlikely(!__pyx_mstate->__pyx_int_370)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_371 = PyLong_FromLong(371); if (unlikely(!__pyx_mstate->__pyx_int_371)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_372 = PyLong_FromLong(372); if (unlikely(!__pyx_mstate->__pyx_int_372)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_373 = PyLong_FromLong(373); if (unlikely(!__pyx_mstate->__pyx_int_373)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_374 = PyLong_FromLong(374); if (unlikely(!__pyx_mstate->__pyx_int_374)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_375 = PyLong_FromLong(375); if (unlikely(!__pyx_mstate->__pyx_int_375)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_376 = PyLong_FromLong(376); if (unlikely(!__pyx_mstate->__pyx_int_376)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_377 = PyLong_FromLong(377); if (unlikely(!__pyx_mstate->__pyx_int_377)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_378 = PyLong_FromLong(378); if (unlikely(!__pyx_mstate->__pyx_int_378)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_379 = PyLong_FromLong(379); if (unlikely(!__pyx_mstate->__pyx_int_379)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_380 = PyLong_FromLong(380); if (unlikely(!__pyx_mstate->__pyx_int_380)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_381 = PyLong_FromLong(381); if (unlikely(!__pyx_mstate->__pyx_int_381)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_382 = PyLong_FromLong(382); if (unlikely(!__pyx_mstate->__pyx_int_382)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_383 = PyLong_FromLong(383); if (unlikely(!__pyx_mstate->__pyx_int_383)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_384 = PyLong_FromLong(384); if (unlikely(!__pyx_mstate->__pyx_int_384)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_385 = PyLong_FromLong(385); if (unlikely(!__pyx_mstate->__pyx_int_385)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_386 = PyLong_FromLong(386); if (unlikely(!__pyx_mstate->__pyx_int_386)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_387 = PyLong_FromLong(387); if (unlikely(!__pyx_mstate->__pyx_int_387)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_388 = PyLong_FromLong(388); if (unlikely(!__pyx_mstate->__pyx_int_388)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_389 = PyLong_FromLong(389); if (unlikely(!__pyx_mstate->__pyx_int_389)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_390 = PyLong_FromLong(390); if (unlikely(!__pyx_mstate->__pyx_int_390)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_391 = PyLong_FromLong(391); if (unlikely(!__pyx_mstate->__pyx_int_391)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_392 = PyLong_FromLong(392); if (unlikely(!__pyx_mstate->__pyx_int_392)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_393 = PyLong_FromLong(393); if (unlikely(!__pyx_mstate->__pyx_int_393)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_394 = PyLong_FromLong(394); if (unlikely(!__pyx_mstate->__pyx_int_394)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_395 = PyLong_FromLong(395); if (unlikely(!__pyx_mstate->__pyx_int_395)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_396 = PyLong_FromLong(396); if (unlikely(!__pyx_mstate->__pyx_int_396)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_397 = PyLong_FromLong(397); if (unlikely(!__pyx_mstate->__pyx_int_397)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_398 = PyLong_FromLong(398); if (unlikely(!__pyx_mstate->__pyx_int_398)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_399 = PyLong_FromLong(399); if (unlikely(!__pyx_mstate->__pyx_int_399)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_400 = PyLong_FromLong(400); if (unlikely(!__pyx_mstate->__pyx_int_400)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_401 = PyLong_FromLong(401); if (unlikely(!__pyx_mstate->__pyx_int_401)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_402 = PyLong_FromLong(402); if (unlikely(!__pyx_mstate->__pyx_int_402)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_403 = PyLong_FromLong(403); if (unlikely(!__pyx_mstate->__pyx_int_403)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_404 = PyLong_FromLong(404); if (unlikely(!__pyx_mstate->__pyx_int_404)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_405 = PyLong_FromLong(405); if (unlikely(!__pyx_mstate->__pyx_int_405)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_406 = PyLong_FromLong(406); if (unlikely(!__pyx_mstate->__pyx_int_406)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_407 = PyLong_FromLong(407); if (unlikely(!__pyx_mstate->__pyx_int_407)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_408 = PyLong_FromLong(408); if (unlikely(!__pyx_mstate->__pyx_int_408)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_409 = PyLong_FromLong(409); if (unlikely(!__pyx_mstate->__pyx_int_409)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_410 = PyLong_FromLong(410); if (unlikely(!__pyx_mstate->__pyx_int_410)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_411 = PyLong_FromLong(411); if (unlikely(!__pyx_mstate->__pyx_int_411)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_412 = PyLong_FromLong(412); if (unlikely(!__pyx_mstate->__pyx_int_412)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_413 = PyLong_FromLong(413); if (unlikely(!__pyx_mstate->__pyx_int_413)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_414 = PyLong_FromLong(414); if (unlikely(!__pyx_mstate->__pyx_int_414)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_552 = PyLong_FromLong(552); if (unlikely(!__pyx_mstate->__pyx_int_552)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_887 = PyLong_FromLong(887); if (unlikely(!__pyx_mstate->__pyx_int_887)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_888 = PyLong_FromLong(888); if (unlikely(!__pyx_mstate->__pyx_int_888)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_962 = PyLong_FromLong(962); if (unlikely(!__pyx_mstate->__pyx_int_962)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_1260 = PyLong_FromLong(1260); if (unlikely(!__pyx_mstate->__pyx_int_1260)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_1288 = PyLong_FromLong(1288); if (unlikely(!__pyx_mstate->__pyx_int_1288)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_3552 = PyLong_FromLong(3552); if (unlikely(!__pyx_mstate->__pyx_int_3552)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_4878 = PyLong_FromLong(4878); if (unlikely(!__pyx_mstate->__pyx_int_4878)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_5110 = PyLong_FromLong(5110); if (unlikely(!__pyx_mstate->__pyx_int_5110)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_10000 = PyLong_FromLong(10000L); if (unlikely(!__pyx_mstate->__pyx_int_10000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_11031 = PyLong_FromLong(11031L); if (unlikely(!__pyx_mstate->__pyx_int_11031)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_12846 = PyLong_FromLong(12846L); if (unlikely(!__pyx_mstate->__pyx_int_12846)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_17661 = PyLong_FromLong(17661L); if (unlikely(!__pyx_mstate->__pyx_int_17661)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_19536 = PyLong_FromLong(19536L); if (unlikely(!__pyx_mstate->__pyx_int_19536)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_27436 = PyLong_FromLong(27436L); if (unlikely(!__pyx_mstate->__pyx_int_27436)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_32768 = PyLong_FromLong(32768L); if (unlikely(!__pyx_mstate->__pyx_int_32768)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_85263 = PyLong_FromLong(85263L); if (unlikely(!__pyx_mstate->__pyx_int_85263)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_168030 = PyLong_FromLong(168030L); if (unlikely(!__pyx_mstate->__pyx_int_168030)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_379799 = PyLong_FromLong(379799L); if (unlikely(!__pyx_mstate->__pyx_int_379799)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_1008906 = PyLong_FromLong(1008906L); if (unlikely(!__pyx_mstate->__pyx_int_1008906)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_60959262 = PyLong_FromLong(60959262L); if (unlikely(!__pyx_mstate->__pyx_int_60959262)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_64961464 = PyLong_FromLong(64961464L); if (unlikely(!__pyx_mstate->__pyx_int_64961464)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_94173347 = PyLong_FromLong(94173347L); if (unlikely(!__pyx_mstate->__pyx_int_94173347)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_neg_1 = PyLong_FromLong(-1); if (unlikely(!__pyx_mstate->__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_neg_3 = PyLong_FromLong(-3); if (unlikely(!__pyx_mstate->__pyx_int_neg_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
\
        typedef struct {
            unsigned int argcount : 4;
            unsigned int num_posonly_args : 1;
            unsigned int num_kwonly_args : 1;
            unsigned int nlocals : 5;
            unsigned int flags : 10;
            unsigned int first_line : 12;
            unsigned int line_table_length : 15;
        } __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 375, 67};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_l};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_format_explain_list, __pyx_k_s_3c_t1A_1_E_QfARq_E_QfARq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 551, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1393, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c_2};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 2466, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2591, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_subgroup};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_index, __pyx_k_5_1Jc_1HAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 100, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_g};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__42, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 434, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__43, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 636, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__44, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 31, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_elt};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_is_GapElement, __pyx_k_Qe1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 34, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_elt};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_is_MagmaElement, __pyx_k_Qe1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85, 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_format_str};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_valid_index, __pyx_k_uARq_j_Ba, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 109, 49};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_3hc_G1_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 121, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_to_str, __pyx_k_1G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 125, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_bytearray_to_bytes, __pyx_k_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 129, 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_to_byte_str, __pyx_k_1G1L_AS_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 159, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_old};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_set_test_flag, __pyx_k_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 186, 25};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_SnapPea_interrupt, __pyx_k_q_A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 256, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_cy_eval, __pyx_k_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 260, 247};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_zeros, __pyx_mstate->__pyx_n_u_nonzeros, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_smith_form, __pyx_k_q_4was_1A_4q_d_6_az_4z_Q_aq_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 306, 7};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_check_SnapPea_memory, __pyx_k__45, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 310, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_seed};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_set_rand_seed, __pyx_k__46, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 367, 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_explain_rows, __pyx_mstate->__pyx_n_u_explain_columns};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_Ja_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 373, 60};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_type_str, __pyx_mstate->__pyx_n_u_format_explain_list, __pyx_mstate->__pyx_n_u_format_explain_list};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_q_E_at86_1_a_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 396, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_explain_rows, __pyx_mstate->__pyx_n_u_explain_columns};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_iq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 400, 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_Yaq_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 503, 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_content, __pyx_mstate->__pyx_n_u_old, __pyx_mstate->__pyx_n_u_new_2};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_aq_E_JfA_q_waq_QfE_1_IWAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 514, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_args};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_immutable, __pyx_k_A_nAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 517, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_keys, __pyx_k_A_t9E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 526, 68};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_4q_xs_XT_D_XT_A_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 543, 24};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_X_j_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 550, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_StrLongestLen, __pyx_k_3as_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 572, 149};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lenStr, __pyx_mstate->__pyx_n_u_absImag};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_2T_Q_Qd_a_82Q_t7_s_A_l_A_7_Q_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 600, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_t1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 605, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_orient, __pyx_mstate->__pyx_n_u_sided};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_6a_t_31_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 612, 92};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_base, __pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_3avRr_WCt1A_6a_z_a_q_t5_4q_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 623, 33};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_t2V5_as_e7_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 629, 155};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_a_2, __pyx_mstate->__pyx_n_u_b_2, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_d_2, __pyx_mstate->__pyx_n_u_w0, __pyx_mstate->__pyx_n_u_w1, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_format_two_by_two, __pyx_k_b_auBb_E_Qb_Cq_c_D_1Ba_AS_S_AS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 641, 23};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cusp_images, __pyx_mstate->__pyx_n_u_cusp_maps, __pyx_mstate->__pyx_n_u_extends_to_link};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_O4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 645, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_cusp_images, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 648, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_cusp_maps, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 651, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_extends_to_link, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 654, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_num_cusps, __pyx_k_A_s_4_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 657, 204};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_images, __pyx_mstate->__pyx_n_u_maps, __pyx_mstate->__pyx_n_u_line0, __pyx_mstate->__pyx_n_u_line1, __pyx_mstate->__pyx_n_u_line2, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_l0, __pyx_mstate->__pyx_n_u_l1, __pyx_mstate->__pyx_n_u_l2, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_line3, __pyx_mstate->__pyx_n_u_l};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_t_Q_whd_a_E_at_Q_Cs_at1A_1Cq_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 697, 198};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_LE, __pyx_mstate->__pyx_n_u_manifold, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_klp};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_plink_callback_2, __pyx_k_A_r_3a_oQa_r_t3a_l_1_T_Cs_AZxr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 723, 156};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_T, __pyx_mstate->__pyx_n_u_recompute, __pyx_mstate->__pyx_n_u_manifold_class_2, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_M};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_Manifold_from_Triangulation, __pyx_k_1_q_O3j_aq_q_A_q_aq_1_q_1A_Q_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 749, 94};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_T};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_basic_pyx, __pyx_mstate->__pyx_n_u_Triangulation_from_Manifold, __pyx_k_q_A_1A_aq_1_AQ_Yaq_Q__AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 279, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_remove_finite_vertices};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_get_from_link_data, __pyx_k_q_4_1_at1_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 314, 60};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_remove_finite_vertices_2, __pyx_k_A_4_1_q_A_8_at1_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 334, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_cover_info, __pyx_k_A_4q_4q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 343, 108};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_L};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_plink, __pyx_k_A_4t7_7_wa_1D_G1_1_D_vU_U_4q_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 369, 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_link, __pyx_k_A_4y_q_U_4q_G1_XRt81F_Q_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 387, 76};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cusp_type};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_num_cusps, __pyx_k_A_S_Q_s_1D_s_at1_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 406, 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_num_fake_cusps, __pyx_k_A_1D_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 422, 107};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cover_c_triangulation, __pyx_mstate->__pyx_n_u_new_tri};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_orientation_cover, __pyx_k_A_4_Q_AQ_6a_AT_j_1A_y_U_Rq_e1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 451, 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_orientability};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_is_orientable, __pyx_k_q_Q_7q_A_A_1_A_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 466, 74};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_copy_c_triangulation, __pyx_mstate->__pyx_n_u_new_tri};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_k_A_6Q_4_1_4z_4_1_j_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 483, 54};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_blowup_multiple, __pyx_mstate->__pyx_n_u_passes_at_fours};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_randomize, __pyx_k_1_4_1_AT1CCTTU_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 497, 47};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_passes_at_fours};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_simplify, __pyx_k_q4_4_1_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 528, 123};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tet_num, __pyx_mstate->__pyx_n_u_face_index, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_tet, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_two_to_three, __pyx_k_A_Kq_T_Kq_d_E_aq_Q_Qe3at_1_7_Q_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 563, 154};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tet_num, __pyx_mstate->__pyx_n_u_edge_index, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_tet, __pyx_mstate->__pyx_n_u_where_to_resume, __pyx_mstate->__pyx_n_u__21, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_three_to_two, __pyx_k_A6_Kq_T_Kq_d_E_aq_Q_3k_G3a_1_Qc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 614, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_with_hyperbolic_structure, __pyx_k_A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 626, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_polish_hyperbolic_structures, __pyx_k_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 633, 95};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_savefile, __pyx_mstate->__pyx_n_u_filename};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_empty_save, __pyx_k_A_1_A_U_66Gq_A_5_A_t1_q_81_a_E_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 653, 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_file_name, __pyx_mstate->__pyx_n_u_b_file_name};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_save, __pyx_k_Q_4_1_AQ_S_A_Qa_q_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 677, 61};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_string, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_to_string, __pyx_k_A_4_1_AQ_q_A_AQ_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 699, 75};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_string, __pyx_mstate->__pyx_n_u_remove_finite_vertices, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_b_string};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_from_string, __pyx_k_1_4_q_AQ_aq_8_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 723, 253};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_terse, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_byte, __pyx_mstate->__pyx_n_u_byteseq, __pyx_mstate->__pyx_n_u_bit, __pyx_mstate->__pyx_n_u_c_2};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_to_bytes, __pyx_k_A_4_1_AQ_6_Ba_D_T_1_AQ_at1_1AWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 761, 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bytestring, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_c_triangulation};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_from_bytes, __pyx_k_A_1_4_q_AQ_2_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 780, 66};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bytestring, __pyx_mstate->__pyx_n_u_remove_finite_vertices, __pyx_mstate->__pyx_n_u_c_triangulation};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_from_pickle, __pyx_k_a_1_4_q_AQ_0_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 791, 91};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tetrahedra_data, __pyx_mstate->__pyx_n_u_num_or_cusps, __pyx_mstate->__pyx_n_u_num_nonor_cusps, __pyx_mstate->__pyx_n_u_cusp_indices, __pyx_mstate->__pyx_n_u_peripheral_curves, __pyx_mstate->__pyx_n_u_remove_finite_vertices, __pyx_mstate->__pyx_n_u_c_triangulation};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_from_tetrahedra_gluing_data, __pyx_k_A23562378_J_1_4_q_AQ_31A45454545, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 845, 143};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isosig, __pyx_mstate->__pyx_n_u_remove_finite_vertices, __pyx_mstate->__pyx_n_u_match, __pyx_mstate->__pyx_n_u_decoration};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_from_isosig, __pyx_k_4_q_AQ_6_1_M_gQ_fAQ_4AV7_1_4_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 888, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_k_AB_M_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 923, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_pickle_2, __pyx_k_A_q_A_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 932, 134};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_permutation, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_num};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_reindex_cusps, __pyx_k_A_j_4_1_AQ_S_c_S_1M_Cq_Qa_AQ_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 958, 201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_result_cusp_indices, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_result_curves, __pyx_mstate->__pyx_n_u_data_ijk, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_get_cusp_indices_and_peripheral, __pyx_k_A_Qd_4AQ_a_E_at_4_aq_uE_waq_E_at, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 980, 135};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_neighbors, __pyx_mstate->__pyx_n_u_perms, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_k};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_get_tetrahedra_gluing_data, __pyx_k_A_Qd_4AQ_G9D_ar_U_q_AQd_1BgQb_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 995, 104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other, __pyx_mstate->__pyx_n_u_isometries, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_isomorphisms_to, __pyx_k_A_4_5_50A_A_AQ_1D_Q_Ql_Q_Q_Qa_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1033, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_isomorphisms_to_2, __pyx_k_A_t_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1081, 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_name, __pyx_k_a_4_1_vQ_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1093, 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_new_name, __pyx_mstate->__pyx_n_u_b_new_name, __pyx_mstate->__pyx_n_u_c_new_name};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_set_name_2, __pyx_k_4_1_AQ_at_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1108, 115};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_flips, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_DT_code, __pyx_k_M_A_6_A_1_1G_Q_8_XQa_1_5_q_wfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1140, 44};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_code, __pyx_mstate->__pyx_n_u_lazy};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_set_DTcode, __pyx_k_Q_4uD_JavZq_XQa_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1145, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_code};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_set_PDcode, __pyx_k_A_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1148, 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_num_tetrahedra, __pyx_k_4_1_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1160, 282};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filling_data, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_num_cusps, __pyx_mstate->__pyx_n_u_meridian, __pyx_mstate->__pyx_n_u_longitude, __pyx_mstate->__pyx_n_u_complete_2, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_fill};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_dehn_fill, __pyx_k_1_D_4_1_AQ_D_gQ_A_A_l_Rt_S_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1230, 230};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data_spec, __pyx_mstate->__pyx_n_u_cusp_index, __pyx_mstate->__pyx_n_u_topology, __pyx_mstate->__pyx_n_u_is_complete, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_initial_shape, __pyx_mstate->__pyx_n_u_current_shape, __pyx_mstate->__pyx_n_u_initial_shape_accuracy, __pyx_mstate->__pyx_n_u_current_shape_accuracy, __pyx_mstate->__pyx_n_u_initial_modulus, __pyx_mstate->__pyx_n_u_current_modulus, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_c_2};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_cusp_info, __pyx_k_4_1_AQ_S_4z_uE_j_Qk_1AQk_U_j_t, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1286, 49};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_reverse_orientation, __pyx_k_Q_4t_AQ_Q_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1303, 300};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cusps_to_fill, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_c_filled_tri, __pyx_mstate->__pyx_n_u_filled_tri, __pyx_mstate->__pyx_n_u_fill_cusp_spec, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_fill_all, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_filled_triangulation, __pyx_k_A_4_1_AQ_D_A_ARt5_Qc_4DATI_6_Bb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1353, 257};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_method, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_c_new_tri, __pyx_mstate->__pyx_n_u_filled_tri, __pyx_mstate->__pyx_n_u_fill_cusp_spec, __pyx_mstate->__pyx_n_u_fill_by_fold, __pyx_mstate->__pyx_n_u_mark_solid_tori, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_unsimplified_filled_triangulati_2, __pyx_k_8_J_4_1_AQ_D_1_AQ_q_7_Q_1_Cq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1425, 93};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_clear_marks, __pyx_mstate->__pyx_n_u_marked, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_ans, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_marked_tetrahedra, __pyx_k_Q_1_D_q_vQaq_q_6a_avQc_U_q_AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1436, 101};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_ans};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_edge_valences, __pyx_k_A_a_4_1_AQ_4_9_Cr_AT_3a_r_1_1E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1457, 558};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_equation_type, __pyx_mstate->__pyx_n_u_c_matrix, __pyx_mstate->__pyx_n_u_equations, __pyx_mstate->__pyx_n_u_explain_rows, __pyx_mstate->__pyx_n_u_explain_cols, __pyx_mstate->__pyx_n_u_eqns, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_cusp_info, __pyx_mstate->__pyx_n_u_to_do, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_gluing_equations_pgl, __pyx_k_7qj_2Rr_Bb_AQ_a_AQ_4_1_AQ_A_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1637, 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_vars};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_equations_identified_fa, __pyx_k_A_4_1_AQ_Qd_5Q_1_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1664, 190};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_obstruction_class, __pyx_mstate->__pyx_n_u_c_vars, __pyx_mstate->__pyx_n_u_c_obstruction_class, __pyx_mstate->__pyx_n_u_T, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_c_2};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_equations_identified_co, __pyx_k_AFG_2Rr_Bb_AQ_4_1_AQ_1_4q_r_2S_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1699, 75};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_c_matrix, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_explain_rows, __pyx_mstate->__pyx_n_u_explain_cols};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_equations_action_by_dec, __pyx_k_A_4_1_AQ_Qd_9_AQ_Gq_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1723, 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_matrix, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_explain_rows, __pyx_mstate->__pyx_n_u_explain_cols};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_equations_boundary_map, __pyx_k_A_4_1_AQ_Qd_AT1C1A_Gq_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1752, 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_matrix, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_explain_rows, __pyx_mstate->__pyx_n_u_explain_cols};
    __pyx_mstate_global->__pyx_codeobj_tab[96] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_equations_boundary_map_2, __pyx_k_A_4_1_AQ_Qd_AT1C1A_Gq_s_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[96])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1773, 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_matrix, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_explain_rows, __pyx_mstate->__pyx_n_u_explain_cols};
    __pyx_mstate_global->__pyx_codeobj_tab[97] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_equations_boundary_map_3, __pyx_k_A_4_1_AQ_Qd_AT1C1A_Gq_s_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[97])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1796, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[98] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_obstruction_classes, __pyx_k_Ax_EQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[98])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1858, 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[99] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_generalized_obstruction, __pyx_k_Az_Na_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[99])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1923, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_obstruction_class, __pyx_mstate->__pyx_n_u_simplify, __pyx_mstate->__pyx_n_u_eliminate_fixed_ptolemys};
    __pyx_mstate_global->__pyx_codeobj_tab[100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_ptolemy_variety, __pyx_k_5Q_DAf_9_Q_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2108, 416};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_form, __pyx_mstate->__pyx_n_u_c_eqns, __pyx_mstate->__pyx_n_u_num_rows, __pyx_mstate->__pyx_n_u_num_cols, __pyx_mstate->__pyx_n_u_eqn, __pyx_mstate->__pyx_n_u_eqns, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_cusp_info, __pyx_mstate->__pyx_n_u_to_do, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_rect, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_a_2, __pyx_mstate->__pyx_n_u_b_2, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_gluing_equations, __pyx_k_1Z_4_1_AQ_Qd_z_r_6_AS_E_aq_U_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2271, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_presentation_matrix, __pyx_k_A_t, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2311, 165};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_H, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_coefficient_list, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_homology, __pyx_k_4wgQa_4_1_q_HAT_2S_q_1_y_q_aq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2346, 110};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_simplify_presentation, __pyx_mstate->__pyx_n_u_fillings_may_affect_generators, __pyx_mstate->__pyx_n_u_minimize_number_of_generators, __pyx_mstate->__pyx_n_u_try_hard_to_shorten_relators, __pyx_mstate->__pyx_n_u_args};
    __pyx_mstate_global->__pyx_codeobj_tab[104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_fundamental_group, __pyx_k_A_1_4A_31_2_4_1_AQ_q_q_4wgQ_A_t7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2395, 548};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_permutation_rep, __pyx_mstate->__pyx_n_u_c_representation, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_cover, __pyx_mstate->__pyx_n_u_GG, __pyx_mstate->__pyx_n_u_coset_action, __pyx_mstate->__pyx_n_u_gap_image_gens, __pyx_mstate->__pyx_n_u_Q_2, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_input_type, __pyx_mstate->__pyx_n_u_G, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_perm, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_cover, __pyx_k_4_1_AQ_1_AQ_4A_AT_31_2_7q_r9K1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2497, 203};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_method, __pyx_mstate->__pyx_n_u_cover_type};
    __pyx_mstate_global->__pyx_codeobj_tab[106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_covers, __pyx_k_A_A_a_H_7_A_AQ_4_1_AQ_hj_AQ_7_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2564, 297};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_num_threads, __pyx_mstate->__pyx_n_u_G, __pyx_mstate->__pyx_n_u_relators, __pyx_mstate->__pyx_n_u_short_relators, __pyx_mstate->__pyx_n_u_long_relators, __pyx_mstate->__pyx_n_u_strategy, __pyx_mstate->__pyx_n_u_reps, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_covers, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_rel, __pyx_mstate->__pyx_n_u_rel, __pyx_mstate->__pyx_n_u_H};
    __pyx_mstate_global->__pyx_codeobj_tab[107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_covers_low_index, __pyx_k_4A_D_6_9A_A_A_1_1_s_81D_1AQ_d_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2599, 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_G, __pyx_mstate->__pyx_n_u_covers, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_H};
    __pyx_mstate_global->__pyx_codeobj_tab[108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_covers_gap, __pyx_k_A_4q_1_Cq_a_fAQ_e1_5Qa_QfAS_1_Cu, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[108])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2614, 106};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_G, __pyx_mstate->__pyx_n_u_covers, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_H};
    __pyx_mstate_global->__pyx_codeobj_tab[109] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_covers_magma, __pyx_k_A_4q_1_E_fAQ_e1_aq_7q_CuIQa_Yaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[109])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2629, 210};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_cover_type, __pyx_mstate->__pyx_n_u_reps, __pyx_mstate->__pyx_n_u_rep, __pyx_mstate->__pyx_n_u_cover, __pyx_mstate->__pyx_n_u_T, __pyx_mstate->__pyx_n_u_c_cover_type, __pyx_mstate->__pyx_n_u_covers, __pyx_mstate->__pyx_n_u_cover_count, __pyx_mstate->__pyx_n_u_info};
    __pyx_mstate_global->__pyx_codeobj_tab[110] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_covers_snappea, __pyx_k_A_c_1_1_1_d_a_d_Q_O1D_Jaq__A_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[110])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2776, 1125};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_peripheral_data, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_return_matrices, __pyx_mstate->__pyx_n_u_a_2, __pyx_mstate->__pyx_n_u_b_2, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_d_2, __pyx_mstate->__pyx_n_u_matrices, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_cobs, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_meridian, __pyx_mstate->__pyx_n_u_longitude, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_basis};
    __pyx_mstate_global->__pyx_codeobj_tab[111] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_set_peripheral_curves, __pyx_k_A_q_4_1_AQ_gQ_A_D_G6_3a_j_q_A_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[111])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2911, 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[112] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_has_finite_vertices, __pyx_k_Q_4_1_1_1D_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[112])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2938, 181};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_decorated, __pyx_mstate->__pyx_n_u_ignore_cusp_ordering, __pyx_mstate->__pyx_n_u_ignore_curves, __pyx_mstate->__pyx_n_u_ignore_curve_orientations, __pyx_mstate->__pyx_n_u_ignore_filling_orientations, __pyx_mstate->__pyx_n_u_ignore_orientation, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[113] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_triangulation_isosig, __pyx_k_A_0_4_1_4A9_B_29_x_4_1_AQ_4wgQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[113])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3222, 68};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ignore_orientation, __pyx_mstate->__pyx_n_u_c_string};
    __pyx_mstate_global->__pyx_codeobj_tab[114] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_undecorated_triangulation_isosi, __pyx_k_A_FjPQ_4_1_AQ_0_a_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[114])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3235, 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_u, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[115] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_symplectic_form, __pyx_k_A_s_1AQb_Rq_2Rr_Baq_Bb_2Qar_3d_u, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[115])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3238, 127};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_omega};
    __pyx_mstate_global->__pyx_codeobj_tab[116] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_is_symplectic, __pyx_k_A_Cq_E_aq_U_3a_1D_1_1D_2Rr_Bd_Bb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[116])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3258, 424};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_verify, __pyx_mstate->__pyx_n_u_c_eqns, __pyx_mstate->__pyx_n_u_g_eqns, __pyx_mstate->__pyx_n_u_num_rows, __pyx_mstate->__pyx_n_u_num_cols, __pyx_mstate->__pyx_n_u_dual_rows, __pyx_mstate->__pyx_n_u_eqn, __pyx_mstate->__pyx_n_u_eqns, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_cusp_info, __pyx_mstate->__pyx_n_u_to_do, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_retval, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[117] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_triangulation_pyx, __pyx_mstate->__pyx_n_u_symplectic_basis, __pyx_k_q_4_1_AQ_4z_Ba_A_ggnnooss_q_a_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[117])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[118] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_number_2, __pyx_k_A_v_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[118])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 89, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_func_2};
    __pyx_mstate_global->__pyx_codeobj_tab[119] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_use_field_conversion, __pyx_k_A_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[119])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137, 60};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_force_recompute};
    __pyx_mstate_global->__pyx_codeobj_tab[120] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_init_hyperbolic_structure, __pyx_k_4t1_4_1_T_4q_q_A_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[120])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 146, 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[121] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_canonize, __pyx_k_q_A_Qhc_aq_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[121])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 170, 289};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_opacities, __pyx_mstate->__pyx_n_u_top_level_tries, __pyx_mstate->__pyx_n_u_c_opacities, __pyx_mstate->__pyx_n_u_c_retriangulated_triangulation, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_new_tri, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_success};
    __pyx_mstate_global->__pyx_codeobj_tab[122] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_canonical_retriangulation, __pyx_k_33I_H_q_A_4_1_1_1_t3a_Rr_iq_V1B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[122])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 249, 55};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_M};
    __pyx_mstate_global->__pyx_codeobj_tab[123] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_canonical_cells_are_tetrahedra, __pyx_k_A_D_Q_1_1AQ_5S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[123])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 267, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_string, __pyx_mstate->__pyx_n_u_initialize_structure};
    __pyx_mstate_global->__pyx_codeobj_tab[124] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_from_string, __pyx_k_8_6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[124])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 283, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bytestring, __pyx_mstate->__pyx_n_u_initialize_structure};
    __pyx_mstate_global->__pyx_codeobj_tab[125] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_from_bytes, __pyx_k_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[125])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 297, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isosig, __pyx_mstate->__pyx_n_u_initialize_structure};
    __pyx_mstate_global->__pyx_codeobj_tab[126] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_from_isosig, __pyx_k_8_6_4_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[126])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 308, 48};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_empty};
    __pyx_mstate_global->__pyx_codeobj_tab[127] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_k_A_Jaq_4_1_1_6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[127])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 320, 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[128] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_cusp_neighborhood, __pyx_k_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[128])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 336, 99};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vertex_epsilon, __pyx_mstate->__pyx_n_u_displacement, __pyx_mstate->__pyx_n_u_centroid_at_origin, __pyx_mstate->__pyx_n_u_maximize_injectivity_radius, __pyx_mstate->__pyx_n_u_include_words, __pyx_mstate->__pyx_n_u_args};
    __pyx_mstate_global->__pyx_codeobj_tab[129] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_dirichlet_domain, __pyx_k_A_e1_5Q7_a_0_F_QoQ_Q_4wgQ_1_t7_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[129])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 386, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[130] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_browse, __pyx_k_A_83a_aq_waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[130])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 402, 52};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cusps_to_fill, __pyx_mstate->__pyx_n_u_filled_2};
    __pyx_mstate_global->__pyx_codeobj_tab[131] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_filled_triangulation, __pyx_k_A_6_6_3c_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[131])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 430, 115};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_simplify_presentation, __pyx_mstate->__pyx_n_u_fillings_may_affect_generators, __pyx_mstate->__pyx_n_u_minimize_number_of_generators, __pyx_mstate->__pyx_n_u_try_hard_to_shorten_relators, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[132] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_fundamental_group, __pyx_k_A_1_4A_31_2_B_4_1_AQ_q_q_4wgQ_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[132])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 482, 234};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_of_link, __pyx_mstate->__pyx_n_u_symmetries_of_manifold, __pyx_mstate->__pyx_n_u_symmetries_of_link, __pyx_mstate->__pyx_n_u_c_symmetric_triangulation, __pyx_mstate->__pyx_n_u_symmetric_triangulation, __pyx_mstate->__pyx_n_u_is_full_group, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_symmetry_group};
    __pyx_mstate_global->__pyx_codeobj_tab[133] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_symmetry_group, __pyx_k_wj_8q_31_4_1_AQ_4wgQ_8_q_A_7_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[133])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 528, 43};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[134] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_symmetric_triangulation, __pyx_k_A_4wgQa_q_4wgQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[134])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 549, 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_permutation_rep, __pyx_mstate->__pyx_n_u_cover};
    __pyx_mstate_global->__pyx_codeobj_tab[135] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_cover, __pyx_k_B_V1F_7_A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[135])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 618, 68};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_method, __pyx_mstate->__pyx_n_u_cover_type, __pyx_mstate->__pyx_n_u_covers, __pyx_mstate->__pyx_n_u_cover};
    __pyx_mstate_global->__pyx_codeobj_tab[136] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_covers, __pyx_k_A_A_H_gQfHG1_q_1A_6a_4q_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[136])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 714, 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_volume, __pyx_mstate->__pyx_n_u_accuracy, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[137] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_complex_volume_2, __pyx_k_A_5_4z_q_vV2Q_1A_a_T_c_N_Q_1_RvQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[137])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 728, 99};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_accuracy, __pyx_mstate->__pyx_n_u_verified, __pyx_mstate->__pyx_n_u_bits_prec, __pyx_mstate->__pyx_n_u_vol};
    __pyx_mstate_global->__pyx_codeobj_tab[138] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_volume, __pyx_k_00C1_9Cq_q_j_6_iz_1_d_q_1_D_1_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[138])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 821, 48};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_accuracy, __pyx_mstate->__pyx_n_u_cs};
    __pyx_mstate_global->__pyx_codeobj_tab[139] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_chern_simons, __pyx_k_aH_T_q_1_D_r_4y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[139])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 863, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[140] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_without_hyperbolic_structure, __pyx_k_A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[140])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 875, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[141] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_polish_hyperbolic_structures, __pyx_k_A_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[141])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 26, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 878, 667};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_part, __pyx_mstate->__pyx_n_u_fixed_alignment, __pyx_mstate->__pyx_n_u_bits_prec, __pyx_mstate->__pyx_n_u_dec_prec, __pyx_mstate->__pyx_n_u_intervals, __pyx_mstate->__pyx_n_u_rect_re, __pyx_mstate->__pyx_n_u_rect_im, __pyx_mstate->__pyx_n_u_log_re, __pyx_mstate->__pyx_n_u_log_im, __pyx_mstate->__pyx_n_u_acc_rec_re, __pyx_mstate->__pyx_n_u_acc_rec_im, __pyx_mstate->__pyx_n_u_acc_log_re, __pyx_mstate->__pyx_n_u_acc_log_im, __pyx_mstate->__pyx_n_u_is_geometric, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_shapes, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_rect_shape, __pyx_mstate->__pyx_n_u_log_shape, __pyx_mstate->__pyx_n_u_engine, __pyx_mstate->__pyx_n_u_a_2, __pyx_mstate->__pyx_n_u_a_2, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_a_2};
    __pyx_mstate_global->__pyx_codeobj_tab[142] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_tetrahedra_shapes, __pyx_k_1_31_B_4_1_1_4t_E_3is_T_2_q_A_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[142])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 997, 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_solution, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_rect_re, __pyx_mstate->__pyx_n_u_rect_im, __pyx_mstate->__pyx_n_u_log_re, __pyx_mstate->__pyx_n_u_log_im, __pyx_mstate->__pyx_n_u_acc_rec_re, __pyx_mstate->__pyx_n_u_acc_rec_im, __pyx_mstate->__pyx_n_u_acc_log_re, __pyx_mstate->__pyx_n_u_acc_log_im, __pyx_mstate->__pyx_n_u_is_geometric, __pyx_mstate->__pyx_n_u_soln, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[143] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_get_tetrahedra_shapes, __pyx_k_A_Q_1_Cq_1_AQ_E_at_0_6_9AYaxq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[143])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1025, 262};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filled_shapes, __pyx_mstate->__pyx_n_u_complete_shapes, __pyx_mstate->__pyx_n_u_fillings, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_filled_shape_array, __pyx_mstate->__pyx_n_u_complete_shape_array, __pyx_mstate->__pyx_n_u_shape};
    __pyx_mstate_global->__pyx_codeobj_tab[144] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_set_tetrahedra_shapes, __pyx_k_A_1_Q_4_1_AQ_at1_F_1AQ_9IQa_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[144])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1063, 60};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_enum, __pyx_mstate->__pyx_n_u_solution_type};
    __pyx_mstate_global->__pyx_codeobj_tab[145] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_solution_type, __pyx_k_T_4_1_AQ_0_Q_1_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[145])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1113, 34};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_target, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_recompute, __pyx_mstate->__pyx_n_u_c_target};
    __pyx_mstate_global->__pyx_codeobj_tab[146] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_set_target_holonomy, __pyx_k_5_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[146])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 30, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1128, 506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data_spec, __pyx_mstate->__pyx_n_u_verified, __pyx_mstate->__pyx_n_u_bits_prec, __pyx_mstate->__pyx_n_u_cusp_index, __pyx_mstate->__pyx_n_u_topology, __pyx_mstate->__pyx_n_u_is_complete, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_initial_shape, __pyx_mstate->__pyx_n_u_current_shape, __pyx_mstate->__pyx_n_u_initial_shape_accuracy, __pyx_mstate->__pyx_n_u_current_shape_accuracy, __pyx_mstate->__pyx_n_u_initial_modulus, __pyx_mstate->__pyx_n_u_current_modulus, __pyx_mstate->__pyx_n_u_meridian_accuracy, __pyx_mstate->__pyx_n_u_longitude_accuracy, __pyx_mstate->__pyx_n_u_singularity_index, __pyx_mstate->__pyx_n_u_accuracy, __pyx_mstate->__pyx_n_u_c_meridian, __pyx_mstate->__pyx_n_u_c_longitude, __pyx_mstate->__pyx_n_u_c_core_length, __pyx_mstate->__pyx_n_u_shape, __pyx_mstate->__pyx_n_u_meridian, __pyx_mstate->__pyx_n_u_longitude, __pyx_mstate->__pyx_n_u_modulus, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_core_length, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_c_2};
    __pyx_mstate_global->__pyx_codeobj_tab[147] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_cusp_info, __pyx_k_33Faz_4_1_AQ_9Cq_t_S_iq_AV_a_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[147])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1251, 45};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filling_data, __pyx_mstate->__pyx_n_u_which_cusp};
    __pyx_mstate_global->__pyx_codeobj_tab[148] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_dehn_fill, __pyx_k_1_D_Zq_nA_q_A_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[148])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1289, 512};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_peripheral_data, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_return_matrices, __pyx_mstate->__pyx_n_u_d_2, __pyx_mstate->__pyx_n_u_matrices, __pyx_mstate->__pyx_n_u_cusps, __pyx_mstate->__pyx_n_u_cobs, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[149] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_set_peripheral_curves, __pyx_k_A_qt_4_1_AQ_gQ_A_D_G6_3a_A__4E_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[149])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1403, 169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_segments, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_num_curves, __pyx_mstate->__pyx_n_u_curve_list, __pyx_mstate->__pyx_n_u_parity, __pyx_mstate->__pyx_n_u_complete_length, __pyx_mstate->__pyx_n_u_filled_length, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[150] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_dual_curves, __pyx_k_qP_4_1_AQ_1D_Q_Q_G9A_q_1_Q_1_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[150])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1469, 110};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cutoff, __pyx_mstate->__pyx_n_u_full_rigor, __pyx_mstate->__pyx_n_u_grouped, __pyx_mstate->__pyx_n_u_include_words, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_D};
    __pyx_mstate_global->__pyx_codeobj_tab[151] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_length_spectrum, __pyx_k_A_1_q_IQ_4wgQ_D_2_t7_q_1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[151])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1505, 182};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_curve, __pyx_mstate->__pyx_n_u_max_segments, __pyx_mstate->__pyx_n_u_num_curves, __pyx_mstate->__pyx_n_u_curve_list, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_c_new_name, __pyx_mstate->__pyx_n_u_new_name};
    __pyx_mstate_global->__pyx_codeobj_tab[152] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_drill, __pyx_k_a_Qm1_a_Q_at5_2V2Q_Q_1D_Q_Q_we1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[152])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1552, 261};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other, __pyx_mstate->__pyx_n_u_return_isometries, __pyx_mstate->__pyx_n_u_are_isometric, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_isometries, __pyx_mstate->__pyx_n_u_ans};
    __pyx_mstate_global->__pyx_codeobj_tab[153] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_is_isometric_to, __pyx_k_A_4AN_4_5_50A_A_AQ_t9Cs_y_1_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[153])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1638, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other, __pyx_mstate->__pyx_n_u_return_isometries};
    __pyx_mstate_global->__pyx_codeobj_tab[154] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_is_isometric_to_2, __pyx_k_A_31_t_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[154])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1647, 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_is_two_bridge, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_q_2, __pyx_mstate->__pyx_n_u_c_canonized_triangulation};
    __pyx_mstate_global->__pyx_codeobj_tab[155] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_is_two_bridge, __pyx_k_q_4_1_1_4_1_aq_a_as_1_1_1_Ba_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[155])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1681, 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_compute_corners, __pyx_mstate->__pyx_n_u_centroid_at_origin};
    __pyx_mstate_global->__pyx_codeobj_tab[156] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_choose_generators, __pyx_k_A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[156])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1686, 335};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_generator_path, __pyx_mstate->__pyx_n_u_face0_gen, __pyx_mstate->__pyx_n_u_face1_gen, __pyx_mstate->__pyx_n_u_face2_gen, __pyx_mstate->__pyx_n_u_face3_gen, __pyx_mstate->__pyx_n_u_c0, __pyx_mstate->__pyx_n_u_c1, __pyx_mstate->__pyx_n_u_c2, __pyx_mstate->__pyx_n_u_c3, __pyx_mstate->__pyx_n_u_neighbor0_idx, __pyx_mstate->__pyx_n_u_neighbor1_idx, __pyx_mstate->__pyx_n_u_neighbor2_idx, __pyx_mstate->__pyx_n_u_neighbor3_idx, __pyx_mstate->__pyx_n_u_perm0, __pyx_mstate->__pyx_n_u_perm1, __pyx_mstate->__pyx_n_u_perm2, __pyx_mstate->__pyx_n_u_perm3, __pyx_mstate->__pyx_n_u_ans, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[157] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_choose_generators_info, __pyx_k_A_a_E_at_q_A_1A_AQ_AQ_Qd_4q_wa_k, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[157])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1724, 158};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_surfaces, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_ans, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[158] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_splitting_surfaces, __pyx_k_A6_4_1_AQ_Qd_AQ_7_Q_aq_a_E_a_8_w, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[158])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1768, 296};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_surface, __pyx_mstate->__pyx_n_u_surfaces, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_num_surfaces, __pyx_mstate->__pyx_n_u_pieces, __pyx_mstate->__pyx_n_u_M0, __pyx_mstate->__pyx_n_u_M1, __pyx_mstate->__pyx_n_u_ans};
    __pyx_mstate_global->__pyx_codeobj_tab[159] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_split, __pyx_k_A_4_1_AQ_Qd_AQ_7_Q_aq_QoQ_M_8_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[159])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1833, 55};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_extends_to_link, __pyx_mstate->__pyx_n_u_ans, __pyx_mstate->__pyx_n_u_table, __pyx_mstate->__pyx_n_u_match};
    __pyx_mstate_global->__pyx_codeobj_tab[160] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_identify_2, __pyx_k_a_IX_G1_E_6_q_7_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[160])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1841, 232};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tet, __pyx_mstate->__pyx_n_u_tilts, __pyx_mstate->__pyx_n_u_side_lengths, __pyx_mstate->__pyx_n_u_one_tet_tilts, __pyx_mstate->__pyx_n_u_one_tet_lengths, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_one_vertex_lengths, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[161] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_cusp_cross_section_info, __pyx_k_A_q_A_at1_Qd_d_d_d_Qd_T_U_1_WAT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[161])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1867, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[162] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_manifold_pyx, __pyx_mstate->__pyx_n_u_precision, __pyx_k_A_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[162])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[163] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_k_A_vT_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[163])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 113, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[164] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_elementary_divisors, __pyx_k_A_t1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[164])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 119, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[165] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_rank, __pyx_k_A_s_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[165])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 125, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[166] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_betti_number, __pyx_k_A_s_1Bd_t_S_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[166])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 131, 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_det, __pyx_mstate->__pyx_n_u_c_2};
    __pyx_mstate_global->__pyx_codeobj_tab[167] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_order, __pyx_k_A_a_E_Q_b_T_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[167])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 159, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[168] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_get_data, __pyx_k_A_t7_gT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[168])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[169] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_add_rows, __pyx_k_A_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[169])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 216, 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_k};
    __pyx_mstate_global->__pyx_codeobj_tab[170] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_row_op, __pyx_k_A_E_Qd_q_6_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[170])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 223, 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[171] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_explode, __pyx_k_A_q_Yd_Ct3d_uAT_E_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[171])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 230, 203};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_col_support, __pyx_mstate->__pyx_n_u_row_entries, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_a_il, __pyx_mstate->__pyx_n_u_kl, __pyx_mstate->__pyx_n_u_temp, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_l};
    __pyx_mstate_global->__pyx_codeobj_tab[172] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_simplify, __pyx_k_A_WA_c_ir_5_A_2T_d_q_3b_3b_Ct9D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[172])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 254, 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_presentation, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[173] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_abelian_group_pyx, __pyx_mstate->__pyx_n_u_simplified_matrix, __pyx_k_A_IQ_2T_e1D_s_G4q_q_e5_WCt_AS_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[173])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 210};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[174] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_T_Kt_itSZZ_mmqqr_G1F_a_vWA_q_t, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[174])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[175] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_0_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[175])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 9, 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_word, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[176] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_inverse_list_word, __pyx_k_2Qb_E_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[176])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 13, 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_word, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_letter};
    __pyx_mstate_global->__pyx_codeobj_tab[177] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_reduce_list_word, __pyx_k_Q_7_fBc_AQ_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[177])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59, 12};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_verbose_form};
    __pyx_mstate_global->__pyx_codeobj_tab[178] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_letter_seperator, __pyx_k_7_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[178])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 73, 212};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_word, __pyx_mstate->__pyx_n_u_num_generators, __pyx_mstate->__pyx_n_u_word_list, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_number, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_letter};
    __pyx_mstate_global->__pyx_codeobj_tab[179] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_word_as_list, __pyx_k_t_QfA_iq_b_HJb_9_1A_uBb_b_1_j_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[179])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 98, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_int_list, __pyx_mstate->__pyx_n_u_num_generators, __pyx_mstate->__pyx_n_u_verbose_form, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[180] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_list_as_word, __pyx_k_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[180])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 134, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[181] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_num_generators, __pyx_k_A_AT_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[181])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 140, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[182] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_num_relators, __pyx_k_A_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[182])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 146, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[183] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_num_original_generators, __pyx_k_A_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[183])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 152, 108};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_verbose_form, __pyx_mstate->__pyx_n_u_as_int_list, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_gen, __pyx_mstate->__pyx_n_u_num_gen, __pyx_mstate->__pyx_n_u_num_orig_gens, __pyx_mstate->__pyx_n_u_orig_gens, __pyx_mstate->__pyx_n_u_word};
    __pyx_mstate_global->__pyx_codeobj_tab[184] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_original_generators, __pyx_k_B_4_a_Q_A_G9A_1D0Gq_q_q_Ya_WAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[184])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 177, 400};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_verbose_form, __pyx_mstate->__pyx_n_u_raw_form, __pyx_mstate->__pyx_n_u_as_int_list, __pyx_mstate->__pyx_n_u_moves, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_words, __pyx_mstate->__pyx_n_u_a_2, __pyx_mstate->__pyx_n_u_word, __pyx_mstate->__pyx_n_u_parts, __pyx_mstate->__pyx_n_u_b_2, __pyx_mstate->__pyx_n_u_A_3, __pyx_mstate->__pyx_n_u_B, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_word};
    __pyx_mstate_global->__pyx_codeobj_tab[185] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_generators_in_originals, __pyx_k_33CCVVW_L_1_1_D_r_2Rr_T_e1A_c_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[185])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 232, 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_moves, __pyx_mstate->__pyx_n_u_moves};
    __pyx_mstate_global->__pyx_codeobj_tab[186] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_word_moves, __pyx_k_A_1D_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[186])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 239, 48};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[187] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_generators, __pyx_k_AP_D_q_r_3_6a_U_q_1AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[187])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 283, 109};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_verbose_form, __pyx_mstate->__pyx_n_u_as_int_list, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_relation, __pyx_mstate->__pyx_n_u_num_gens, __pyx_mstate->__pyx_n_u_relation_list, __pyx_mstate->__pyx_n_u_num_relations, __pyx_mstate->__pyx_n_u_word};
    __pyx_mstate_global->__pyx_codeobj_tab[188] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_relators, __pyx_k_9_D_q_AT_G9A_at_B_q_q_A_AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[188])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 306, 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_as_int_list};
    __pyx_mstate_global->__pyx_codeobj_tab[189] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_meridian, __pyx_k_oQ_A_1_Q_at_1_at, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[189])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 331, 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_as_int_list};
    __pyx_mstate_global->__pyx_codeobj_tab[190] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_longitude, __pyx_k_a_A_1_Q_q_1_1_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[190])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 357, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_as_int_list, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[191] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_peripheral_curves, __pyx_k_A_s_iq_1_j_A_U_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[191])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 369, 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[192] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_magma_string, __pyx_k_A_3e1D_4r_Q_E_iq_WBa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[192])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376, 123};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gens, __pyx_mstate->__pyx_n_u_gen_names, __pyx_mstate->__pyx_n_u_relators, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[193] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_gap_string, __pyx_k_A_t5_D_Qat2Rr_T_d_Q_4uAT_b_Q_s_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[193])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 404, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[194] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_gap_init, __pyx_k_A_t_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[194])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 407, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_magma};
    __pyx_mstate_global->__pyx_codeobj_tab[195] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_magma_init, __pyx_k_A_t_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[195])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 410, 67};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_F_2, __pyx_mstate->__pyx_n_u_rels, __pyx_mstate->__pyx_n_u_R};
    __pyx_mstate_global->__pyx_codeobj_tab[196] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_sage, __pyx_k_A_4q_aq_IQd_Q_q_T_d_1L_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[196])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 420, 70};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_as_ideal, __pyx_mstate->__pyx_n_u_presentation, __pyx_mstate->__pyx_n_u_ans};
    __pyx_mstate_global->__pyx_codeobj_tab[197] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_character_variety_vars_and_polys, __pyx_k_8_4q_4_1_g_t1_l_1_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[197])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[198] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[198])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[199] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[199])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 486, 222};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_word, __pyx_mstate->__pyx_n_u_group, __pyx_mstate->__pyx_n_u_c_word, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_word_list, __pyx_mstate->__pyx_n_u_O, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[200] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_matrix_2, __pyx_k_A_L_t_6_A_at_B_PQQR_wc_vQ_Qd_1N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[200])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 512, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_word};
    __pyx_mstate_global->__pyx_codeobj_tab[201] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_SL2C, __pyx_k_t81F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[201])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 522, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_word};
    __pyx_mstate_global->__pyx_codeobj_tab[202] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_O31, __pyx_k_t81F_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[202])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 531, 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_word, __pyx_mstate->__pyx_n_u_c_word, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_word_list, __pyx_mstate->__pyx_n_u_M};
    __pyx_mstate_global->__pyx_codeobj_tab[203] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_complex_length, __pyx_k_A_L_t_4_hfAQ_7_Q_4y_q0A_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[203])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[204] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[204])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[205] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[205])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 600, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[206] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_fundamental_group_py, __pyx_mstate->__pyx_n_u_number_2, __pyx_k_A_v_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[206])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[207] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_full_group, __pyx_k_A_t1_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[207])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[208] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_order, __pyx_k_A_1D_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[208])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_abelian_description};
    __pyx_mstate_global->__pyx_codeobj_tab[209] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_abelian, __pyx_k_A_41_s_A_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[209])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 84, 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A_3, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_is_abelian, __pyx_mstate->__pyx_n_u_coeffs};
    __pyx_mstate_global->__pyx_codeobj_tab[210] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_abelian_description, __pyx_k_A_S_2_47J_1_4q_AQ_E_aq_0_1_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[210])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 105, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[211] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_dihedral, __pyx_k_A_s_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[211])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 115, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[212] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_polyhedral, __pyx_k_A_s_q_A06fF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[212])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 123, 128};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_is_binary_group, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_q_2, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_name};
    __pyx_mstate_global->__pyx_codeobj_tab[213] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_polyhedral_description, __pyx_k_A_4t_AQ_AT_7q_1Cq_r_A_2S_1_4Ba_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[213])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 150, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[214] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_S5, __pyx_k_A_s_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[214])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 156, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[215] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_direct_product, __pyx_k_A_s_31D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[215])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 169, 106};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_factor_0, __pyx_mstate->__pyx_n_u_c_factor_1, __pyx_mstate->__pyx_n_u_factor_0, __pyx_mstate->__pyx_n_u_factor_1};
    __pyx_mstate_global->__pyx_codeobj_tab[216] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_direct_product_description, __pyx_k_A_4t_Q_AQ_at3Fa_at3Fa_q_q_aq_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[216])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[217] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_amphicheiral, __pyx_k_A_s_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[217])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 207, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[218] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_is_invertible_knot, __pyx_k_A_s_1_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[218])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 218, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_comm_subgroup, __pyx_mstate->__pyx_n_u_comm_subgroup};
    __pyx_mstate_global->__pyx_codeobj_tab[219] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_commutator_subgroup, __pyx_k_A_1_a_Qd_A_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[219])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 236, 73};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_abelianization, __pyx_mstate->__pyx_n_u_abelianization};
    __pyx_mstate_global->__pyx_codeobj_tab[220] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_abelianization, __pyx_k_A_4t_AQ_Qd_at_Q_AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[220])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 256, 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_center, __pyx_mstate->__pyx_n_u_center};
    __pyx_mstate_global->__pyx_codeobj_tab[221] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_center, __pyx_k_A_4t_AQ_Qd_at_Q_AQ_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[221])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 276, 68};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[222] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_multiply_elements, __pyx_k_A_F_E_Q_uBc_Q_j_q_Qd_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[222])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 295, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isometries, __pyx_mstate->__pyx_n_u_ans};
    __pyx_mstate_global->__pyx_codeobj_tab[223] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_symmetry_group_pyx, __pyx_mstate->__pyx_n_u_isometries, __pyx_k_A_at1_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[223])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[224] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[224])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[225] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[225])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 102, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[226] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_number_2, __pyx_k_A_v_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[226])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 184, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[227] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_num_vertices, __pyx_k_A_t_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[227])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 190, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[228] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_num_finite_vertices, __pyx_k_A_t_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[228])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 196, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[229] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_num_ideal_vertices, __pyx_k_A_t_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[229])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 202, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[230] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_num_edges, __pyx_k_A_t_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[230])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 208, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[231] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_num_faces, __pyx_k_A_t_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[231])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 214, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_radius};
    __pyx_mstate_global->__pyx_codeobj_tab[232] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_in_radius, __pyx_k_A_AT_4A_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[232])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 221, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_radius};
    __pyx_mstate_global->__pyx_codeobj_tab[233] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_out_radius, __pyx_k_A_AT_4A_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[233])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 228, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_radius};
    __pyx_mstate_global->__pyx_codeobj_tab[234] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_spine_radius, __pyx_k_A_AT_4A_t9AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[234])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 236, 285};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cutoff_length, __pyx_mstate->__pyx_n_u_full_rigor, __pyx_mstate->__pyx_n_u_multiplicities, __pyx_mstate->__pyx_n_u_user_radius, __pyx_mstate->__pyx_n_u_grouped, __pyx_mstate->__pyx_n_u_num_lengths, __pyx_mstate->__pyx_n_u_geodesics, __pyx_mstate->__pyx_n_u_c_word, __pyx_mstate->__pyx_n_u_spectrum, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_its_matrix, __pyx_mstate->__pyx_n_u_d_2, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[235] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_length_spectrum_dicts, __pyx_k_2_D_q_A_1A_1A_1_G9A_1IQb_q_iq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[235])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 303, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_details};
    __pyx_mstate_global->__pyx_codeobj_tab[236] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_vertex_list_2, __pyx_k_A_1_4_4_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[236])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 323, 124};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vertex, __pyx_mstate->__pyx_n_u_vertices};
    __pyx_mstate_global->__pyx_codeobj_tab[237] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_vertex_list, __pyx_k_A_8_1_q_gS_0_G1_Ya_6_r_Ya_6_r_Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[237])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 335, 146};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vertex, __pyx_mstate->__pyx_n_u_vertices};
    __pyx_mstate_global->__pyx_codeobj_tab[238] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_vertex_data_list, __pyx_k_A_8_1_q_gS_0_G1_t9A_vRq_9A_vRq_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[238])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 350, 77};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vertex, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_index};
    __pyx_mstate_global->__pyx_codeobj_tab[239] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_vertex_to_index_dict, __pyx_k_A_8_q_gS_0_9Kq_Q_V1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[239])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 365, 77};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_edge, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_index};
    __pyx_mstate_global->__pyx_codeobj_tab[240] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_edge_to_index_dict, __pyx_k_A_AT_4A_t1_e3at_a_9IQ_Q_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[240])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 380, 466};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_face, __pyx_mstate->__pyx_n_u_edge, __pyx_mstate->__pyx_n_u_neighbor, __pyx_mstate->__pyx_n_u_vertex, __pyx_mstate->__pyx_n_u_vertex_to_index, __pyx_mstate->__pyx_n_u_edge_to_index, __pyx_mstate->__pyx_n_u_left, __pyx_mstate->__pyx_n_u_right, __pyx_mstate->__pyx_n_u_tail, __pyx_mstate->__pyx_n_u_tip, __pyx_mstate->__pyx_n_u_faces_2, __pyx_mstate->__pyx_n_u_vertices, __pyx_mstate->__pyx_n_u_vertex_indices, __pyx_mstate->__pyx_n_u_vertex_image_indices, __pyx_mstate->__pyx_n_u_edge_indices, __pyx_mstate->__pyx_n_u_edge_image_indices, __pyx_mstate->__pyx_n_u_edge_orientations, __pyx_mstate->__pyx_n_u_side, __pyx_mstate->__pyx_n_u_end_2, __pyx_mstate->__pyx_n_u_neighbor_end, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[241] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_face_list, __pyx_k_A8_AT_4A_4A_0_gV6_Cs_t1_e3at_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[241])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 474, 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_edge, __pyx_mstate->__pyx_n_u_edges_2, __pyx_mstate->__pyx_n_u_vertex_to_index};
    __pyx_mstate_global->__pyx_codeobj_tab[242] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_edge_list, __pyx_k_A_AT_4A_4A_t1_e3at_a_oQit2Qa__AY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[242])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 502, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[243] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_k_A_1_q_2_D_b_A_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[243])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 509, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[244] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_manifold, __pyx_k_A_t_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[244])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 524, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[245] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_triangulation, __pyx_k_A_t_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[245])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 552, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_volume};
    __pyx_mstate_global->__pyx_codeobj_tab[246] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_volume, __pyx_k_A_AT_4A_t9AQ_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[246])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 564, 141};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_face, __pyx_mstate->__pyx_n_u_matrices, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[247] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_pairing_matrices, __pyx_k_A_4_3a_AQ_1_t_6a_e3at_a_A_G1F_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[247])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 593, 120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_face, __pyx_mstate->__pyx_n_u_c_word, __pyx_mstate->__pyx_n_u_words};
    __pyx_mstate_global->__pyx_codeobj_tab[248] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_pairing_words, __pyx_k_A_4_3a_AQ_t_6a_e3at_a_T_wc_j_D_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[248])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 631, 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_matrices, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_matrix, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[249] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_to_string, __pyx_k_A_4_r_AQ_Ja_q_CuD_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[249])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 640, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_protocol};
    __pyx_mstate_global->__pyx_codeobj_tab[250] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_reduce_ex, __pyx_k_A_T_D_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[250])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 643, 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_output};
    __pyx_mstate_global->__pyx_codeobj_tab[251] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_save, __pyx_k_A_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[251])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 666, 87};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_model, __pyx_mstate->__pyx_n_u_cutout, __pyx_mstate->__pyx_n_u_num_subdivisions, __pyx_mstate->__pyx_n_u_shrink_factor, __pyx_mstate->__pyx_n_u_cutoff_radius, __pyx_mstate->__pyx_n_u_callback, __pyx_mstate->__pyx_n_u_output, __pyx_mstate->__pyx_n_u_output_file, __pyx_mstate->__pyx_n_u_line};
    __pyx_mstate_global->__pyx_codeobj_tab[252] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_export_stl, __pyx_k_99QQR_4N_8_AT_4wh6H_WX_HA_wa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[252])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 742, 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_string, __pyx_mstate->__pyx_n_u_name};
    __pyx_mstate_global->__pyx_codeobj_tab[253] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_dirichlet_pyx, __pyx_mstate->__pyx_n_u_unpickle_dirichlet_domain, __pyx_k_6_QR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[253])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 9, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[254] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_number_2, __pyx_k_A_v_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[254])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39, 60};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_M};
    __pyx_mstate_global->__pyx_codeobj_tab[255] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_manifold, __pyx_k_A_4_31_A_O1A_Qa_4_b_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[255])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp};
    __pyx_mstate_global->__pyx_codeobj_tab[256] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_original_index, __pyx_k_A_t_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[256])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59, 45};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[257] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_check_index, __pyx_k_A_Cq_2S_D_1_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[257])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 70, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[258] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_num_cusps, __pyx_k_A_t1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[258])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76, 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_topology};
    __pyx_mstate_global->__pyx_codeobj_tab[259] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_topology, __pyx_k_A_D_AQ_1_6LA_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[259])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 84, 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_disp};
    __pyx_mstate_global->__pyx_codeobj_tab[260] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_get_displacement, __pyx_k_A_D_AQ_vQha_A_a_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[260])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 99, 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_new_displacement, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[261] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_set_displacement, __pyx_k_A_D_AQ_4q_k, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[261])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 107, 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_disp};
    __pyx_mstate_global->__pyx_codeobj_tab[262] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_stopping_displacement, __pyx_k_q_D_AQ_vQha_J_a_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[262])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 118, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[263] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_stopper, __pyx_k_A_D_AQ_7q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[263])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 128, 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_reach};
    __pyx_mstate_global->__pyx_codeobj_tab[264] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_reach, __pyx_k_q_D_AQ_axq_1_a_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[264])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139, 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reach};
    __pyx_mstate_global->__pyx_codeobj_tab[265] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_max_reach, __pyx_k_A_axq_q_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[265])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 147, 30};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[266] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_get_tie, __pyx_k_A_D_AQ_C1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[266])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 155, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_new_tie, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[267] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_set_tie, __pyx_k_A_D_AQ_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[267])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 162, 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_volume};
    __pyx_mstate_global->__pyx_codeobj_tab[268] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_volume, __pyx_k_D_AQ_q_B_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[268])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 172, 76};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_meridian, __pyx_mstate->__pyx_n_u_longitude, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_L};
    __pyx_mstate_global->__pyx_codeobj_tab[269] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_translations, __pyx_k_D_AQ_4q_A_A_4_Qk_q_t9AT_Yaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[269])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 190, 198};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cutoff, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_full_list, __pyx_mstate->__pyx_n_u_high_precision, __pyx_mstate->__pyx_n_u_horoball_list, __pyx_mstate->__pyx_n_u_ball, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_dict_3};
    __pyx_mstate_global->__pyx_codeobj_tab[270] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_horoballs, __pyx_k_A_T_Qa_7q_q_A_aq_G9M_q_t9A_1D_t, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[270])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 225, 179};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_high_precision, __pyx_mstate->__pyx_n_u_segment_list, __pyx_mstate->__pyx_n_u_segment, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_pair};
    __pyx_mstate_global->__pyx_codeobj_tab[271] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_Ford_domain, __pyx_k_7q_T_Qa_8_1_aq_E_a_1_l_1_q_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[271])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 257, 200};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_high_precision, __pyx_mstate->__pyx_n_u_segment_list, __pyx_mstate->__pyx_n_u_segment, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_endpoints, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[272] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_triangulation, __pyx_k_9_T_Qa_1_aq_G9L_l_1_q__AWIQa_AW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[272])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289, 80};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_cutoff};
    __pyx_mstate_global->__pyx_codeobj_tab[273] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_cusp_neighborhoods_p, __pyx_mstate->__pyx_n_u_view, __pyx_k_j_T_Qa_1_q_0_k_q_a_4z_BgQ_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[273])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[274] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[274])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[275] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[275])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29, 111};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_desc, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_monodromy, __pyx_mstate->__pyx_n_u_surface};
    __pyx_mstate_global->__pyx_codeobj_tab[276] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_bundle_from_string, __pyx_k_4xq_Q_q_q_3l_7_4s_4s_1_IXQe4xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[276])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40, 136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_desc, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_gluing, __pyx_mstate->__pyx_n_u_handles, __pyx_mstate->__pyx_n_u_surface};
    __pyx_mstate_global->__pyx_codeobj_tab[277] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_splitting_from_string, __pyx_k_4xq_Q_F_1_q_3hj_4s_4s_1_xq_T_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[277])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 117, 213};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_specs, __pyx_mstate->__pyx_n_u_spec, __pyx_mstate->__pyx_n_u_vol};
    __pyx_mstate_global->__pyx_codeobj_tab[278] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_get_triangulation_tester, __pyx_k_r_AQk_XX_81_Zq_j_at1AXU_1HAV6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[278])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 227, 194};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_record, __pyx_mstate->__pyx_n_u_crossings, __pyx_mstate->__pyx_n_u_alternation, __pyx_mstate->__pyx_n_u_DT_3, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_byte, __pyx_mstate->__pyx_n_u_first_nybble, __pyx_mstate->__pyx_n_u_second_nybble, __pyx_mstate->__pyx_n_u_signs, __pyx_mstate->__pyx_n_u_mask, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[279] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_extract_HT_knot, __pyx_k_AQj_b_RvS_1_1_1A_Rq_A_A_1A_3a_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[279])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 248, 235};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_crossings, __pyx_mstate->__pyx_n_u_alternation, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_record, __pyx_mstate->__pyx_n_u_DT_3};
    __pyx_mstate_global->__pyx_codeobj_tab[280] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_get_HT_knot_DT, __pyx_k_Bb_3a_Q_Cq_Q_X_0_q_2Q_aq_Qa_wav, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[280])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 274, 164};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_alternation, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_manifold_class_2, __pyx_mstate->__pyx_n_u_crossings, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_index_within_crossings, __pyx_mstate->__pyx_n_u_name};
    __pyx_mstate_global->__pyx_codeobj_tab[281] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_get_HT_knot_by_index, __pyx_k_3a_E_as_3b_AQa_r_AQ_S_E_as_Qc_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[281])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 301, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_myslice};
    __pyx_mstate_global->__pyx_codeobj_tab[282] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_r_HD_t87_4q_IT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[282])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 306, 7};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[283] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_iter, __pyx_k_A_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[283])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 309, 12};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_item};
    __pyx_mstate_global->__pyx_codeobj_tab[284] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_contains, __pyx_k_A_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[284])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 312, 52};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[285] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_next, __pyx_k_A_4wc_Q_IT_a_t1D_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[285])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 320, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[286] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_len_2, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[286])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 324, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[287] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[287])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376, 48};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[288] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_81_iq_a_gU_2U_q_GWWX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[288])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 381, 12};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[289] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_lookup, __pyx_k_A_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[289])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 384, 424};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_num_tet, __pyx_mstate->__pyx_n_u_census_index, __pyx_mstate->__pyx_n_u_num, __pyx_mstate->__pyx_n_u_spec, __pyx_mstate->__pyx_n_u_tarpath, __pyx_mstate->__pyx_n_u_filedata};
    __pyx_mstate_global->__pyx_codeobj_tab[290] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_Qc_4z_81D_2Rq_HBa_2Rt1_a_4waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[290])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 444, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[291] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_81_iq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[291])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 447, 12};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[292] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_lookup, __pyx_k_A_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[292])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 461, 86};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_datafile, __pyx_mstate->__pyx_n_u_closed_orientable};
    __pyx_mstate_global->__pyx_codeobj_tab[293] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_F_Q_r_e1A_AQ_X_j_V1_Jc_31_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[293])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 471, 166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u__21, __pyx_mstate->__pyx_n_u_num_tet, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_l};
    __pyx_mstate_global->__pyx_codeobj_tab[294] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_Qc_4z_81D_9G3d_5_6_1_s_T_9_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[294])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 496, 86};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_datafile, __pyx_mstate->__pyx_n_u_closed_nonorientable};
    __pyx_mstate_global->__pyx_codeobj_tab[295] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_vS_r_e1A_4q_0DJa_a_Jc_6a_iq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[295])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506, 166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u__21, __pyx_mstate->__pyx_n_u_num_tet, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_l};
    __pyx_mstate_global->__pyx_codeobj_tab[296] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_Qc_4z_81D_9G3d_e1BfA_1_s_T_9_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[296])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 533, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[297] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_3a_a_iq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[297])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 536, 48};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[298] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_Qc_4z_81D_q_N_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[298])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 558, 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[299] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_3a_WE_iq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[299])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 571, 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[300] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_3a_Q_iq_a_G5_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[300])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 575, 7};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[301] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[301])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 578, 209};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_total, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_tarpath, __pyx_mstate->__pyx_n_u_filedata, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[302] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_Qc_4z_81D_A_U_3a_6_as_Q_0_9Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[302])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 619, 111};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_components, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[303] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_1_WE_5_Qd_AQ_0_N_Jc_j_iq_waq_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[303])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 634, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[304] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_repr_2, __pyx_k_A_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[304])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 638, 250};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_so_far, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_tarpath, __pyx_mstate->__pyx_n_u_filedata, __pyx_mstate->__pyx_n_u_c_triangulation, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[305] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_Qc_4z_81D_E_at_A_Jat_q_WBa_wb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[305])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 672, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_components, __pyx_mstate->__pyx_n_u_num_crossings};
    __pyx_mstate_global->__pyx_codeobj_tab[306] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[306])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 679, 26};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_str, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_pad};
    __pyx_mstate_global->__pyx_codeobj_tab[307] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_left_pad_string, __pyx_k_3b_r_AV2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[307])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 687, 247};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_components, __pyx_mstate->__pyx_n_u_num_crossings, __pyx_mstate->__pyx_n_u_crossings, __pyx_mstate->__pyx_n_u_files, __pyx_mstate->__pyx_n_u_c_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_second_char, __pyx_mstate->__pyx_n_u_file, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_line, __pyx_mstate->__pyx_n_u_strline};
    __pyx_mstate_global->__pyx_codeobj_tab[308] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_A_E_WN_Zq_E_q_Rs_Q_2_A_r_1_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[308])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 713, 120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_SC, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[309] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cython_core_tail_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_k_A_Qc_Zr_l_iq_j_1Ba_1D_Cq_a_1_3ax, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[309])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_PickleError, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[310] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_PresentationMatri, __pyx_k_hk_A_1_r_r_t_t_u_XQa_7_4A5J_XY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[310])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
{
    PyObject *typesModule=NULL;
    typesModule = PyImport_ImportModule("types");
    if (typesModule) {
        __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
        Py_DECREF(typesModule);
    }
} // error handling follows
#endif

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* 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: 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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* 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);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* 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_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *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 *const *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;
    PyObject *kwdefs;
    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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    if (
            co->co_kwonlyargcount == 0 &&
            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);
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
    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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _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 (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #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 && !CYTHON_COMPILING_IN_LIMITED_API
        vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
        if (f) {
            return f(func, args, _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, _nargs, NULL);
        }
        #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL
        return PyObject_Vectorcall(func, args, _nargs, NULL);
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__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
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* TupleAndListFromArray */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) {
            Py_DECREF(res);
            return NULL;
        }
        Py_INCREF(src[i]);
    }
    return res;
}
#elif 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) {
        return __Pyx_NewRef(__pyx_mstate_global->__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 || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    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 || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    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 (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            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));
            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_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    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 = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, 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_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* UnpackUnboundCMethod */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | 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);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywords */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    Py_ssize_t pos = 0;
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (PyDict_Next(kwds, &pos, &key, NULL)) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            #if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
            #endif
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
            #if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(key);
            #endif
        }
    }
    __Pyx_END_CRITICAL_SECTION();
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

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

/* 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_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_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, PyLong_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_ASSUME_SAFE_SIZE && !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, PyLong_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_ASSUME_SAFE_SIZE && !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))))) {
            return __Pyx_PyList_GetItemRef(o, n);
        }
    }
    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 = PyLong_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, PyLong_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_GetFullyQualifiedName(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_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* RaiseException */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* 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);
    return PyObject_SetAttr(obj, attr_name, value);
}
#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;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      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;
    if (max_char > 1114111) max_char = 1114111;
    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);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
        Py_INCREF(values[i]);
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    Py_INCREF(key);
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* HasAttr */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #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 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        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;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 0;
    }
    #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;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a != (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_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 = PyLong_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_GetFullyQualifiedName(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;
}

/* LimitedApiGetTypeDict */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                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  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                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;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* 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 CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value);
#elif PY_VERSION_HEX >= 0x030d0000
    PyDict_SetDefaultRef(d, key, default_value, &value);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* FetchCommonType */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromMetaclass(metaclass, 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;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
#endif
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CallTypeTraverse */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        Py_INCREF(key);
        Py_INCREF(value);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    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;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if 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_locked(__pyx_CyFunctionObject *op)
{
    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) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            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 PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_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 PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_dict_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    __Pyx_END_CRITICAL_SECTION();
    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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    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 PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    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 PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_annotations_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__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[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"_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
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__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)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__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 = 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);
    Py_CLEAR(m->defaults);
    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)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    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);
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
#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);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    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(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    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 && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
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)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    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;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_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_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* pybytes_as_double */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value = PyFloat_FromString(obj);
    if (likely(float_value)) {
        double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
        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;
    int parse_error_found = 0;
    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 != '_');
        parse_error_found |= last_was_punctuation & is_punctuation;
        last_was_punctuation = is_punctuation;
    }
    parse_error_found |= last_was_punctuation;
    *buffer = '\0';
    return unlikely(parse_error_found) ? NULL : buffer;
}
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);
}

/* 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_GetFullyQualifiedName(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 = __Pyx_PyFloat_AS_DOUBLE(float_value);
            Py_DECREF(float_value);
            return value;
        }
    }
bad:
    return (double)-1;
}

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

/* 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))
#else
        #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
#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_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __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;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    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;
#endif
}

/* 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 {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
#if CYTHON_COMPILING_IN_PYPY
#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;
#else
        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);
}
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    PyObject *key, *value;
    if (unlikely(orig_length != PyDict_Size(iter_obj))) {
        PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
        return -1;
    }
    if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
        return 0;
    }
    if (pitem) {
        PyObject* tuple = PyTuple_New(2);
        if (unlikely(!tuple)) {
            return -1;
        }
        Py_INCREF(key);
        Py_INCREF(value);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
        next_item = PyList_GetItemRef(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #elif CYTHON_ASSUME_SAFE_MACROS
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
        #else
        next_item = PyList_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        Py_INCREF(next_item);
        #endif
    } 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;
}

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc, *new_exc;
    __Pyx_PyThreadState_declare
    int is_async_stopiteration = 0;
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    __Pyx_PyThreadState_assign
    cur_exc = __Pyx_PyErr_CurrentExceptionType();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else {
            return;
        }
    }
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(tb);
    new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        "generator raised StopIteration");
    if (!new_exc) {
        Py_XDECREF(val);
        return;
    }
    PyException_SetCause(new_exc, val); // steals ref to val
    PyErr_SetObject(PyExc_RuntimeError, new_exc);
}

/* py_abs */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
#if PY_VERSION_HEX >= 0x030C00A7
    if (likely(__Pyx_PyLong_IsCompact(n))) {
        return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n));
    }
#else
    if (likely(Py_SIZE(n) == -1)) {
        return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]);
    }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    {
        PyObject *copy = _PyLong_Copy((PyLongObject*)n);
        if (likely(copy)) {
            #if PY_VERSION_HEX >= 0x030C00A7
            ((PyLongObject*)copy)->long_value.lv_tag ^= ((PyLongObject*)copy)->long_value.lv_tag & _PyLong_SIGN_MASK;
            #else
            __Pyx_SET_SIZE(copy, -Py_SIZE(copy));
            #endif
        }
        return copy;
    }
#else
    return PyNumber_Negative(n);
#endif
}
#endif

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON
static int
__Pyx_unicode_modifiable(PyObject *unicode)
{
    if (Py_REFCNT(unicode) != 1)
        return 0;
    if (!PyUnicode_CheckExact(unicode))
        return 0;
    if (PyUnicode_CHECK_INTERNED(unicode))
        return 0;
    return 1;
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    ) {
    PyObject *left = *p_left;
    Py_ssize_t left_len, right_len, new_len;
    if (unlikely(__Pyx_PyUnicode_READY(left) == -1))
        return NULL;
    if (unlikely(__Pyx_PyUnicode_READY(right) == -1))
        return NULL;
    left_len = PyUnicode_GET_LENGTH(left);
    if (left_len == 0) {
        Py_INCREF(right);
        return right;
    }
    right_len = PyUnicode_GET_LENGTH(right);
    if (right_len == 0) {
        Py_INCREF(left);
        return left;
    }
    if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) {
        PyErr_SetString(PyExc_OverflowError,
                        "strings are too large to concat");
        return NULL;
    }
    new_len = left_len + right_len;
    if (__Pyx_unicode_modifiable(left)
            && PyUnicode_CheckExact(right)
            && PyUnicode_KIND(right) <= PyUnicode_KIND(left)
            && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
        int ret;
        __Pyx_GIVEREF(*p_left);
        ret = PyUnicode_Resize(p_left, new_len);
        __Pyx_GOTREF(*p_left);
        if (unlikely(ret != 0))
            return NULL;
        #if PY_VERSION_HEX >= 0x030d0000
        if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
        #else
        _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
        #endif
        __Pyx_INCREF(*p_left);
        __Pyx_GIVEREF(*p_left);
        return *p_left;
    } else {
        return __Pyx_PyUnicode_Concat(left, right);
    }
  }
#endif

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_mstate_global->__pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

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

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return __Pyx_CallCFunction(cfunc, self, arg);
        } else if (flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
        } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL);
        }
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg);
    }
#endif
    PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *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)) {
        PyObject *args = PyTuple_New(1);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
    } else
#endif
    {
        result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
    }
    return result;
}

/* 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_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(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;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n)))
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, 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
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
        Py_ssize_t pos = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        PyDict_Next(kwds, &pos, &key, NULL);
        Py_INCREF(key);
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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;
}

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

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
        }
    }
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla % llb;
            llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_RemainderObjC(op1, op2, inplace);
    
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_RemainderObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_RemainderObjC(op1, op2, inplace);
}
#endif

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
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 >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    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
}

/* ByteArrayAppend */
static CYTHON_INLINE int __Pyx_PyByteArray_Append(PyObject* bytearray, int value) {
    PyObject *pyval, *retval;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_is_valid_index(value, 256))) {
        Py_ssize_t n = Py_SIZE(bytearray);
        if (likely(n != PY_SSIZE_T_MAX)) {
            if (unlikely(PyByteArray_Resize(bytearray, n + 1) < 0))
                return -1;
            PyByteArray_AS_STRING(bytearray)[n] = (char) (unsigned char) value;
            return 0;
        }
    } else {
        PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)");
        return -1;
    }
#endif
    pyval = PyLong_FromLong(value);
    if (unlikely(!pyval))
        return -1;
    retval = __Pyx_PyObject_CallMethod1(bytearray, __pyx_mstate_global->__pyx_n_u_append, pyval);
    Py_DECREF(pyval);
    if (unlikely(!retval))
        return -1;
    Py_DECREF(retval);
    return 0;
}

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(0);
    }
    ctx = PyUnicode_FromString(name);
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
    if (nogil)
        PyGILState_Release(state);
}

/* PyLongCompare */
static CYTHON_INLINE PyObject* __Pyx_PyLong_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #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) {
            if (__Pyx_PyLong_IsZero(op1) == 1) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                Py_RETURN_FALSE;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* RaiseClosureNameError */
static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, 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
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    long b, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG lla = intval;
    PY_LONG_LONG llb, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op2))) {
        return __Pyx_NewRef(op2);
    }
    if (likely(__Pyx_PyLong_IsCompact(op2))) {
        b = __Pyx_PyLong_CompactValue(op2);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op2);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                    b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                    llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                    b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                    llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                    b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                    llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                    b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                    llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                    b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                    llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                    b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                    llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
        }
    }
            CYTHON_UNUSED_VAR(a);
            CYTHON_UNUSED_VAR(b);
            #ifdef HAVE_LONG_LONG
            llb = b;
            goto long_long;
            #else
            return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
            #endif
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla * llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_MultiplyCObj(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) * (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        return __Pyx_Unpacked___Pyx_PyLong_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        return __Pyx_Float___Pyx_PyLong_MultiplyCObj(op2, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(op1, op2, inplace);
}
#endif

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* 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, const 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;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    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 = PySequence_Repeat(padding, uoffset - prepend_sign);
                    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 = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    if (likely(ulength <= 250)) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) (ulength - 1));
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= ulength;
        memset(cpos, padding_char, (size_t) (ulength - 1));
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, ulength - 1);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#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 (format_char == 'c') {
        if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                     !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
            PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
            return NULL;
        }
        if (width <= 1) {
            return PyUnicode_FromOrdinal((int) value);
        }
        return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
    }
    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 = (int) (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 = (int) (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 = (int) (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);
}

/* DivInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    Py_ssize_t adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* ModInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
    Py_ssize_t r = a % b;
    Py_ssize_t adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return r + adapt_python * b;
}

/* 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_mstate_global->__pyx_n_u_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    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_mstate_global->__pyx_kp_u__30);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* 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 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
#if CYTHON_COMPILING_IN_LIMITED_API
            || __Pyx_get_runtime_version() >= 0x030A0000
#endif
            )
            return result;
        {
            Py_ssize_t size = __Pyx_PySet_GET_SIZE(result);
            if (likely(size > 0))
                return result;
#if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(size < 0)) {
                Py_DECREF(result);
                return NULL;
            }
#endif
        }
        Py_DECREF(result);
#endif
    }
    return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type);
}

/* 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_remove */
static int __Pyx_PySet_RemoveNotFound(PyObject *set, PyObject *key, int found) {
    if (unlikely(found < 0)) {
        found = __Pyx_PySet_DiscardUnhashable(set, key);
    }
    if (likely(found == 0)) {
        PyObject *tup;
        tup = PyTuple_Pack(1, key);
        if (!tup)
            return -1;
        PyErr_SetObject(PyExc_KeyError, tup);
        Py_DECREF(tup);
        return -1;
    }
    return found;
}
static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key) {
    int found = PySet_Discard(set, key);
    if (unlikely(found != 1)) {
        return __Pyx_PySet_RemoveNotFound(set, key, found);
    }
    return 0;
}

/* 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 >= 0x030d00A2 || defined(PyDict_Pop)
    PyObject *value;
    if (PyDict_Pop(d, key, &value) == 0) {
        if (default_value) {
            Py_INCREF(default_value);
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
        value = default_value;
    }
    return value;
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    return _PyDict_Pop(d, key, default_value);
#else
    if (default_value) {
        return __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key, default_value);
    } else {
        return __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key);
    }
#endif
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if !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 (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_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_mstate_global->__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

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

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

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* 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_mstate_global->__pyx_n_u_pop);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
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_mstate_global->__pyx_umethod_PyList_Type_pop, L);
}
#endif

/* UnicodeAsUCS4 */
static void __Pyx_PyUnicode_AsPy_UCS4_error(Py_ssize_t length) {
    if (likely(length >= 0)) {
        PyErr_Format(PyExc_ValueError,
                     "only single character unicode strings can be converted to Py_UCS4, "
                     "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
    }
}
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
    Py_ssize_t length = __Pyx_PyUnicode_GET_LENGTH(x);
    if (unlikely(length != 1)) {
        __Pyx_PyUnicode_AsPy_UCS4_error(length);
        return (Py_UCS4)-1;
    }
    return __Pyx_PyUnicode_READ_CHAR(x, 0);
}

/* object_ord */
static long __Pyx__PyObject_Ord(PyObject* c) {
    Py_ssize_t size;
    if (PyBytes_Check(c)) {
        size = __Pyx_PyBytes_GET_SIZE(c);
        if (likely(size == 1)) {
#if CYTHON_ASSUME_SAFE_MACROS
            return (unsigned char) PyBytes_AS_STRING(c)[0];
#else
            char *data = PyBytes_AsString(c);
            if (unlikely(!data)) return -1;
            return (unsigned char) data[0];
#endif
        }
#if !CYTHON_ASSUME_SAFE_SIZE
        else if (unlikely(size < 0)) return -1;
#endif
    } else if (PyByteArray_Check(c)) {
        size = __Pyx_PyByteArray_GET_SIZE(c);
        if (likely(size == 1)) {
#if CYTHON_ASSUME_SAFE_MACROS
            return (unsigned char) PyByteArray_AS_STRING(c)[0];
#else
            char *data = PyByteArray_AsString(c);
            if (unlikely(!data)) return -1;
            return (unsigned char) data[0];
#endif
        }
#if !CYTHON_ASSUME_SAFE_SIZE
        else if (unlikely(size < 0)) return -1;
#endif
    } else {
        __Pyx_TypeName c_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(c));
        PyErr_Format(PyExc_TypeError,
            "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found",
            c_type_name);
        __Pyx_DECREF_TypeName(c_type_name);
        return (long)(Py_UCS4)-1;
    }
    PyErr_Format(PyExc_TypeError,
        "ord() expected a character, but string of length %zd found", size);
    return (long)(Py_UCS4)-1;
}

/* pop_index */
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
    PyObject *r;
    if (unlikely(!py_ix)) return NULL;
    r = __Pyx__PyObject_PopIndex(L, py_ix);
    Py_DECREF(py_ix);
    return r;
}
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
    return __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
    Py_ssize_t size = PyList_GET_SIZE(L);
    if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
        Py_ssize_t cix = ix;
        if (cix < 0) {
            cix += size;
        }
        if (likely(__Pyx_is_valid_index(cix, size))) {
            PyObject* v = PyList_GET_ITEM(L, cix);
            __Pyx_SET_SIZE(L, Py_SIZE(L) - 1);
            size -= 1;
            memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
            return v;
        }
    }
    if (py_ix == Py_None) {
        return __Pyx__PyObject_PopNewIndex(L, PyLong_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

/* SliceTupleAndList */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length);
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice_locked(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (length <= 0) {
        return PyList_New(0);
    }
    return __Pyx_PyList_FromArray(((PyListObject*)src)->ob_item + start, length);
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(src);
    result = __Pyx_PyList_GetSlice_locked(src, start, stop);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
#endif // CYTHON_COMPILING_IN_CPYTHON

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    long b, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG lla = intval;
    PY_LONG_LONG llb, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op2))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op2))) {
        b = __Pyx_PyLong_CompactValue(op2);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op2);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
        }
    }
            x = a + b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla + llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddCObj(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        return __Pyx_Float___Pyx_PyLong_AddCObj(op2, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
        }
    }
            {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            {
                PY_LONG_LONG q, r;
                q = lla / llb;
                r = lla - q*llb;
                q -= ((r != 0) & ((r ^ llb) < 0));
                llx = q;
            }
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(op1, op2, inplace);
    
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(op1, op2, inplace);
}
#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);
    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

/* SetStringIndexingError */
static void __Pyx_SetStringIndexingError(const char* message, int has_gil) {
    if (!has_gil) {
        PyGILState_STATE gil_state = PyGILState_Ensure();
        PyErr_SetString(PyExc_IndexError, message);
        PyGILState_Release(gil_state);
    } else
        PyErr_SetString(PyExc_IndexError, message);
}

/* GetItemIntByteArray */
static CYTHON_INLINE int __Pyx_GetItemInt_ByteArray_Fast(PyObject* string, Py_ssize_t i,
                                                         int wraparound, int boundscheck, int has_gil) {
    Py_ssize_t length;
    if (wraparound | boundscheck) {
        length = __Pyx_PyByteArray_GET_SIZE(string);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        if (wraparound & unlikely(i < 0)) i += length;
        if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) {
            #if !CYTHON_ASSUME_SAFE_MACROS
            char *asString = PyByteArray_AsString(string);
            return likely(asString) ? (unsigned char) asString[i] : -1;
            #else
            return (unsigned char) (PyByteArray_AS_STRING(string)[i]);
            #endif
        } else {
            __Pyx_SetStringIndexingError("bytearray index out of range", has_gil);
            return -1;
        }
    } else {
        #if !CYTHON_ASSUME_SAFE_MACROS
        char *asString = PyByteArray_AsString(string);
        return likely(asString) ? (unsigned char) asString[i] : -1;
        #else
        return (unsigned char) (PyByteArray_AS_STRING(string)[i]);
        #endif
    }
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_RshiftObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceRshift : PyNumber_Rshift)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_rshift(op1, op2);
        }
    }
            x = a >> b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla >> llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_RshiftObjC(op1, op2, inplace);
    
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_RshiftObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_RshiftObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AndObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    if ((intval & PyLong_MASK) == intval) {
        long last_digit = (long) __Pyx_PyLong_Digits(op1)[0];
        long result = intval & (likely(__Pyx_PyLong_IsPos(op1)) ? last_digit : (PyLong_MASK - last_digit + 1));
        return PyLong_FromLong(result);
    }
    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_and(op1, op2);
        }
    }
            x = a & b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla & llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_AndObjC(op1, op2, inplace);
    
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AndObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_AndObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_LshiftObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceLshift : PyNumber_Lshift)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_LshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_lshift(op1, op2);
        }
    }
            x = a << b;
#ifdef HAVE_LONG_LONG
            if (unlikely(!(b < (long) (sizeof(long)*8) && a == x >> b)) && a) {
                lla = a;
                goto long_long;
            }
#else
            if (likely(b < (long) (sizeof(long)*8) && a == x >> b) || !a)
#endif
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla << llb;
            if (likely(lla == llx >> llb))
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_LshiftObjC(op1, op2, inplace);
    
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_LshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_LshiftObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_LshiftObjC(op1, op2, inplace);
}
#endif

/* PySequenceMultiply */
static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
    PyObject *result, *pymul = PyLong_FromSsize_t(mul);
    if (unlikely(!pymul))
        return NULL;
    result = PyNumber_Multiply(seq, pymul);
    Py_DECREF(pymul);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
#if CYTHON_USE_TYPE_SLOTS
    PyTypeObject *type = Py_TYPE(seq);
    if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
        return type->tp_as_sequence->sq_repeat(seq, mul);
    } else
#endif
    {
        return __Pyx_PySequence_Multiply_Generic(seq, mul);
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#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 (format_char == 'c') {
        if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                     !(sizeof(value) <= 2 || value & ~ (long) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
            PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
            return NULL;
        }
        if (width <= 1) {
            return PyUnicode_FromOrdinal((int) value);
        }
        return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
    }
    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 = (long) (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 = (long) (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 = (long) (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);
}

/* 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_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(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
            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_GetFullyQualifiedName(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
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || 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;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !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 (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !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_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* SetVTable */
static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* DelItemOnTypeDict */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_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_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((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;
}

/* ListPack */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
    va_list va;
    PyObject *l = PyList_New(n);
    va_start(va, n);
    if (unlikely(!l)) goto end;
    for (Py_ssize_t i=0; i<n; ++i) {
        PyObject *arg = va_arg(va, PyObject*);
        Py_INCREF(arg);
        if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
            Py_CLEAR(l);
            goto end;
        }
    }
    end:
    va_end(va);
    return l;
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
#if CYTHON_ASSUME_SAFE_SIZE
    size_bases = PyTuple_GET_SIZE(bases);
#else
    size_bases = PyTuple_Size(bases);
    if (size_bases < 0) return NULL;
#endif
    for (i = 0; i < size_bases; i++) {
#if CYTHON_AVOID_BORROWED_REFS
        Py_CLEAR(base);
#endif
#if CYTHON_ASSUME_SAFE_MACROS
        base = PyTuple_GET_ITEM(bases, i);
#else
        base = PyTuple_GetItem(bases, i);
        if (!base) goto error;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(base);
#endif
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_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++) {
                PyObject *base_from_list;
#if CYTHON_ASSUME_SAFE_MACROS
                base_from_list = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base_from_list);
                Py_INCREF(base_from_list);
#else
                base_from_list = PyTuple_GetItem(bases, j);
                if (!base_from_list) goto error;
                Py_INCREF(base_from_list);
                if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
#endif
            }
        }
#if CYTHON_ASSUME_SAFE_SIZE
        j = PyList_GET_SIZE(new_bases);
#else
        j = PyList_Size(new_bases);
        if (j < 0) goto error;
#endif
        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);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return result;
error:
    Py_XDECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    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 (!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) {
        metaclass = &PyType_Type;
    }
    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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_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, mkw);
    Py_XDECREF(owned_metaclass);
    return result;
}

/* ImportDottedModule */
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    Py_ssize_t size;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
#if CYTHON_ASSUME_SAFE_SIZE
    size = PyTuple_GET_SIZE(parts_tuple);
#else
    size = PyTuple_Size(parts_tuple);
    if (size < 0) goto bad;
#endif
    if (likely(size == 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(
        PyExc_ModuleNotFoundError,
        "No module named '%U'", partial_name);
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
        CYTHON_COMPILING_IN_GRAAL
    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;
}
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
#if CYTHON_ASSUME_SAFE_SIZE
    nparts = PyTuple_GET_SIZE(parts_tuple);
#else
    nparts = PyTuple_Size(parts_tuple);
    if (nparts < 0) return NULL;
#endif
    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 = __Pyx_PySequence_ITEM(parts_tuple, i);
        if (!part) return NULL;
#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;
}
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
    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);
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec_2);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_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);
}

/* GetNameInClass */
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    if (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
#endif
    {
#if CYTHON_COMPILING_IN_LIMITED_API
        return PyErr_Format(
            PyExc_SystemError,
            "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
            "This is most likely a classmethod in a cdef class method with binding=False. "
            "Try setting 'binding' to True.",
            method);
#elif CYTHON_COMPILING_IN_GRAAL
        PyTypeObject *d_type = PyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
#else
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        PyTypeObject *d_type = descr->d_common.d_type;
        return PyDescr_NewClassMethod(d_type, descr->d_method);
#endif
    }
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
#else
    {
        PyObject *func=NULL;
        PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
        if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
            func = PyObject_GetAttrString(method, "__func__");
            if (!func) goto bad;
        } else {
            func = method;
            Py_INCREF(func);
        }
        builtins = PyEval_GetBuiltins(); // borrowed
        if (unlikely(!builtins)) goto bad;
        classmethod_str = PyUnicode_FromString("classmethod");
        if (unlikely(!classmethod_str)) goto bad;
        classmethod = PyObject_GetItem(builtins, classmethod_str);
        Py_DECREF(classmethod_str);
        if (unlikely(!classmethod)) goto bad;
        result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
        Py_DECREF(classmethod);
        bad:
        Py_XDECREF(func);
        return result;
    }
#endif
}

/* CLineInTraceback */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
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_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict);
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback))
        Py_XINCREF(use_cline);
        __Pyx_END_CRITICAL_SECTION();
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_INCREF(use_cline);
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            code_cache->count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        py_funcname = PyUnicode_FromString(funcname);
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    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 (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

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

/* FromPy */
static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
#if CYTHON_COMPILING_IN_LIMITED_API
    double real=-1.0, imag=-1.0;
    real = PyComplex_RealAsDouble(o);
    if (unlikely(real == -1.0 && PyErr_Occurred())) goto end;
    imag = PyComplex_ImagAsDouble(o);
  end:
    return __pyx_t_double_complex_from_parts(
        (double)real, (double)imag
    );
#else
    Py_complex cval;
#if !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_GRAAL
    if (PyComplex_CheckExact(o))
        cval = ((PyComplexObject *)o)->cval;
    else
#endif
        cval = PyComplex_AsCComplex(o);
    return __pyx_t_double_complex_from_parts(
               (double)cval.real,
               (double)cval.imag);
#endif
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= 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(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#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, *kwds = NULL;
        PyObject *py_bytes = 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;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KLPStrandType(KLPStrandType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const KLPStrandType neg_one = (KLPStrandType) -1, const_zero = (KLPStrandType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(KLPStrandType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(KLPStrandType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(KLPStrandType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(KLPStrandType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(KLPStrandType) <= 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(KLPStrandType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(KLPStrandType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KLPCrossingType(KLPCrossingType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const KLPCrossingType neg_one = (KLPCrossingType) -1, const_zero = (KLPCrossingType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(KLPCrossingType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(KLPCrossingType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(KLPCrossingType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(KLPCrossingType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(KLPCrossingType) <= 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(KLPCrossingType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(KLPCrossingType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    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_PyLong_From_Boolean(Boolean value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Boolean neg_one = (Boolean) -1, const_zero = (Boolean) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Boolean) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Boolean) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(Boolean) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Boolean) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Boolean) <= 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(Boolean),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(Boolean));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE unsigned int __Pyx_PyLong_As_unsigned_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyLong_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT)) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    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 (unsigned int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(unsigned int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(unsigned int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        unsigned int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (unsigned int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (unsigned int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (unsigned int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (unsigned int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(unsigned int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((unsigned int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(unsigned int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((unsigned int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((unsigned int) 1) << (sizeof(unsigned int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (unsigned int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Orientability(Orientability value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Orientability neg_one = (Orientability) -1, const_zero = (Orientability) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Orientability) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Orientability) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(Orientability) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Orientability) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Orientability) <= 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(Orientability),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(Orientability));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_FuncResult(FuncResult value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const FuncResult neg_one = (FuncResult) -1, const_zero = (FuncResult) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(FuncResult) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(FuncResult) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(FuncResult) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(FuncResult) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(FuncResult) <= 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(FuncResult),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(FuncResult));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Permutation(Permutation value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Permutation neg_one = (Permutation) -1, const_zero = (Permutation) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Permutation) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Permutation) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(Permutation) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Permutation) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Permutation) <= 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(Permutation),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(Permutation));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE Boolean __Pyx_PyLong_As_Boolean(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Boolean neg_one = (Boolean) -1, const_zero = (Boolean) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        Boolean val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (Boolean) -1;
        val = __Pyx_PyLong_As_Boolean(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(Boolean, __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(Boolean) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Boolean) >= 2 * PyLong_SHIFT)) {
                            return (Boolean) (((((Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Boolean) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Boolean) >= 3 * PyLong_SHIFT)) {
                            return (Boolean) (((((((Boolean)digits[2]) << PyLong_SHIFT) | (Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Boolean) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, 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(Boolean) >= 4 * PyLong_SHIFT)) {
                            return (Boolean) (((((((((Boolean)digits[3]) << PyLong_SHIFT) | (Boolean)digits[2]) << PyLong_SHIFT) | (Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)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 (Boolean) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(Boolean) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Boolean, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Boolean) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Boolean, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Boolean, __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(Boolean) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Boolean) - 1 > 2 * PyLong_SHIFT)) {
                            return (Boolean) (((Boolean)-1)*(((((Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(Boolean) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Boolean) - 1 > 2 * PyLong_SHIFT)) {
                            return (Boolean) ((((((Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(Boolean) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Boolean) - 1 > 3 * PyLong_SHIFT)) {
                            return (Boolean) (((Boolean)-1)*(((((((Boolean)digits[2]) << PyLong_SHIFT) | (Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Boolean) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Boolean) - 1 > 3 * PyLong_SHIFT)) {
                            return (Boolean) ((((((((Boolean)digits[2]) << PyLong_SHIFT) | (Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(Boolean) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, 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(Boolean) - 1 > 4 * PyLong_SHIFT)) {
                            return (Boolean) (((Boolean)-1)*(((((((((Boolean)digits[3]) << PyLong_SHIFT) | (Boolean)digits[2]) << PyLong_SHIFT) | (Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Boolean) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Boolean, 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(Boolean) - 1 > 4 * PyLong_SHIFT)) {
                            return (Boolean) ((((((((((Boolean)digits[3]) << PyLong_SHIFT) | (Boolean)digits[2]) << PyLong_SHIFT) | (Boolean)digits[1]) << PyLong_SHIFT) | (Boolean)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(Boolean) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Boolean, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Boolean) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Boolean, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        Boolean 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 (Boolean) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (Boolean) -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 (Boolean) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (Boolean) 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(Boolean) * 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 |= ((Boolean) 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(Boolean) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((Boolean) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((Boolean) 1) << (sizeof(Boolean) * 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 (Boolean) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Boolean");
    return (Boolean) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Boolean");
    return (Boolean) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_CuspTopology(CuspTopology value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const CuspTopology neg_one = (CuspTopology) -1, const_zero = (CuspTopology) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(CuspTopology) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(CuspTopology) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(CuspTopology) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(CuspTopology) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(CuspTopology) <= 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(CuspTopology),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(CuspTopology));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyLong_As_size_t(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(size_t, __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(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
                            return (size_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
#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 (size_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(size_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __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(size_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((((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(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_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
        if ((sizeof(size_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        size_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#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 (size_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (size_t) -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 (size_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (size_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((size_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((size_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (size_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE VertexIndex __Pyx_PyLong_As_VertexIndex(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const VertexIndex neg_one = (VertexIndex) -1, const_zero = (VertexIndex) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        VertexIndex val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (VertexIndex) -1;
        val = __Pyx_PyLong_As_VertexIndex(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(VertexIndex, __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(VertexIndex) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(VertexIndex) >= 2 * PyLong_SHIFT)) {
                            return (VertexIndex) (((((VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(VertexIndex) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(VertexIndex) >= 3 * PyLong_SHIFT)) {
                            return (VertexIndex) (((((((VertexIndex)digits[2]) << PyLong_SHIFT) | (VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(VertexIndex) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, 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(VertexIndex) >= 4 * PyLong_SHIFT)) {
                            return (VertexIndex) (((((((((VertexIndex)digits[3]) << PyLong_SHIFT) | (VertexIndex)digits[2]) << PyLong_SHIFT) | (VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)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 (VertexIndex) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(VertexIndex) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(VertexIndex, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(VertexIndex) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(VertexIndex, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(VertexIndex, __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(VertexIndex) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(VertexIndex) - 1 > 2 * PyLong_SHIFT)) {
                            return (VertexIndex) (((VertexIndex)-1)*(((((VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(VertexIndex) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(VertexIndex) - 1 > 2 * PyLong_SHIFT)) {
                            return (VertexIndex) ((((((VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(VertexIndex) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(VertexIndex) - 1 > 3 * PyLong_SHIFT)) {
                            return (VertexIndex) (((VertexIndex)-1)*(((((((VertexIndex)digits[2]) << PyLong_SHIFT) | (VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(VertexIndex) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(VertexIndex) - 1 > 3 * PyLong_SHIFT)) {
                            return (VertexIndex) ((((((((VertexIndex)digits[2]) << PyLong_SHIFT) | (VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(VertexIndex) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, 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(VertexIndex) - 1 > 4 * PyLong_SHIFT)) {
                            return (VertexIndex) (((VertexIndex)-1)*(((((((((VertexIndex)digits[3]) << PyLong_SHIFT) | (VertexIndex)digits[2]) << PyLong_SHIFT) | (VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(VertexIndex) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(VertexIndex, 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(VertexIndex) - 1 > 4 * PyLong_SHIFT)) {
                            return (VertexIndex) ((((((((((VertexIndex)digits[3]) << PyLong_SHIFT) | (VertexIndex)digits[2]) << PyLong_SHIFT) | (VertexIndex)digits[1]) << PyLong_SHIFT) | (VertexIndex)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(VertexIndex) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(VertexIndex, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(VertexIndex) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(VertexIndex, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        VertexIndex 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 (VertexIndex) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (VertexIndex) -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 (VertexIndex) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (VertexIndex) 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(VertexIndex) * 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 |= ((VertexIndex) 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(VertexIndex) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((VertexIndex) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((VertexIndex) 1) << (sizeof(VertexIndex) * 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 (VertexIndex) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to VertexIndex");
    return (VertexIndex) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to VertexIndex");
    return (VertexIndex) -1;
}

/* CIntFromPy */
static CYTHON_INLINE FaceIndex __Pyx_PyLong_As_FaceIndex(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const FaceIndex neg_one = (FaceIndex) -1, const_zero = (FaceIndex) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        FaceIndex val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (FaceIndex) -1;
        val = __Pyx_PyLong_As_FaceIndex(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(FaceIndex, __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(FaceIndex) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(FaceIndex) >= 2 * PyLong_SHIFT)) {
                            return (FaceIndex) (((((FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(FaceIndex) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(FaceIndex) >= 3 * PyLong_SHIFT)) {
                            return (FaceIndex) (((((((FaceIndex)digits[2]) << PyLong_SHIFT) | (FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(FaceIndex) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, 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(FaceIndex) >= 4 * PyLong_SHIFT)) {
                            return (FaceIndex) (((((((((FaceIndex)digits[3]) << PyLong_SHIFT) | (FaceIndex)digits[2]) << PyLong_SHIFT) | (FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)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 (FaceIndex) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(FaceIndex) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(FaceIndex, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(FaceIndex) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(FaceIndex, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(FaceIndex, __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(FaceIndex) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(FaceIndex) - 1 > 2 * PyLong_SHIFT)) {
                            return (FaceIndex) (((FaceIndex)-1)*(((((FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(FaceIndex) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(FaceIndex) - 1 > 2 * PyLong_SHIFT)) {
                            return (FaceIndex) ((((((FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(FaceIndex) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(FaceIndex) - 1 > 3 * PyLong_SHIFT)) {
                            return (FaceIndex) (((FaceIndex)-1)*(((((((FaceIndex)digits[2]) << PyLong_SHIFT) | (FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(FaceIndex) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(FaceIndex) - 1 > 3 * PyLong_SHIFT)) {
                            return (FaceIndex) ((((((((FaceIndex)digits[2]) << PyLong_SHIFT) | (FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(FaceIndex) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, 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(FaceIndex) - 1 > 4 * PyLong_SHIFT)) {
                            return (FaceIndex) (((FaceIndex)-1)*(((((((((FaceIndex)digits[3]) << PyLong_SHIFT) | (FaceIndex)digits[2]) << PyLong_SHIFT) | (FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(FaceIndex) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(FaceIndex, 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(FaceIndex) - 1 > 4 * PyLong_SHIFT)) {
                            return (FaceIndex) ((((((((((FaceIndex)digits[3]) << PyLong_SHIFT) | (FaceIndex)digits[2]) << PyLong_SHIFT) | (FaceIndex)digits[1]) << PyLong_SHIFT) | (FaceIndex)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(FaceIndex) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(FaceIndex, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(FaceIndex) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(FaceIndex, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        FaceIndex 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 (FaceIndex) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (FaceIndex) -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 (FaceIndex) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (FaceIndex) 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(FaceIndex) * 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 |= ((FaceIndex) 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(FaceIndex) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((FaceIndex) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((FaceIndex) 1) << (sizeof(FaceIndex) * 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 (FaceIndex) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to FaceIndex");
    return (FaceIndex) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to FaceIndex");
    return (FaceIndex) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Orientation(Orientation value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Orientation neg_one = (Orientation) -1, const_zero = (Orientation) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Orientation) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Orientation) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(Orientation) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Orientation) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Orientation) <= 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(Orientation),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(Orientation));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE Orientation __Pyx_PyLong_As_Orientation(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Orientation neg_one = (Orientation) -1, const_zero = (Orientation) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        Orientation val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (Orientation) -1;
        val = __Pyx_PyLong_As_Orientation(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(Orientation, __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(Orientation) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientation) >= 2 * PyLong_SHIFT)) {
                            return (Orientation) (((((Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Orientation) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientation) >= 3 * PyLong_SHIFT)) {
                            return (Orientation) (((((((Orientation)digits[2]) << PyLong_SHIFT) | (Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Orientation) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, 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(Orientation) >= 4 * PyLong_SHIFT)) {
                            return (Orientation) (((((((((Orientation)digits[3]) << PyLong_SHIFT) | (Orientation)digits[2]) << PyLong_SHIFT) | (Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)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 (Orientation) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(Orientation) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientation, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Orientation) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientation, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Orientation, __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(Orientation) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientation) - 1 > 2 * PyLong_SHIFT)) {
                            return (Orientation) (((Orientation)-1)*(((((Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(Orientation) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientation) - 1 > 2 * PyLong_SHIFT)) {
                            return (Orientation) ((((((Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(Orientation) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientation) - 1 > 3 * PyLong_SHIFT)) {
                            return (Orientation) (((Orientation)-1)*(((((((Orientation)digits[2]) << PyLong_SHIFT) | (Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Orientation) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientation) - 1 > 3 * PyLong_SHIFT)) {
                            return (Orientation) ((((((((Orientation)digits[2]) << PyLong_SHIFT) | (Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(Orientation) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, 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(Orientation) - 1 > 4 * PyLong_SHIFT)) {
                            return (Orientation) (((Orientation)-1)*(((((((((Orientation)digits[3]) << PyLong_SHIFT) | (Orientation)digits[2]) << PyLong_SHIFT) | (Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Orientation) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientation, 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(Orientation) - 1 > 4 * PyLong_SHIFT)) {
                            return (Orientation) ((((((((((Orientation)digits[3]) << PyLong_SHIFT) | (Orientation)digits[2]) << PyLong_SHIFT) | (Orientation)digits[1]) << PyLong_SHIFT) | (Orientation)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(Orientation) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientation, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Orientation) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientation, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        Orientation 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 (Orientation) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (Orientation) -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 (Orientation) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (Orientation) 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(Orientation) * 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 |= ((Orientation) 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(Orientation) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((Orientation) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((Orientation) 1) << (sizeof(Orientation) * 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 (Orientation) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Orientation");
    return (Orientation) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Orientation");
    return (Orientation) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatrixEntry(MatrixEntry value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const MatrixEntry neg_one = (MatrixEntry) -1, const_zero = (MatrixEntry) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(MatrixEntry) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(MatrixEntry) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(MatrixEntry) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(MatrixEntry) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(MatrixEntry) <= 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(MatrixEntry),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(MatrixEntry));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_CoveringType(CoveringType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const CoveringType neg_one = (CoveringType) -1, const_zero = (CoveringType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(CoveringType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(CoveringType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(CoveringType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(CoveringType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(CoveringType) <= 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(CoveringType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(CoveringType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_SolutionType(SolutionType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const SolutionType neg_one = (SolutionType) -1, const_zero = (SolutionType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(SolutionType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(SolutionType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(SolutionType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(SolutionType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(SolutionType) <= 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(SolutionType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(SolutionType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatrixParity(MatrixParity value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const MatrixParity neg_one = (MatrixParity) -1, const_zero = (MatrixParity) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(MatrixParity) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(MatrixParity) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(MatrixParity) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(MatrixParity) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(MatrixParity) <= 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(MatrixParity),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(MatrixParity));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Orbifold1(Orbifold1 value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Orbifold1 neg_one = (Orbifold1) -1, const_zero = (Orbifold1) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Orbifold1) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Orbifold1) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(Orbifold1) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Orbifold1) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Orbifold1) <= 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(Orbifold1),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(Orbifold1));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_unsigned_char(unsigned char value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned char) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned char) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned char) <= 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(unsigned char),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = 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(unsigned char));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE Permutation __Pyx_PyLong_As_Permutation(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Permutation neg_one = (Permutation) -1, const_zero = (Permutation) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        Permutation val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (Permutation) -1;
        val = __Pyx_PyLong_As_Permutation(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(Permutation, __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(Permutation) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Permutation) >= 2 * PyLong_SHIFT)) {
                            return (Permutation) (((((Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Permutation) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Permutation) >= 3 * PyLong_SHIFT)) {
                            return (Permutation) (((((((Permutation)digits[2]) << PyLong_SHIFT) | (Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Permutation) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, 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(Permutation) >= 4 * PyLong_SHIFT)) {
                            return (Permutation) (((((((((Permutation)digits[3]) << PyLong_SHIFT) | (Permutation)digits[2]) << PyLong_SHIFT) | (Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)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 (Permutation) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(Permutation) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Permutation, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Permutation) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Permutation, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Permutation, __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(Permutation) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Permutation) - 1 > 2 * PyLong_SHIFT)) {
                            return (Permutation) (((Permutation)-1)*(((((Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(Permutation) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Permutation) - 1 > 2 * PyLong_SHIFT)) {
                            return (Permutation) ((((((Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(Permutation) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Permutation) - 1 > 3 * PyLong_SHIFT)) {
                            return (Permutation) (((Permutation)-1)*(((((((Permutation)digits[2]) << PyLong_SHIFT) | (Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Permutation) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Permutation) - 1 > 3 * PyLong_SHIFT)) {
                            return (Permutation) ((((((((Permutation)digits[2]) << PyLong_SHIFT) | (Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(Permutation) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, 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(Permutation) - 1 > 4 * PyLong_SHIFT)) {
                            return (Permutation) (((Permutation)-1)*(((((((((Permutation)digits[3]) << PyLong_SHIFT) | (Permutation)digits[2]) << PyLong_SHIFT) | (Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Permutation) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Permutation, 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(Permutation) - 1 > 4 * PyLong_SHIFT)) {
                            return (Permutation) ((((((((((Permutation)digits[3]) << PyLong_SHIFT) | (Permutation)digits[2]) << PyLong_SHIFT) | (Permutation)digits[1]) << PyLong_SHIFT) | (Permutation)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(Permutation) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Permutation, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Permutation) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Permutation, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        Permutation 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 (Permutation) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (Permutation) -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 (Permutation) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (Permutation) 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(Permutation) * 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 |= ((Permutation) 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(Permutation) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((Permutation) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((Permutation) 1) << (sizeof(Permutation) * 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 (Permutation) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Permutation");
    return (Permutation) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Permutation");
    return (Permutation) -1;
}

/* CIntFromPy */
static CYTHON_INLINE Orientability __Pyx_PyLong_As_Orientability(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Orientability neg_one = (Orientability) -1, const_zero = (Orientability) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        Orientability val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (Orientability) -1;
        val = __Pyx_PyLong_As_Orientability(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(Orientability, __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(Orientability) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientability) >= 2 * PyLong_SHIFT)) {
                            return (Orientability) (((((Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Orientability) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientability) >= 3 * PyLong_SHIFT)) {
                            return (Orientability) (((((((Orientability)digits[2]) << PyLong_SHIFT) | (Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Orientability) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, 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(Orientability) >= 4 * PyLong_SHIFT)) {
                            return (Orientability) (((((((((Orientability)digits[3]) << PyLong_SHIFT) | (Orientability)digits[2]) << PyLong_SHIFT) | (Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)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 (Orientability) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(Orientability) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientability, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Orientability) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientability, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Orientability, __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(Orientability) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientability) - 1 > 2 * PyLong_SHIFT)) {
                            return (Orientability) (((Orientability)-1)*(((((Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(Orientability) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientability) - 1 > 2 * PyLong_SHIFT)) {
                            return (Orientability) ((((((Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(Orientability) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientability) - 1 > 3 * PyLong_SHIFT)) {
                            return (Orientability) (((Orientability)-1)*(((((((Orientability)digits[2]) << PyLong_SHIFT) | (Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Orientability) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Orientability) - 1 > 3 * PyLong_SHIFT)) {
                            return (Orientability) ((((((((Orientability)digits[2]) << PyLong_SHIFT) | (Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(Orientability) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, 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(Orientability) - 1 > 4 * PyLong_SHIFT)) {
                            return (Orientability) (((Orientability)-1)*(((((((((Orientability)digits[3]) << PyLong_SHIFT) | (Orientability)digits[2]) << PyLong_SHIFT) | (Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Orientability) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Orientability, 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(Orientability) - 1 > 4 * PyLong_SHIFT)) {
                            return (Orientability) ((((((((((Orientability)digits[3]) << PyLong_SHIFT) | (Orientability)digits[2]) << PyLong_SHIFT) | (Orientability)digits[1]) << PyLong_SHIFT) | (Orientability)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(Orientability) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientability, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Orientability) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Orientability, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        Orientability 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
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
        val = (Orientability) -1;
#endif
        if (unlikely(ret))
            return (Orientability) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Orientability");
    return (Orientability) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Orientability");
    return (Orientability) -1;
}

/* CIntFromPy */
static CYTHON_INLINE KLPStrandType __Pyx_PyLong_As_KLPStrandType(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const KLPStrandType neg_one = (KLPStrandType) -1, const_zero = (KLPStrandType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        KLPStrandType val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (KLPStrandType) -1;
        val = __Pyx_PyLong_As_KLPStrandType(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(KLPStrandType, __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(KLPStrandType) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPStrandType) >= 2 * PyLong_SHIFT)) {
                            return (KLPStrandType) (((((KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(KLPStrandType) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPStrandType) >= 3 * PyLong_SHIFT)) {
                            return (KLPStrandType) (((((((KLPStrandType)digits[2]) << PyLong_SHIFT) | (KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(KLPStrandType) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, 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(KLPStrandType) >= 4 * PyLong_SHIFT)) {
                            return (KLPStrandType) (((((((((KLPStrandType)digits[3]) << PyLong_SHIFT) | (KLPStrandType)digits[2]) << PyLong_SHIFT) | (KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)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 (KLPStrandType) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(KLPStrandType) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPStrandType, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(KLPStrandType) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPStrandType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(KLPStrandType, __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(KLPStrandType) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPStrandType) - 1 > 2 * PyLong_SHIFT)) {
                            return (KLPStrandType) (((KLPStrandType)-1)*(((((KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(KLPStrandType) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPStrandType) - 1 > 2 * PyLong_SHIFT)) {
                            return (KLPStrandType) ((((((KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(KLPStrandType) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPStrandType) - 1 > 3 * PyLong_SHIFT)) {
                            return (KLPStrandType) (((KLPStrandType)-1)*(((((((KLPStrandType)digits[2]) << PyLong_SHIFT) | (KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(KLPStrandType) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPStrandType) - 1 > 3 * PyLong_SHIFT)) {
                            return (KLPStrandType) ((((((((KLPStrandType)digits[2]) << PyLong_SHIFT) | (KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(KLPStrandType) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, 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(KLPStrandType) - 1 > 4 * PyLong_SHIFT)) {
                            return (KLPStrandType) (((KLPStrandType)-1)*(((((((((KLPStrandType)digits[3]) << PyLong_SHIFT) | (KLPStrandType)digits[2]) << PyLong_SHIFT) | (KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(KLPStrandType) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPStrandType, 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(KLPStrandType) - 1 > 4 * PyLong_SHIFT)) {
                            return (KLPStrandType) ((((((((((KLPStrandType)digits[3]) << PyLong_SHIFT) | (KLPStrandType)digits[2]) << PyLong_SHIFT) | (KLPStrandType)digits[1]) << PyLong_SHIFT) | (KLPStrandType)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(KLPStrandType) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPStrandType, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(KLPStrandType) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPStrandType, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        KLPStrandType 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
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
        val = (KLPStrandType) -1;
#endif
        if (unlikely(ret))
            return (KLPStrandType) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to KLPStrandType");
    return (KLPStrandType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to KLPStrandType");
    return (KLPStrandType) -1;
}

/* CIntFromPy */
static CYTHON_INLINE KLPCrossingType __Pyx_PyLong_As_KLPCrossingType(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const KLPCrossingType neg_one = (KLPCrossingType) -1, const_zero = (KLPCrossingType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        KLPCrossingType val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (KLPCrossingType) -1;
        val = __Pyx_PyLong_As_KLPCrossingType(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(KLPCrossingType, __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(KLPCrossingType) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPCrossingType) >= 2 * PyLong_SHIFT)) {
                            return (KLPCrossingType) (((((KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(KLPCrossingType) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPCrossingType) >= 3 * PyLong_SHIFT)) {
                            return (KLPCrossingType) (((((((KLPCrossingType)digits[2]) << PyLong_SHIFT) | (KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(KLPCrossingType) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, 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(KLPCrossingType) >= 4 * PyLong_SHIFT)) {
                            return (KLPCrossingType) (((((((((KLPCrossingType)digits[3]) << PyLong_SHIFT) | (KLPCrossingType)digits[2]) << PyLong_SHIFT) | (KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)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 (KLPCrossingType) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(KLPCrossingType) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPCrossingType, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(KLPCrossingType) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPCrossingType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(KLPCrossingType, __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(KLPCrossingType) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPCrossingType) - 1 > 2 * PyLong_SHIFT)) {
                            return (KLPCrossingType) (((KLPCrossingType)-1)*(((((KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(KLPCrossingType) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPCrossingType) - 1 > 2 * PyLong_SHIFT)) {
                            return (KLPCrossingType) ((((((KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(KLPCrossingType) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPCrossingType) - 1 > 3 * PyLong_SHIFT)) {
                            return (KLPCrossingType) (((KLPCrossingType)-1)*(((((((KLPCrossingType)digits[2]) << PyLong_SHIFT) | (KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(KLPCrossingType) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(KLPCrossingType) - 1 > 3 * PyLong_SHIFT)) {
                            return (KLPCrossingType) ((((((((KLPCrossingType)digits[2]) << PyLong_SHIFT) | (KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(KLPCrossingType) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, 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(KLPCrossingType) - 1 > 4 * PyLong_SHIFT)) {
                            return (KLPCrossingType) (((KLPCrossingType)-1)*(((((((((KLPCrossingType)digits[3]) << PyLong_SHIFT) | (KLPCrossingType)digits[2]) << PyLong_SHIFT) | (KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(KLPCrossingType) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(KLPCrossingType, 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(KLPCrossingType) - 1 > 4 * PyLong_SHIFT)) {
                            return (KLPCrossingType) ((((((((((KLPCrossingType)digits[3]) << PyLong_SHIFT) | (KLPCrossingType)digits[2]) << PyLong_SHIFT) | (KLPCrossingType)digits[1]) << PyLong_SHIFT) | (KLPCrossingType)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(KLPCrossingType) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPCrossingType, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(KLPCrossingType) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(KLPCrossingType, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        KLPCrossingType 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
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
        val = (KLPCrossingType) -1;
#endif
        if (unlikely(ret))
            return (KLPCrossingType) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to KLPCrossingType");
    return (KLPCrossingType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to KLPCrossingType");
    return (KLPCrossingType) -1;
}

/* CIntFromPy */
static CYTHON_INLINE unsigned char __Pyx_PyLong_As_unsigned_char(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        unsigned char val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (unsigned char) -1;
        val = __Pyx_PyLong_As_unsigned_char(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(unsigned char, __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(unsigned char) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT)) {
                            return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT)) {
                            return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT)) {
                            return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)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 (unsigned char) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(unsigned char) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(unsigned char, __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(unsigned char) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) {
                            return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) {
                            return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) {
                            return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) {
                            return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) {
                            return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) {
                            return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(unsigned char) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(unsigned char) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        unsigned char 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 (unsigned char) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (unsigned char) -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 (unsigned char) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (unsigned char) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(unsigned char) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((unsigned char) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(unsigned char) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((unsigned char) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((unsigned char) 1) << (sizeof(unsigned char) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (unsigned char) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned char");
    return (unsigned char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned char");
    return (unsigned char) -1;
}

/* Globals */
static PyObject* __Pyx_Globals(void) {
    return __Pyx_NewRef(__pyx_mstate_global->__pyx_d);
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__41);
    }
    goto done;
}
#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);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* IterNextPlain */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
    if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
        __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
    return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
    return result;
#else
    (void)__Pyx_GetBuiltinName; // only for early limited API
    iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
    assert(iternext);
    return iternext(iterator);
#endif
}

/* ReturnWithStopIteration */
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
    if (value == Py_None) {
        if (async || !iternext)
            PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
        return;
    }
    __Pyx__ReturnWithStopIteration(value, async);
}
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
#endif
    PyObject *exc;
    PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
#if CYTHON_COMPILING_IN_CPYTHON
    if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        if (PY_VERSION_HEX >= (0x030e00A1)) {
            exc = __Pyx_PyObject_CallOneArg(exc_type, value);
        } else {
            PyObject *args_tuple = PyTuple_New(1);
            if (unlikely(!args_tuple)) return;
            Py_INCREF(value);
            PyTuple_SET_ITEM(args_tuple, 0, value);
            exc = PyObject_Call(exc_type, args_tuple, NULL);
            Py_DECREF(args_tuple);
        }
        if (unlikely(!exc)) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(exc_type);
        __Pyx_ErrRestore(exc_type, exc, NULL);
        return;
    }
    #endif
#else
    exc = __Pyx_PyObject_CallOneArg(exc_type, value);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(exc_type, exc);
    Py_DECREF(exc);
}

/* CoroutineBase */
#if !CYTHON_COMPILING_IN_LIMITED_API
#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
#endif // CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void
__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
#if CYTHON_USE_AM_SEND
    gen->yieldfrom_am_send = NULL;
#endif
    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;
        }
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
            value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
            if (unlikely(!value)) goto limited_api_failure;
            #else
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            #endif
            Py_DECREF(ev);
        }
        else if (unlikely(PyTuple_Check(ev))) {
            Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(tuple_size < 0)) {
                Py_XDECREF(tb);
                Py_DECREF(ev);
                Py_DECREF(et);
                return -1;
            }
            #endif
            if (tuple_size >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#elif CYTHON_ASSUME_SAFE_MACROS
                value = PySequence_ITEM(ev, 0);
#else
                value = PySequence_GetItem(ev, 0);
                if (!value) goto limited_api_failure;
#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 CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
#else
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
#endif
    Py_DECREF(ev);
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!value)) return -1;
#endif
    *pvalue = value;
    return 0;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
  limited_api_failure:
    Py_XDECREF(et);
    Py_XDECREF(tb);
    Py_XDECREF(ev);
    return -1;
#endif
}
static CYTHON_INLINE
__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
    if (*retval) {
        return PYGEN_NEXT;
    } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
        return PYGEN_RETURN;
    } else {
        return PYGEN_ERROR;
    }
}
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);
}
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(PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
    if (unlikely(self->resume_label == -1)) {
        __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
        return PYGEN_ERROR;
    }
#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_LIMITED_API || 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
    retval = self->body(self, tstate, value);
#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
    *result = retval;
    if (self->resume_label == -1) {
        return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
    }
    return PYGEN_NEXT;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    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
}
#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
    ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
static PyObject *
__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (likely(result == PYGEN_RETURN)) {
        int is_async = 0;
        #ifdef __Pyx_AsyncGen_USED
        is_async = __Pyx_AsyncGen_CheckExact(gen);
        #endif
        __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
        Py_XDECREF(retval);
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON
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 __Pyx_PySendResult
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
    __Pyx_PySendResult result;
    PyObject *val = NULL;
    assert(__Pyx_Coroutine_get_is_running(gen));
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
    Py_XDECREF(val);
    return result;
}
#if CYTHON_USE_AM_SEND
static __Pyx_PySendResult
__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
    PyObject *ret = NULL;
    __Pyx_PySendResult delegate_result, result;
    assert(__Pyx_Coroutine_get_is_running(gen));
    delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
    if (delegate_result == PYGEN_NEXT) {
        assert (ret != NULL);
        *retval = ret;
        return PYGEN_NEXT;
    }
    assert (delegate_result != PYGEN_ERROR || ret == NULL);
    __Pyx_Coroutine_Undelegate(gen);
    result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
    Py_XDECREF(ret);
    return result;
}
#endif
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
}
static __Pyx_PySendResult
__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    __Pyx_PySendResult result;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
      #if !CYTHON_USE_AM_SEND
        #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
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
      #endif
        {
            #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
            if (value == Py_None && PyIter_Check(yf))
                ret = __Pyx_PyIter_Next_Plain(yf);
            else
            #endif
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
        }
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            *retval = ret;
            return PYGEN_NEXT;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return result;
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    CYTHON_UNUSED_VAR(gen);
    assert(__Pyx_Coroutine_get_is_running(gen));
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    #endif
    {
        PyObject *meth;
        result = PYGEN_RETURN;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval)) {
                result = PYGEN_ERROR;
            }
        }
    }
    Py_XDECREF(retval);
    return result == PYGEN_ERROR ? -1 : 0;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
            ret = __Pyx_PyIter_Next_Plain(yf);
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static __Pyx_PySendResult
__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PySendResult result;
    PyObject *yf;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    yf = gen->yieldfrom;
    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);
    result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
    if (result == PYGEN_ERROR) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_Coroutine_unset_is_running(gen);
        if (!__Pyx_PyErr_Occurred()) {
            return PYGEN_RETURN;
        } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
            __Pyx_PyErr_Clear();
            return PYGEN_RETURN;
        }
        return PYGEN_ERROR;
    } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_RETURN;
    } else {
        const char *msg;
        Py_DECREF(*retval);
        *retval = NULL;
        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)) {
            msg = "async generator ignored GeneratorExit";
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_ERROR;
    }
}
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;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    yf = gen->yieldfrom;
    if (yf) {
        __Pyx_PySendResult result;
        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)
                goto propagate_exception;
            goto throw_here;
        }
        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_mstate_global->__pyx_n_u_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    __Pyx_Coroutine_unset_is_running(gen);
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                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);
        }
        Py_DECREF(yf);
        if (ret) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
propagate_exception:
    {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
    }
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, "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) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
        if (e) return e;
    }
    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);
    __Pyx_Coroutine_Undelegate(gen);
    __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 CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        {
            destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
            if (del) 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);
}
#if CYTHON_USE_TP_FINALIZE
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;
    }
    __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 (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
        if (result == PYGEN_ERROR) {
            PyErr_WriteUnraisable(self);
        } else {
            Py_XDECREF(retval);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
}
#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 (unlikely(value == NULL || !PyUnicode_Check(value))) {
        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 (unlikely(value == NULL || !PyUnicode_Check(value))) {
        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)
{
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject *frame;
    #if PY_VERSION_HEX >= 0x030d0000
    Py_BEGIN_CRITICAL_SECTION(self);
    #endif
    frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        PyObject *globals = PyDict_New();
        if (unlikely(!globals)) return NULL;
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            globals,                        /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        Py_DECREF(globals);
        if (unlikely(!frame))
            return NULL;
        if (unlikely(self->gi_frame)) {
            Py_DECREF(frame);
            frame = self->gi_frame;
        } else {
            self->gi_frame = frame;
        }
    }
    Py_INCREF(frame);
    #if PY_VERSION_HEX >= 0x030d0000
    Py_END_CRITICAL_SECTION();
    #endif
    return frame;
#else
    CYTHON_UNUSED_VAR(self);
    Py_RETURN_NONE;
#endif
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
    CYTHON_UNUSED_VAR(context);
    PyObject *frame = self->gi_frame;
    if (frame)
        return __Pyx_NewRef(frame);
    return __Pyx__Coroutine_get_frame(self);
}
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;
    gen->yieldfrom_am_send = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
    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;
}
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    gen->is_running = 1;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    assert(gen->is_running);
    gen->is_running = 0;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
}
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
    CYTHON_UNUSED_VAR(closure);
    char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
    if (result) Py_RETURN_TRUE;
    else Py_RETURN_FALSE;
}
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
    Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
    if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
        return;
    }
    memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
    static_amsend_methods->am_send = am_send;
    type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
}
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
    PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
                         self_type_name);
    __Pyx_DECREF_TypeName(self_type_name);
    return NULL;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     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,
     PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     PyDoc_STR("object being iterated by 'yield from', or None")},
    {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     PyDoc_STR("name of the generator"), 0},
    {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     PyDoc_STR("qualified name of the generator"), 0},
    {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     PyDoc_STR("Frame of the generator"), 0},
    {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
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 *) PyObject_GenericGetAttr},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_GeneratorType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2
static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
#endif
static int __pyx_Generator_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
    if (unlikely(!mstate->__pyx_GeneratorType)) {
        return -1;
    }
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
#endif
    return 0;
}
static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *retval = NULL;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    __Pyx_Coroutine_unset_is_running(gen);
    (void) result;
    assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
    assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
    return retval;
}

/* GetRuntimeVersion */
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    static unsigned long __Pyx_cached_runtime_version = 0;
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
    return __Pyx_cached_runtime_version;
#endif
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* NewCodeObj */
#if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                       PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                       PyObject *fv, PyObject *cell, PyObject* fn,
                                       PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        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, "iiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    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
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL
        && !CYTHON_COMPILING_IN_GRAAL) {
        line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length);
        if (unlikely(!line_table_bytes)) goto done;
        Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    Py_XDECREF(line_table_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) {
    while (t->s) {
        PyObject *str;
        if (t->is_unicode) {
            if (t->intern) {
                str = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[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;
        *target = str;
        if (PyObject_Hash(str) == -1)
            return -1;
        ++t;
        ++target;
    }
    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_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
}
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (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;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  else if (!PyErr_Occurred()) {
      PyErr_SetString(PyExc_TypeError,
                      "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
  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 = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
